KMenu title is navigable with the keyboard

Thomas Lübking thomas.luebking at web.de
Thu Nov 19 19:21:09 GMT 2009


Hi Hugo

Am Thursday 19 November 2009 schrieb Hugo Pereira Da Costa:
> Well, at least in a kstyle point of view there are: sizeForContents
> returned by kstyle for separators also ignores whether the item has text
> and icon. You have to reimplement that in the derived style if you want
> to have it right.
But that's no "hack" but just implementing features ;-)
Though it would likely be a good idea to do that in KStyle (iff kstyle 
implements the sizeforcontents in question) as QCommonStyle does.
 
> Separators are simply ignored when calculating the width. So that if you
> have a long title, and small items, well, you're title is shrinked. Did
Humm? No?
looking into the qmenu (4.6) code (what i just did, see patch some mails down 
;-) 

QMenu
a) calls sizeFromContents() on /all/ elements (separators or not)
b) then updates the max_column_width
-> setting the proper width/height in sizeFromContents for entitled separatos 
just worked (i've never spent much time on worrying why =D

BUT: not for widget actions, the widget is in charge to set proper dimensions.

> you have the same issue in bespin ? How did you address ? (I can check
> your code but its faster if its on top of your head).
But actually bespin fails on this - in case of an entitled separator it does 
only apply the required height, no the width
-> /me on shame, gonna fix it ;-)

> And even that is not enough, because of QMenu:: updateActionRects
> (unless I misread the code)
no, the actionrects /will/ incorporate the style provided size - but you must 
handle the "to show or not to show" logic in the style - that sounds like few 
fun and much-a-hack
 
Thomas




More information about the kde-core-devel mailing list