Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3256

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/56/3256/1

Position view below toolbox and search bar when resizing Template dialog.

Change-Id: I94806487f4cebde965652997a595c7263d710338
---
M sfx2/source/doc/templatedlg.cxx
1 file changed, 10 insertions(+), 16 deletions(-)



diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 9cf663c..9c81d6d 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -341,13 +341,9 @@
 
 void SfxTemplateManagerDlg::Resize()
 {
-    Size aWinSize = GetSizePixel();
-
     // Fit the tab page control and the toolbars
-    Size aTabSize = maTabControl.GetSizePixel();
-    aTabSize.setWidth(aWinSize.getWidth());
-    maTabControl.SetSizePixel(aTabSize);
-    maTabControl.SetTabPageSizePixel(aWinSize);
+    maTabControl.SetSizePixel(GetSizePixel());
+    const Size aWinSize = maTabControl.GetTabPageSizePixel();
 
     // Calculate toolboxes size and positions
     Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel();
@@ -367,15 +363,9 @@
     mpActionBar->SetPosSizePixel(aActionPos,aActionSize);
     mpTemplateBar->SetSizePixel(aTemplateSize);
 
-    // Set view position below toolbox
     Point aViewPos = maView->GetPosPixel();
     aViewPos.setY(nToolbarsHeight);
     aViewPos.setX(0);
-    Size aThumbSize(aWinSize.getWidth(), maTabControl.GetTabPageSizePixel().getHeight() - 
aViewPos.getY());
-    maView->SetPosSizePixel(aViewPos, aThumbSize);
-
-    if (aWinSize.getHeight() < aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER)
-        aWinSize.setHeight(aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER);
 
     // Set search box position and size
     Size aSearchSize = mpSearchEdit->CalcMinimumSize();
@@ -384,11 +374,15 @@
     mpSearchEdit->SetSizePixel(aSearchSize);
     mpSearchEdit->SetPosPixel(Point(PADDING_DLG_BORDER,aViewPos.Y()));
 
-    maView->SetSizePixel(aThumbSize);
-    mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize);
-    mpSearchView->SetSizePixel(aThumbSize);
+    if (mpSearchEdit->IsVisible())
+        aViewPos.setY(aViewPos.getY() + mpSearchEdit->GetSizePixel().getHeight() );
 
-    mpCurView->Resize();
+    // Set view position below toolbox and search box
+    Size aThumbSize(aWinSize.getWidth(), aWinSize.getHeight() - aViewPos.getY());
+
+    maView->SetPosSizePixel(aViewPos,aThumbSize);
+    mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize);
+    mpSearchView->SetPosSizePixel(aViewPos,aThumbSize);
 
     ModelessDialog::Resize();
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94806487f4cebde965652997a595c7263d710338
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Rafael Dominguez <venccsralph@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.