KMenu title is navigable with the keyboard

Hugo Pereira Da Costa hugo at oxygen-icons.org
Thu Nov 19 18:59:45 GMT 2009


Hi Thomas,

>
> widgets are rendered properly.
>    
> The proposed patch did not alter the widget painting - they remain
> toolbuttons.
>
>    
By properly I meant: not selectable, hoverable, focusable, etc. Without 
affecting the "normal state" painting.
>> I should fix the style (this is done locally, I just have to commit), so
>> that both the "hacked separator" and the current widget are rendered the
>> same way.
>>      
> There's no hack on the QMenu separators (present, intended or possible ...
> mmhhh possible might it be... ;-) - they're currently just collapsed (too)
> agressively.
>    
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.

And in fact (correct me if I am wrong) there is another issue when 
calculating menu size in Qt:
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 
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).

>
>    
>> I would rather not let the style hack the collapse separator style. This
>> is an application issue...
>>      
> .. and no good idea either, for
> a) if there's only unreliable semi-support it's unusable
> b) the style needs to care about the position and content relation of
> separators when defining the separator height, i.e. the widget.
>    
yes. See above. As far as I understand, you need to handle in the style 
the return value for CT_MenuItem. KStyle doesn't do it right.
And even that is not enough, because of QMenu:: updateActionRects
(unless I misread the code)

>    
>> At some point, (after kde4.4 is out) one could possibly replace the
>> title widget (internals) to use these hacked separators, or leave the
>> situation like now (after patch). Not a big deal.
>>      
> I would rather suggest to get this done in Qt - collapsing is in general a
> good idea (even for entitled separators) - we just need a better logic behind
> it (i.e. check whether the "next element is a separator", the "separator is on
> the end" or "on the beginning and has no title" - currently Qt checks inverse,
> i.e. keeps the first seperator)
> The change is pretty simple, though - you drop the lastVisibleAction pass and
> reverse the size calcutaion (++i ->  --i), store the last found handled
> action(separator or action) check if it's a titleless separator, unset the
> size in case and you're done ;-)
>
> If a 4.6 beta change still applies to the current Qt git and someone plays my
> merge request monkey, i'll provide a patch =)
>
> Cheers
>
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20091119/a23339d9/attachment.htm>


More information about the kde-core-devel mailing list