[Libreoffice-commits] core.git: sfx2/inc sfx2/source
Cédric Bosdonnat
cedric.bosdonnat at free.fr
Fri Mar 22 09:14:17 PDT 2013
sfx2/inc/sfx2/templateview.hxx | 1 -
sfx2/source/control/templateabstractview.cxx | 10 ++++++++--
sfx2/source/control/templateview.cxx | 16 +++++-----------
sfx2/source/control/templateview.src | 6 ------
4 files changed, 13 insertions(+), 20 deletions(-)
New commits:
commit 7a25aa2821ccf7318ce4a13efe171763989009d5
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Fri Mar 22 16:33:20 2013 +0100
fdo#61390: Fixed the tabstop in the TemplateView.
Change-Id: I887b11646efb9a839da11cd3e20cdf7e532caf3e
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index b7ff215..104cb11 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -54,7 +54,6 @@ private:
Link maOpenHdl;
TemplateAbstractView* mpMasterView;
- Control maButtons;
PushButton maAllButton;
FixedText maFTName;
sal_uInt16 mnId;
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 737f087..b6cd646 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -115,7 +115,7 @@ bool ViewFilter_Keyword::operator ()(const ThumbnailViewItem *pItem)
TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
- mpItemView(new TemplateView(this)),
+ mpItemView(new TemplateView(pParent)),
mbFilteredResults(false),
meFilterOption(FILTER_APP_WRITER)
{
@@ -124,7 +124,7 @@ TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle,
TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId &rResId, bool bDisableTransientChildren)
: ThumbnailView(pParent,rResId,bDisableTransientChildren),
- mpItemView(new TemplateView(this)),
+ mpItemView(new TemplateView(pParent)),
mbFilteredResults(false),
meFilterOption(FILTER_APP_WRITER)
{
@@ -186,8 +186,14 @@ void TemplateAbstractView::filterTemplatesByApp (const FILTER_APPLICATION &eApp)
void TemplateAbstractView::showOverlay (bool bVisible)
{
+ Show(!bVisible);
mpItemView->Show(bVisible);
+ mpItemView->SetPosSizePixel(GetPosPixel(), GetSizePixel());
+ mpItemView->SetStyle(GetStyle());
+
+ mpItemView->GrabFocus();
+
// Clear items is the overlay is closed.
if (!bVisible)
{
diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx
index 21b2603..a19c8c5 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -34,14 +34,13 @@ using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
TemplateView::TemplateView (Window *pParent)
- : ThumbnailView(pParent,WB_VSCROLL),
+ : ThumbnailView(pParent,WB_VSCROLL | WB_TABSTOP),
mpMasterView(NULL),
- maButtons(this, SfxResId(CONTROL_BUTTONS)),
- maAllButton(&maButtons, SfxResId(BTN_ALL_TEMPLATES)),
- maFTName(&maButtons, SfxResId(FT_NAME)),
+ maAllButton(this, SfxResId(BTN_ALL_TEMPLATES)),
+ maFTName(this, SfxResId(FT_NAME)),
mnId(0)
{
- mnHeaderHeight = maButtons.GetSizePixel().getHeight();
+ mnHeaderHeight = maAllButton.GetSizePixel().getHeight() + maAllButton.GetPosPixel().Y() * 2;
maAllButton.SetStyle(maAllButton.GetStyle() | WB_FLATBUTTON);
}
@@ -88,13 +87,8 @@ void TemplateView::Resize()
Size aWinSize = GetOutputSize();
// Set the buttons panel and buttons size
- Size aPanelSize = maButtons.GetSizePixel();
- int nDeltaW = aWinSize.getWidth() - aPanelSize.getWidth();
- aPanelSize.setWidth(aWinSize.getWidth());
- maButtons.SetSizePixel(aPanelSize);
-
Size aNameSize = maFTName.GetSizePixel();
- aNameSize.setWidth(aNameSize.getWidth() + nDeltaW);
+ aNameSize.setWidth( aWinSize.getWidth() - maFTName.GetPosPixel().X());
maFTName.SetSizePixel(aNameSize);
ThumbnailView::Resize();
diff --git a/sfx2/source/control/templateview.src b/sfx2/source/control/templateview.src
index 1f78a88..5836a95 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -9,12 +9,6 @@
#include "templateview.hrc"
-Control CONTROL_BUTTONS
-{
- Size = MAP_APPFONT( 290, 17 );
- TabStop = False;
-};
-
PushButton BTN_ALL_TEMPLATES
{
Pos = MAP_APPFONT( 1, 1 );
More information about the Libreoffice-commits
mailing list