Review Request 127494: Fix drawing correct focus state of QtQuickControls Button

Hugo Pereira Da Costa hugo.pereira at free.fr
Sat Mar 26 10:45:14 UTC 2016



> On March 26, 2016, 10:14 a.m., Hugo Pereira Da Costa wrote:
> > kstyle/breezestyle.cpp, line 3388
> > <https://git.reviewboard.kde.org/r/127494/diff/1/?file=454100#file454100line3388>
> >
> >     mmm. But is it not rather a qtc bug that states are set in an inconsistent manner between widgets and qtc ? 
> >     This is not the only place in breeze where we have to work around these kind of issues (the other being min iconsize in menus to cite one)
> >     This just tend to make the breeze code bloated and hard to maintain. Besides it doesn't fix the "other" styles (there is oxygen, but there are others). 
> >     What are the chances to get these fixed upstream (eg: sunken !? checked) ?
> 
> Hugo Pereira Da Costa wrote:
>     meant "sunken neq checked"
> 
> David Rosca wrote:
>     Well, QtQuickControls is probably to blame, but it works fine with other styles. What I think is incorrect (even for QtWidgets) is to assume focus on button with State_Sunken.
>     From doc:
>     
>         QStyle::State_Sunken	0x00000004	Used to indicate if the widget is sunken or pressed.
>         
>     so the widget can be sunken, but not pressed.
>     
>     The State_Sunken flag for the hasFocus check was added in https://git.reviewboard.kde.org/r/120222/ to fix ToolButtons, but this function is not used for drawing ToolButtons. So maybe we can just use only `state & State_HasFocus` here for both quickcontrols and widgets?
> 
> Hugo Pereira Da Costa wrote:
>     worth at try yes. i can double check for the widget parts.
>     Funny that the *other* commit also refers to qtc
> 
> David Rosca wrote:
>     Yeah, I guess it was "fixed" in the meantime. I was testing with oxygen-demo5 and seems to work as before. 
>     There is still issue with PushButtons where some are not drawn as checked/focused when showing menu (Buttons tab -> pushbuttons -> both in third column).

Oh but third column in the button tabs are actually comboboxes (read-only).
Buttons with menu are the second tab and here it seems (without the patch at least) that button's focus is rendered properly.
In fact even for combobox it is "almost fine" I'd say. Once the menu is closed (because one item has been selected), the combobox does have the focus.


- Hugo


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127494/#review94012
-----------------------------------------------------------


On March 26, 2016, 10:41 a.m., David Rosca wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127494/
> -----------------------------------------------------------
> 
> (Updated March 26, 2016, 10:41 a.m.)
> 
> 
> Review request for Plasma and Hugo Pereira Da Costa.
> 
> 
> Repository: breeze
> 
> 
> Description
> -------
> 
> Button with checked == true would be incorrectly drawn as always having focus.
> Checked QtQuickControls Button always have State_Sunken.
> 
> 
> Diffs
> -----
> 
>   kstyle/breezestyle.cpp e97ead6 
> 
> Diff: https://git.reviewboard.kde.org/r/127494/diff/
> 
> 
> Testing
> -------
> 
> Fixed for QQC, no change in QtWidgets.
> 
> 
> Thanks,
> 
> David Rosca
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160326/42895101/attachment.html>


More information about the Plasma-devel mailing list