Skip to content

Commit

Permalink
Revert "Let styles indicate that they support dark mode"
Browse files Browse the repository at this point in the history
This reverts commit 3ee7a9f.

Styles that don't support dark mode can overwrite the palette in
a QStyle::polish(QPalette &) override instead.

Change-Id: I8b84d822d91be5b3f67f76f791a1330bba7ea546
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
  • Loading branch information
vohi committed Dec 8, 2022
1 parent 501018e commit c62c2aa
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/plugins/styles/mac/qmacstyle_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2892,9 +2892,6 @@ AHIG would have (20, 8, 10) here but that makes
case SH_TabBar_AllowWheelScrolling:
ret = false;
break;
case SH_SupportsDarkAppearance:
ret = true;
break;
default:
ret = QCommonStyle::styleHint(sh, opt, w, hret);
break;
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2316,10 +2316,6 @@ int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, co
ret = 1;
break;

case SH_SupportsDarkAppearance:
ret = 0;
break;

default:
ret = QWindowsStyle::styleHint(hint, option, widget, returnData);
break;
Expand Down
1 change: 0 additions & 1 deletion src/widgets/styles/qcommonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5407,7 +5407,6 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
case SH_ItemView_PaintAlternatingRowColorsForEmptyArea:
case SH_ComboBox_UseNativePopup:
case SH_Table_AlwaysDrawLeftTopGridLines:
case SH_SupportsDarkAppearance:
ret = false;
break;
case SH_MenuBar_AltKeyNavigation:
Expand Down
1 change: 0 additions & 1 deletion src/widgets/styles/qfusionstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3630,7 +3630,6 @@ int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QW
case SH_MenuBar_MouseTracking:
case SH_Menu_MouseTracking:
case SH_Menu_SupportsSections:
case SH_SupportsDarkAppearance:
return 1;

#if defined(QT_PLATFORM_UIKIT)
Expand Down
7 changes: 0 additions & 7 deletions src/widgets/styles/qstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,13 +1987,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
not when the header is hidden. Defaults to false.
This enum value has been introduced in Qt 6.3.
\value SH_SupportsDarkAppearance
Determines whether the style is able to render a UI correctly with
a dark palette. Defaults to false. Style implementors should return true
if they have tested the style with a palette where the background colors
are darker than the foreground colors.
This enum value has been introduced in Qt 6.5.
\sa styleHint()
*/

Expand Down
1 change: 0 additions & 1 deletion src/widgets/styles/qstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,6 @@ class Q_WIDGETS_EXPORT QStyle : public QObject
SH_TabBar_AllowWheelScrolling,
SH_Table_AlwaysDrawLeftTopGridLines,
SH_SpinBox_SelectOnStep,
SH_SupportsDarkAppearance,
// Add new style hint values here

SH_CustomBase = 0xf0000000
Expand Down

0 comments on commit c62c2aa

Please sign in to comment.