summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorC├ędric Bosdonnat <cedric.bosdonnat@free.fr>2013-03-22 16:33:20 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-03-22 17:10:12 +0000
commit9296cf4088a0637f0326803fe220816ebc8daf22 (patch)
tree684408e00731efddd33f919f03c41a4d8364b011
parent43bbcfc7a1625aa79b69c443c492f0969b31baad (diff)
fdo#61390: Fixed the tabstop in the TemplateView.
Change-Id: I887b11646efb9a839da11cd3e20cdf7e532caf3e (cherry picked from commit 7a25aa2821ccf7318ce4a13efe171763989009d5) Reviewed-on: https://gerrit.libreoffice.org/2913 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--sfx2/inc/sfx2/templateview.hxx1
-rw-r--r--sfx2/source/control/templateabstractview.cxx10
-rw-r--r--sfx2/source/control/templateview.cxx16
-rw-r--r--sfx2/source/control/templateview.src6
4 files changed, 13 insertions, 20 deletions
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index 3e2a7c846a2d..e219905a6d3e 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -51,7 +51,6 @@ protected:
private:
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 de2091f22ecd..14ab81161c8e 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -114,7 +114,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)
{
@@ -123,7 +123,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)
{
@@ -190,8 +190,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 615465df3862..46ebeaa964c3 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 db4d575ad365..8549c96485e4 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -8,12 +8,6 @@
#include "templateview.hrc"
-Control CONTROL_BUTTONS
-{
- Size = MAP_APPFONT( 290, 17 );
- TabStop = False;
-};
-
PushButton BTN_ALL_TEMPLATES
{
Pos = MAP_APPFONT( 1, 1 );