File: fusion_checkable_qpushbutton.diff

package info (click to toggle)
qtbase-opensource-src 5.15.17%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 351,148 kB
  • sloc: cpp: 2,097,620; ansic: 343,242; xml: 115,491; python: 9,447; java: 7,499; asm: 4,023; sh: 2,090; perl: 2,047; yacc: 1,687; lex: 1,333; javascript: 878; makefile: 271; objc: 70
file content (27 lines) | stat: -rw-r--r-- 1,234 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: QPushButton/fusion style: don't ignore QIcon::On icon
 The fusion style did ignore the QIcon::On icon because it reset
 State_On to avoid the visual shift of a pressed button.
 But it's not needed to reset this flag - the shift does not happen
 because the fusion style does return 0 as offset for
 PM_ButtonShiftHorizontal/PM_ButtonShiftVertical so no shifting will
 happen.
Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=e9ccdf4d84157173
Last-Update: 2021-08-10

--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -1772,14 +1772,6 @@ void QFusionStyle::drawControl(ControlEl
             proxy()->drawControl(CE_PushButtonLabel, &subopt, painter, widget);
         }
         break;
-    case CE_PushButtonLabel:
-        if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
-            QStyleOptionButton b(*button);
-            // no PM_ButtonShiftHorizontal and PM_ButtonShiftVertical for fusion style
-            b.state &= ~(State_On | State_Sunken);
-            QCommonStyle::drawControl(element, &b, painter, widget);
-        }
-        break;
     case CE_MenuBarEmptyArea:
         painter->save();
     {