[PATCH libreoffice-4-0] fdo#61390: Fixed the tabstop in the TemplateView.

Bosdonnat Cedric (via Code Review) gerrit at gerrit.libreoffice.org
Fri Mar 22 09:17:29 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2913

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/13/2913/1

fdo#61390: Fixed the tabstop in the TemplateView.

Change-Id: I887b11646efb9a839da11cd3e20cdf7e532caf3e
(cherry picked from commit 7a25aa2821ccf7318ce4a13efe171763989009d5)
---
M sfx2/inc/sfx2/templateview.hxx
M sfx2/source/control/templateabstractview.cxx
M sfx2/source/control/templateview.cxx
M sfx2/source/control/templateview.src
4 files changed, 13 insertions(+), 20 deletions(-)



diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index 3e2a7c8..e219905 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -51,7 +51,6 @@
 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 de2091f..14ab811 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -114,7 +114,7 @@
 
 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, 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::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 615465d..46ebeaa 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -34,14 +34,13 @@
 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 @@
     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 db4d575..8549c96 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 );

-- 
To view, visit https://gerrit.libreoffice.org/2913
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I887b11646efb9a839da11cd3e20cdf7e532caf3e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Bosdonnat Cedric <cedric.bosdonnat at free.fr>



More information about the LibreOffice mailing list