[PATCH libreoffice-4-0] Position view below toolbox and search bar when resizing Tem...

Rafael Dominguez (via Code Review) gerrit at gerrit.libreoffice.org
Sun Apr 7 11:53:05 PDT 2013


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 at gmail.com>



More information about the LibreOffice mailing list