Merge lp:~agateau/unity-2d/no-frame-around-disabled-menubar-items into lp:unity-2d/3.0

Proposed by Aurélien Gâteau
Status: Merged
Approved by: Florian Boucault
Approved revision: 485
Merged at revision: 493
Proposed branch: lp:~agateau/unity-2d/no-frame-around-disabled-menubar-items
Merge into: lp:unity-2d/3.0
Diff against target: 20 lines (+8/-2)
1 file modified
panel/app/unity2dstyle.cpp (+8/-2)
To merge this branch: bzr merge lp:~agateau/unity-2d/no-frame-around-disabled-menubar-items
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+55138@code.launchpad.net

Commit message

[panel] Do not draw a sunken border behind disabled menubar items

Description of the change

Do not draw a sunken border behind disabled menubar items

Apps such as Deluge should be fixed: it is against the GNOME HIG to have disabled items in a menubar. Nevertheless, let's not look ugly because of broken apps.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'panel/app/unity2dstyle.cpp'
--- panel/app/unity2dstyle.cpp 2011-02-02 16:57:00 +0000
+++ panel/app/unity2dstyle.cpp 2011-03-28 12:33:33 +0000
@@ -43,8 +43,14 @@
43void Unity2dStyle::drawControl(QStyle::ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const43void Unity2dStyle::drawControl(QStyle::ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const
44{44{
45 if (element == QStyle::CE_MenuBarItem && widget) {45 if (element == QStyle::CE_MenuBarItem && widget) {
46 // Avoid solid gray background behind the menubar items46 QStyleOptionMenuItem opt = *qstyleoption_cast<const QStyleOptionMenuItem*>(option);
47 QProxyStyle::drawControl(element, option, painter, 0);47 if (!(opt.state & QStyle::State_Enabled) && (opt.state & QStyle::State_Sunken)) {
48 // Reset State_Sunken flag to avoid drawing a frame on a disabled menu item
49 // See https://bugs.launchpad.net/unity-2d/+bug/717744
50 opt.state ^= QStyle::State_Sunken;
51 }
52 // Skip "widget" parameter to avoid solid gray background behind the menubar items
53 QProxyStyle::drawControl(element, &opt, painter, 0);
48 } else if (element == QStyle::CE_MenuBarEmptyArea) {54 } else if (element == QStyle::CE_MenuBarEmptyArea) {
49 // Avoid gray borders around the menubar items55 // Avoid gray borders around the menubar items
50 } else {56 } else {

Subscribers

People subscribed via source and target branches