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


Hi,

Bug 33794 solved.

I confirm that this and all my future contributions are under
MPL/LGPLv3+ licenses.


Bence Tomcsik
From 5dacbe2539f17dd23e78caada8264a062d8dfa41 Mon Sep 17 00:00:00 2001
From: Tomcsik Bence <tomcsikbence@gmail.com>
Date: Fri, 13 Jan 2012 14:50:06 +0100
Subject: [PATCH] The "Open..." button's more room problem solved fdo#33794

I implemented the maximum search of the initial screen's buttons.
mnTextColumnWidth[] and mnColumnWidth[] are equal to the widest
button's width, considering that the open button contains a black
triangle.
---
 framework/source/services/backingwindow.cxx |   31 ++++++++++++++++----------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/framework/source/services/backingwindow.cxx 
b/framework/source/services/backingwindow.cxx
index a28f80f..bd8e001 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -607,19 +607,26 @@ void BackingWindow::initControls()
     if( mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20 > maControlRect.GetWidth() )
         maControlRect.Right() = maControlRect.Left() + mnColumnWidth[0] + mnColumnWidth[1] + 
mnBtnPos + 20;
 
-    mnTextColumnWidth[0] = mnColumnWidth[0];
-    mnTextColumnWidth[1] = mnColumnWidth[1];
+    long nTextWidthMax = maWriterButton.GetTextWidth( maWriterButton.GetText() ) + 
maButtonImageSize.Width() + 8;
+
+    if( nTextWidthMax < maDrawButton.GetTextWidth( maDrawButton.GetText() ) + 
maButtonImageSize.Width() + 8 )
+        nTextWidthMax = maDrawButton.GetTextWidth( maDrawButton.GetText() ) + 
maButtonImageSize.Width() + 8;
+    if( nTextWidthMax < maCalcButton.GetTextWidth( maCalcButton.GetText() ) + 
maButtonImageSize.Width() + 8 )
+        nTextWidthMax = maCalcButton.GetTextWidth( maCalcButton.GetText() ) + 
maButtonImageSize.Width() + 8;
+    if( nTextWidthMax < maDBButton.GetTextWidth( maDBButton.GetText() ) + 
maButtonImageSize.Width() + 8 )
+        nTextWidthMax = maDBButton.GetTextWidth( maDBButton.GetText() ) + 
maButtonImageSize.Width() + 8;
+    if( nTextWidthMax < maImpressButton.GetTextWidth( maImpressButton.GetText() ) + 
maButtonImageSize.Width() + 8 )
+        nTextWidthMax = maImpressButton.GetTextWidth( maImpressButton.GetText() ) + 
maButtonImageSize.Width() + 8;
+    if( nTextWidthMax < maMathButton.GetTextWidth( maMathButton.GetText() ) + 
maButtonImageSize.Width() + 8 )
+        nTextWidthMax = maMathButton.GetTextWidth( maMathButton.GetText() ) + 
maButtonImageSize.Width() + 8;
+    if( nTextWidthMax < maOpenButton.GetTextWidth( maOpenButton.GetText() ) + 
maButtonImageSize.Width() + 26 )
+        nTextWidthMax = maOpenButton.GetTextWidth( maOpenButton.GetText() ) + 
maButtonImageSize.Width() + 26;
+    if( nTextWidthMax < maTemplateButton.GetTextWidth( maTemplateButton.GetText() ) + 
maButtonImageSize.Width() + 8 )
+        nTextWidthMax = maTemplateButton.GetTextWidth( maTemplateButton.GetText() ) + 
maButtonImageSize.Width() + 8;
+
+    mnTextColumnWidth[0] = mnColumnWidth[0] = nTextWidthMax;
+    mnTextColumnWidth[1] = mnColumnWidth[1] = nTextWidthMax;
 
-    if( mnTextColumnWidth[1] > mnTextColumnWidth[0] )
-    {
-        mnColumnWidth[0]     = mnColumnWidth[1];
-        mnTextColumnWidth[0] = mnTextColumnWidth[1];
-    }
-    else
-    {
-        mnColumnWidth[1]     = mnColumnWidth[0];
-        mnTextColumnWidth[1] = mnTextColumnWidth[0];
-    }
     if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 )
     {
         maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2;
-- 
1.7.7


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.