[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    patch to fix bug #42400
From:       Ariya Hidayat <ariya () tf ! itb ! ac ! id>
Date:       2002-08-20 7:59:52
[Download RAW message or body]

For detailed info on the bug, read http://bugs.kde.org/db/42/42400.html
(or, of course, with almighty KBugBuster!).

Even though I reassigned this bug to kdelibs, I still feel that font size
combo box (in the toolbar) which keeps growing or expanding when either
the window is resized or toolbars are arranged is a bit of joke. I don't
know whether this will get fixed in KFontSizeAction, and even if it's
fixed for KDE 3.1, our KOffice 1.2 still relies on KDE 3.0.3 libraries,
right ?

The following patch provides workaround for the problem.  Principally,
same thing can go to KWord and KPresenter. Nevertheless, it should be
applied only for the sake of 1.2 release.

Please review, or flame me if you want.


["fontcombo.patch" (TEXT/PLAIN)]

Index: kspread_view.cc
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_view.cc,v
retrieving revision 1.583
diff -u -3 -p -r1.583 kspread_view.cc
--- kspread_view.cc	2002/08/11 12:30:46	1.583
+++ kspread_view.cc	2002/08/20 07:50:35
@@ -998,6 +998,15 @@ void KSpreadView::initializeTextProperty
   connect( m_selectFontSize, SIGNAL( fontSizeChanged( int ) ), this,
            SLOT( fontSizeSelected( int ) ) );
 
+  // HACK limit width of combo box in KFontSizeAction
+  // should use the combo box font metrics, but current font metrics
+  // also works most of the time
+  QStringList fontSizes = m_selectFontSize->items();
+  int maxwidth = 0;
+  for( unsigned int i=0; i<fontSizes.count(); i++ ) 
+    maxwidth = QMAX( maxwidth, fontMetrics().width( fontSizes[i] ) );
+  m_selectFontSize->setComboWidth( maxwidth + 5 );
+
   /*******************************/
   m_fontSizeUp = new KAction( i18n("Increase Font Size"), "fontsizeup", 0, this,
                               SLOT( increaseFontSize() ), actionCollection(),

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic