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

List:       kde-commits
Subject:    kdelibs/kstyles/keramik
From:       Maks Orlovich <mo002j () mail ! rochester ! edu>
Date:       2003-07-19 16:53:36
[Download RAW message or body]

CVS commit by orlovich: 

Put in a small workaround for the case when we're told to draw combos w/o 
sufficient space -- not too uncommon for websites, many of which use pixel
width specifications: make sure to expand the completion box at least somewhat.
Doesn't make what's selected clear when cclosed (as the main bevel is still the same size);
but one can at least read things somewhat when the box is expanded. 
(No, I am not sure this is the best place to put it, as this can potentially affect
other styles, although that'd be quite less likely; but putting something like this into the libs
or KHTML would require a lot more code/would be more invasive).


  M +8 -4      keramik.cpp   1.109


--- kdelibs/kstyles/keramik/keramik.cpp  #1.108:1.109
@@ -2429,8 +2429,12 @@ QRect KeramikStyle::querySubControlMetri
                                 case SC_ComboBoxListBoxPopup:
                                 {
+                                        //Note that the widget here == the combo, not the completion
+                                        //box, so we don't get any recursion
+                                        int suggestedWidth = widget->sizeHint().width(); 
                                         QRect def = opt.rect();
-                                        if ( widget->inherits( "KCompletionBox" ) )
-                                                def.addCoords( -4, 4, 10, 8 );
-                                        else def.addCoords( 4, -4, -6, 4 );
+                                        def.addCoords( 4, -4, -6, 4 );
+                                        
+                                        if ((def.width() - suggestedWidth < -12) && (def.width() < 80))
+                                                def.setWidth(QMIN(80, suggestedWidth - 10));
 
                                         return def;


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

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