Bug 367723

Summary: Visual glitch in QQC1 ToolButton+Menu
Product: [Plasma] Breeze Reporter: Aleix Pol <aleixpol>
Component: QStyleAssignee: Hugo Pereira Da Costa <hugo.pereira.da.costa>
Status: RESOLVED FIXED    
Severity: normal CC: hugo.pereira.da.costa, kontakt
Priority: NOR    
Version First Reported In: 5.6.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Aleix Pol 2016-08-23 14:52:58 UTC
Instead of showing the little arrow down to indicate there's a menu, it shows an ugly thing on the top left corner.

It can also be reproduced in Oxygen but not on Fusion or Windows styles.

See bug #366412 for more information.

Here's a test case:
import QtQuick.Controls 1.1

ApplicationWindow
{
    width: 500
    height: 500
    toolBar: ToolBar {
        ToolButton {
            iconName: "list-add"
            menu: Menu {
                MenuItem {text: "hello"}
            }
        }
    }
}

Reproducible: Always
Comment 1 Aleix Pol 2016-08-23 14:53:20 UTC
*** Bug 366412 has been marked as a duplicate of this bug. ***
Comment 2 Hugo Pereira Da Costa 2016-08-24 07:57:28 UTC
Hi
Thanks for reporting.
I can reproduce the problem with oxygen and breeze.
However, I can also see it bugged with fusion and windows
See: http://wstaw.org/m/2016/08/24/plasma-desktopDF2120.png
The arrow in the center (overlayed with the icon) should definitly not be there.
Same is true for windows style. Can you reproduce ? 
I am using Qt-5.7.0

(on window its even worse: the icon dissapear on mouse-over, and only the arrow remains).
In fact the artifact seen with breeze/oxygen, is the style trying to render this arrow too, but with invalid rectangle passed.
So I would say this is upstream.
I can patch breeze and oxygen in order not to render this arrow at all (since it is bugged), but that would be just a workaround.
Opinion ?
Comment 3 Hugo Pereira Da Costa 2016-08-24 08:14:02 UTC
well. Forget about upstream. At least in breeze and oxygen I found an inconsistency about how detection of toolbutton arrow is detecting, resulting in the invalid rect passed to rendering the button arrow. This fixed, arrow dissappears (as it should), and bug is resolved.
I'll push.
Comment 4 Hugo Pereira Da Costa 2016-08-24 08:17:31 UTC
Git commit 325c8f610659fa48a38783f31260f970be7600f3 by Hugo Pereira Da Costa.
Committed on 24/08/2016 at 08:14.
Pushed by hpereiradacosta into branch 'Plasma/5.7'.

Homogenize how toolbutton arrow is detected between
- drawToolButtonComplexControl
- toolButtonSizeFromContents
- and toolButtonSubControlRect

M  +2    -2    kstyle/breezestyle.cpp

http://commits.kde.org/breeze/325c8f610659fa48a38783f31260f970be7600f3