Commit Graph

104 Commits (2928376e05d6acc355b2a175fc7fd964d7f4f1b7)

Author SHA1 Message Date
Christian Ehrlicher 2928376e05 Windows11Style: don't modify palette for buttons in polish()
There is no need to screw up the palette of buttons in polish() - the
colors are not honored at all.

Task-number: QTBUG-132433
Change-Id: I4df1f046690d1aa9b07fc538441d6ea50d0216ce
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 6a46395614bf89a8b69fd2b7edb9503bd8f16ceb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0d36941a78483d715849cb9bbe1b57ad31dd3eee)
2025-02-18 19:01:34 +00:00
Wladimir Leuschner 45cef5b85b QWindows11Style: Add left margins to Radio/Checkbox indicator
On 150% DPI scaling, the Radio/Checkbox indicators were clipped. This
patch adds an extra margin to the left to avoid this clipping.

Fixes: QTBUG-133117
Change-Id: I2e0186cbdad12481922de5ddf00f50daeb94bb37
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3d45d22b536cd5fa074f6de4d02b1fd049e6b220)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9f7437fb858cc69fcd50b32809e9bd83355d0947)
2025-02-10 11:15:47 +00:00
Wladimir Leuschner dae6848dbc QWindows11Style: Default PE_IndicatorRadioButton to selected/unselected
In case there is no valid QStyleOption::styleObject, default the
PE_IndicatorRadioButton to the selected and unselected appearances.

Fixes: QTBUG-132906
Change-Id: I5e9c13cb3384321e025e5af08ee3dab81feb07fe
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit b717945812b16f957421bc2a2b1c4220f8148e64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit acbfeca2b3d2cfa9467e3f88b2c1d0526e5f1ba2)
2025-01-25 15:26:47 +00:00
Wladimir Leuschner b9206f1843 QWindows11Style: Reduce groove size of QSlider
Reduce the groove size of QSlider when using Windows11Style, so that the
minimum selectable value does appear so.

Fixes: QTBUG-133128
Change-Id: I3e5a5378e2eace3920c06db8cb1198122c0937b5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit dee731ae981eb4f41f4b00be80f75c7a0a5c0e11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6a6a1c0fe2f39f560bae4bb71eb48d9dae993231)
2025-01-25 14:21:34 +00:00
Christian Ehrlicher f86da3d3f8 Windows11Style: don't set minimum width for QAbstractSpinBox
There is no need to set a minimum width for QAbstractSpinBox in
QWindows11Style::polish() as this might override the user preferences.
Also the minimum size handling is now properly done within
sizeFromContents().

Change-Id: Ibc1fd7a6f862fc85e3739025b9de581aa235d74c
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 2ec4c28470de115c16944653a5d4f6209452d56c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b93a8dfdfe6900cb542fdc587dd2682007a6ac53)
2025-01-22 23:04:13 +00:00
Wladimir Leuschner 3949933dde QWindows11Style: Make disabled menu item non-selectable
QWindows11Style inherits the stylehint policy for
SH_Menu_AllowActiveAndDisabled from QWindowsVistaStyle, although the
inactive selection is not visible. This patch makes disabled menu items
non-selectable.

Change-Id: Ib59988cfad444f9f8203628d4b3e1f72d6775b46
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3f42d2baacf3d227a001e49d74ea97f7ab551ae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a2b68996b28176388b1f41d2cf88617c79fa3f8a)
2025-01-16 13:55:11 +00:00
Christian Ehrlicher 94fe6f04f1 Windows11Style: Misc cleanup for drawControl(CE_ItemViewItem)
Cleanup CE_ItemViewItem branch in drawControl():
 - use local rect instead rect, vopt->rect or option->rect for
   consistency
 - move out viewItemPosition comparisons into local booleans
 - fix coding style
 - merge two QPainter::drawLine() calls into one

Task-number: QTBUG-131585
Change-Id: I7cd2f96a2a733a55d5e7fb5956c59bd043317cb2
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 44edab7c84be101025dc6f9a74f87944ea3a22e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 37effa5dd3b7345ceff38f55ce5b563d2748962c)
2025-01-15 00:10:00 +00:00
Christian Ehrlicher a349c0fd2b Windows11 style: fix drawing horizontal progressbar in rtl mode
The progressbar content calculation assumes that
subElementRect(SE_ProgressBarContents) returns a rect at 0/0 which is
not the case for progressbars in rtl mode. Fix it by moving the topLeft
edge to 0/0 and translating the painter accordingly

Task-number: QTBUG-132459
Change-Id: I614589c9094b0da3c02867b45570d4dfdca61a18
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 314a5b972646a4f2ef9c1f49ddfd335f546336ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bf535c4c66b8d39e7c9a067155bdf2f6ea26a924)
2025-01-15 00:09:59 +00:00
Christian Ehrlicher 70c663a925 Windows11Style: enable mouse tracking for QTableView
Mouse tracking is needed for windows 11 style since it is using
QStyle::State_MouseOver to draw the cells.

Fixes: QTBUG-129242
Change-Id: Ib79ac5a8c14ac8c70365e87120f80b4e4ee4c5b9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85333b3d8cb89bf58c6c6c0db7c3db5c95b4cbfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5ff8c2eb00aedc3fec76fe63e4914a6b4e5f32bd)
2025-01-15 00:09:59 +00:00
Christian Ehrlicher 712192b9cd Windows11Style: adjust size of flat buttons
Flat buttons were larger than normal buttons - therefore also add
marginsRemove(QMargins(2,2,2,2) for the flat case too.

Task-number: QTBUG-132433
Change-Id: Id010d45bf85c5d7d09ff8db8bda44b1be7d85297
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a930fb758d71ef6bf353e8fd8078de2335c32085)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b7e0a7bfdebfcce46084164c971ad6ab9363184f)
2025-01-14 03:15:03 +00:00
Wladimir Leuschner fb3e74615d QWindows11Style: Align QSpinBox rect to match QLineEdits rect
The content rects for QSpinBoxes were smaller than QLineEdits rects for
UI elements that should have the same size. This patch increases the
content rect for QSpinBoxes.

Task-number: QTBUG-132261
Change-Id: I59e752b719399c5845ab3ef81c6e271deda16273
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a53e095882551caf3684a1f6a205b6c7d76a8913)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4c2f439001f49c9aa380d16f0e1fa7e574e03fe8)
2025-01-13 13:30:31 +00:00
Wladimir Leuschner 5e4b33f39d QWindows11Style: Decrease bottomline frame thickness for QToolButton
Decrease the bottom line frame thickness for QToolButton by using
fractional coordinates.

Task-number: QTBUG-132261
Change-Id: I77a3acdd20c694dce38d809db9c3051949a98fa3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3e9baca7d2197bfc10d20de6f326e2749a8f781e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f8adee805b9cb673ed66ffa22f5bb1896439e6b3)
2025-01-13 08:34:55 +00:00
Wladimir Leuschner 4b763eab23 QWindows11Style: Increase QComboBoxSize and align subline
Increase the size of QComboBoxSize and align the subline for editable
QComboBoxes with the begin end end of the rounded corners.

Task-number: QTBUG-132261
Change-Id: I235ec1ceb94a5e87f373b007ac31d0d8a83cf600
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 23c16c611cfeee55ce38e928989b346c697270b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 840cf0a43a3242c7e5fd6769efe37c5d6e3b400e)
2025-01-13 08:34:49 +00:00
Wladimir Leuschner b7a63351a4 QWindows11Style: Adjust Subline for QLineEdit to fit rounded corners
Reduce the size of the subline for QLineEdit to fit the begin and end of
the rounded frame corner.

Task-number: QTBUG-132261
Change-Id: I879f30c2bdc6601fef4738aeec71d7ab7bcee22c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 5e656b9ea3c192f389b7e4f7aa2ae6b010cec306)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4eaaf89db5bf25d30ea2b336a6cd0f4287849d53)
2024-12-25 10:22:13 +00:00
Christian Ehrlicher 7ce5b4f486 QWindows11Style: Adjust position of MDI subwindow icon
The y position for the MDI subwindow icon was not calculated correctly
so the icon was not painted vertically centered.

Task-number: QTBUG-130673
Change-Id: I5f9023820a4e4b4288017869ac4088fe2669ce50
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6e29a94b547fbafa69e97ac02aeb33edad63f2ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1319dcf472b97652883f01bdb411e7719d1cc2e4)
2024-12-20 22:03:03 +00:00
Christian Ehrlicher e38834a020 QWindows11Style: adjust text rect for CC_TitleBar
The adjustment for the textrect was wrong - the bottomRight point must
be moved by -1/-1, not 1/1.

Task-number: QTBUG-130673
Change-Id: I6c099fdd9a03188e7a5c7852b1912ed9b2801f7a
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2c85e5d22215f24bd46d07a1183393e52702493f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ecc31955f1ded212c334c87195bd1dca040d2565)
2024-12-20 22:02:56 +00:00
Christian Ehrlicher 4f60aa4b7c Windows11Style: adjust subline color in editable widgets in dark mode
The color of the subline in editable widgets was black in light and dark
mode. Fix it to use white in dark mode to make it visible. Move it out
into own helper function since it's used in at least three places.

Task-nubmer: QTBUG-131585
Fixes: QTBUG-131586
Change-Id: Icca2b142a1ce0c3d7f722baa6d3635bae5950e1c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 66d42b62b6f01205cf1db72e56ecb5166554e373)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit eab71ff6b0d4bee0b872e5ba38a52f9406df40e2)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-12-20 15:34:32 +00:00
Christian Ehrlicher c876e78719 Windows11Style: Fix horizontal scrollbar arrows in rtl mode
The arrows for horizontal scrollbars must be swapped in rtl mode.

Change-Id: I517fcea19837a6438edc261e066930218b71ce28
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 02920ef05a980d9bb670e1f8a4b84e0b6cef13c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 72f48d084095f0fa103bfa6ea70c1b74e4a165be)
2024-12-20 10:40:03 +00:00
Yuhang Zhao 236360b9df Minor improvements of windows style
1. Make some global constants constexpr.
2. Make some file-scope global constants static.
3. Use QStringLiteral instead of plain const char*
4. Add "u" to QStringLiteral's content.

Change-Id: Icbc105366ba40e970b256fe3da41231a6fb5064b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ad06099b93d79a954d133d6822517d4d0a10adbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7c3723b2a93d7b0263109c0872a61307cd13a7ed)
2024-12-13 13:21:30 +08:00
Wladimir Leuschner 92e454c000 QWindows11Style: Override alternate base color in darkmode
The alternate base color in darkmode was wrongly set to the accent color
instead of a lighter color. This patch overrides the alternate base
color for the QWindows11Style.

Fixes: QTBUG-131976
Change-Id: Ie8f50b0042ca7bf746224275abc0cd255df7a4ad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 79aa4269bcbbedef8206d79318c199df7c8a3c9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1a737083f1db32da9f5af45256a3e26b6029d2e3)
2024-12-10 11:35:05 +00:00
Christian Ehrlicher 53a5df8cf0 Windows11Style: fix painting checked QToolButton
A checked QToolButton should be drawn similar to a checked QPushButton.
As a drive-by avoid calculating the paint rect twice and make the code a
little bit more readable.

Fixes: QTBUG-129439
Fixes: QTBUG-129700
Fixes: QTBUG-130822
Change-Id: I573132e804f26b9fa41112267a9f685680cf0864
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b3c0b08eb040bbd76b81a7c6172e3846e8ec0000)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-29 15:36:09 +00:00
Christian Ehrlicher 49cb3203a9 QWindows11Style: simplify CC_TitleBar painting
Move common tasks into a lambda to improve readabilty and avoid
copy'n'paste errors like it happened for SC_TitleBarContextHelpButton.

Task-number: QTBUG-130673
Change-Id: I5cb198b976d459b73e339d066def92d70b71ade5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9a97e78d8310c13212aacd578f5529b5521e395a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-28 14:03:12 +00:00
Wladimir Leuschner bb4ec722d4 QWindows11Style: Draw inactive MDI window texts lighter
Fixes: QTBUG-130673
Change-Id: I431ac917ac159d54c35b6a8da270f3bac8117019
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ea88b0e244ab077288bf6915118bf6b6745182c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-23 17:11:58 +00:00
Christian Ehrlicher ca65f94003 Windows11Style: add styling for PE_IndicatorBranch
Add PE_IndicatorBranch so the correct arrows are used instead the
windows 10/vista ones.

Change-Id: I5328a91b883078b4564890729f73dbfc573cbf00
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 02bf12072feee46f3b5f966a88f5094c55553b48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 23:07:13 +00:00
Christian Ehrlicher ab1f7d56ab Windows11Style: sync PE_IndicatorHeaderArrow with PE_IndicatorBranch
Make the sort indicator arrow drawn in PE_IndicatorHeaderArrow a little
bit smaller (the same size as for PE_IndicatorBranch.

Change-Id: I34035a845b1a0f5ebdb1257d802360ce3df7e703
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 8945f7d6eb6c370ab5992d6250194f7b2c9df969)
2024-11-12 17:23:37 +01:00
Owais Akhtar d9a3b03b47 Disable QGraphicsEffect when QComboBox added inside QGraphicsProxyWidget
The QComboBox dropdown doesnt render when its added to a
QGraphicsProxyWidget and any QGraphicsEffect is added to it.

Fixes: QTBUG-128916
Fixes: QTBUG-128329
Change-Id: I7f9b7ceea9afa819fcd4785250859ea7b7c85f69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5fc968ade3120fe7f9d0d01988254fd1fb855262)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 18:52:21 +00:00
Wladimir Leuschner d8ed810029 QWindows11Style: Draw QRadioButton with QPainterPath
The drawing of QRadioButton in QWindows11Style was performed with
overdrawing, leading to problems with the transparent background color
for QGraphicsWidgets. This patch draws the ring of the RadioButton using
QPainterPath, to avoid overdrawing.

Fixes: QTBUG-130828
Change-Id: I4b278f7f720b55e11c550977b666410d85b65382
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 57361de3a9814808bb575f8d01c1b12cbed9dbe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 11:36:03 +00:00
Wladimir Leuschner 61c67cf499 QWindows11Style: Fix sorting arrows in headers
Fixes: QTBUG-126345
Change-Id: Ifb0bb46329a909fd113318f61ca37ba01f4d873d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 81642477d979e00f9507df37184e75d9ed98ee2f)
2024-11-06 15:46:44 +00:00
Christian Ehrlicher b63615ca6c Windows11Style: fix sizehint for QComboBox
The size hint for QComboBox relied on the vista style but the painting
was completely different. Therefore swith to the base windows style and
add the extra margins used in the windows11 style.

Fixes: QTBUG-130824
Task-number: QTBUG-11967
Change-Id: Ic533140793cdd4e640c49f6d73e9bb73bcbb83da
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b6ca35f65372cc8519a418d6a5291cafd809f7c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-04 22:30:19 +00:00
Wladimir Leuschner 6e6d42a3b3 QWindows11Style: Respect background color for flat QPushButtons
Fixes: QTBUG-128781
Pick-to: 6.7
Change-Id: I634d42566ea6249b125da537ac7e60fbd8475635
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 0b1275f630b5d03f314bc02879301df95b3f1940)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 19:34:31 +00:00
Wladimir Leuschner f1bab31ff5 QWindows11Style: Don't set FramelessWindowHint for QScrollbar
QScrollbar is a widget and not a window, therefore there is no need to
set the FramelessWindowHint

Fixes: QTBUG-128518
Pick-to: 6.7
Change-Id: I687c708cd4f59c6f09d0ad3c2d3ddcf62c33b11a
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 7b146e530adc913a1ed49b4d2ba17de787089261)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 19:34:29 +00:00
Wladimir Leuschner d3f26e2bbd QWindows11Style: Reduce menubar height in QTabWidget
Due to increased menubar height, an attached menubar to QTabWidgets was
shown as >> indicator. This patch reduces the size of the menubar, in
case it is attached to a QTabWidget.

Fixes: QTBUG-130399
Change-Id: I0e71156cacd6acc51ede353b3b4ddf09d9c0260f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 9a06060e9ba0711ed458c19c274b7903f3d89d65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-29 01:10:26 +00:00
Wladimir Leuschner 9107817eac QWindows11Style: Calculate Spinbox size based on CommonStyle size
Use the calculation from Commonstyle and add the increased padding and
horizontally layouted buttons to the horizontal size hint.

Fixes: QTBUG-130288
Change-Id: I7932b782e7873a0178091a51379f17453eb585fd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 96d46cad43517adefa2eb7cb8819a0b2cc9241e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 13:19:29 +00:00
Wladimir Leuschner e00084e163 QWindows11Style: Adjust ArrowRect offset for RTL QComboBox
Adjust the arrow rect, so that the arrow is not outside of the combobox
frame in RTL mode.

Change-Id: Ieddda7be4959a37a4c47ab9fe8e4d6bae4e91f04
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d5afa192a32ac7187621f37b5f8baaf2388730dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 13:19:06 +00:00
Wladimir Leuschner 197c3e61fe QWindows11Style: Reduce textedit padding and align combobox texts
Horizontal padding for textedit controls is reduced from 8px to 4px.
To align the QComboBox label with the list flyout, the combobox label
got additional 4px padding.

Fixes: QTBUG-130125
Change-Id: Ieb4a8c9dab7fbe594134261b738060acfe7fdcb5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit c8fa7408a0c15054a6a50c28c0c21845134a4a13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 12:39:51 +00:00
Wladimir Leuschner fae0899efe QWindows11Style: Grey out disabled Widgets in light theme
Disabled widgets were drawn in the same colors as active widgets, making
them hard to distinguish.

Fixes: QTBUG-130123
Change-Id: I723a1d5d3a90d56cc3e82148939ae3eaacd01ed4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 9523b97eb9146e308b25ef19394c48ec636a73ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 12:39:44 +00:00
Wladimir Leuschner 0cb772c6c3 QWindows11Style: Add menu indicator to QPushButton
In case a menu was associated with a QPushButton, draw a triangle
indicator that shows, that a menu will open up.

Fixes: QTBUG-130122
Change-Id: I798499c1484ed66662fa3ce7f3d1aeccd3f40ad7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 1347ca99a30364ca9973448111a9bf40173fd81e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 12:39:38 +00:00
Wladimir Leuschner 71cba1359e QWindows11Style: Add checkbox offset to ItemViewItemText
Add the width of a checkbox to the starting starting x position of the
ItemViewItemText in case the ItemViewItem has a checkbox.

Fixes: PYSIDE-2897
Fixes: PYSIDE-2906
Change-Id: I233e2bfd28836ae5578aadfe9332193848ac5a7f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 877b29a78e38ff7c6af2d63d93e6a554544bf278)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-24 22:18:46 +00:00
Alexey Edelev 6c1f4c6c56 Guard the QDateTimeEdit usage with the respective feature check
QDateTimeEdit and the respective header are available only when the
'datetimeedit' feature is enabled.

Amends bfe8ac4ebff7a1e8114068f2f46e73c588735690

Fixes: QTBUG-129481
Pick-to: 6.7
Change-Id: Ia9595bb17b47fd7221742665f1242a5f85ed6c0d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 00bcf5a867d0414cd894e46d085feef94aa317b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:53 +00:00
Christian Ehrlicher 993fa70777 Windows11Style: add two helper functions to avoid code duplication
Add and use the two helper functions
 - buttonFillBrush() returning the correct fill brush for a button
 - buttonLabelPen() returning the correct pen for a button

Change-Id: I6ee0dbe2490ad5c875b75d13b48371b5e798c290
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 436abff5cce198bb90c90e92104922373a3f99cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:13 +00:00
Christian Ehrlicher 47ae9e4c2c Windows11Style: Fix MenuItem drawing
The drawing for CE_MenuItem had some issues:
 - it did not work in rtl mode
 - it removed 10px on the right to hide issues with e.g.
   sizeFromContents()
 - the checkmark was not properly centered because the wrong rect was
   used

Fixes: QTBUG-129716
Change-Id: Ibe2e5e66367ac0a803788b74175776d95f489c80
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 30d90b4ccad83ab1f23dab7cd72b7e228c299895)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 22:15:05 +00:00
Christian Ehrlicher a0f5289db1 Windows11Style: Cleanup drawing menu items
Cleanup of PE_PanelMenu/CE_MenuBarItem/CE_MenuItem:
 - don't calc rect if not needed
 - remove unused code
 - don't set pen which is not used afterwards

Change-Id: I5585a7299317d176d94480905aff0567e8f16444
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 804ec477e5532309e61d616e0ea13412ad410948)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 22:14:59 +00:00
Christian Ehrlicher 395647a7b7 Windows11Style: correctly draw submenu indicator in rtl mode
In rtl mode the submenu indicator arrow must point to the left.

Change-Id: If483252e3447c1657291a17e47c2f69de5d61839
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 9f7f7e3708c64ab4c693317b0ee117e272f0f442)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 22:14:52 +00:00
Christian Ehrlicher f3bcce4d2d Windows11Style: don't use deprecated glyphs
The glyphs for Segoe Fluent/MDL2 in the range 0xE000 - 0xE5FF are marked
as legacy and deprecated. Therefore replace them with the recent glyphs.
 - 0xE001 -> 0xE73E (CheckMark)
 - 0xE010 -> 0xE96D (ChevronUpSmall)
 - 0xE011 -> 0xE96E (ChevronDownSmall)
 - 0xE013 -> 0xE974 (ChevronRightMed)
 - 0xE018 -> 0xE70E (ChevronUp)
 - 0xE019 -> 0xE70D (ChevronDown)
 - 0xE108 -> 0xE73C (CheckboxIndeterminate)

Change-Id: I1251230fcd49c2a77a569ed97b9108597554c7ca
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b44ecf0237e0cca2beb7c5e6600afd252f7e51c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 12:21:58 +00:00
Christian Ehrlicher 8058a77340 Windows11Style: cleanup CC_ScrollBar
Cleanup CC_Scrollbar:
 - call subControlRect() only when it's really needed
 - use QStringLiteral to create static strings
 - calc rects only when really needed and then directly in one step

Change-Id: Ibe7944feb813ef3e7f6aea976579d192bafbcce9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ffa0e9c19c3cdf3b299357dd263e7413010a62a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 17:15:43 +00:00
Christian Ehrlicher 55a8806e22 Windows11Style: cleanup CC_SpinBox
Cleanup CC_SpinBox a little bit
 - avoid unneeded QPainter::translate()
 - avoid uneeded QPainter::save/restore()
 - don't modify frameRect when not needed
 - merge up and down drawing to avoid code duplication
 - use QStringLiteral to create a static string

Change-Id: Id8bc8d5085b6681b48ea3388941d21a11c0345ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5cd4434389870d43baa1325ba97c5776baff65f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 17:15:37 +00:00
Wladimir Leuschner 63a4def507 QWindows11Style: Draw ItemView text, in case of custom Widget
Fixes: QTBUG-128517
Pick-to: 6.7
Change-Id: Ia48935eb8bc0acd77178a76502a4e84eb9822a76
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit ceebef9af9f99ad1c497f56d5a4d376ce03006e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-23 13:57:04 +00:00
Wladimir Leuschner b51078e927 QWindows11Style: Fix disabled QPallete::windowText color in light theme
Fixes: QTBUG-128499
Pick-to: 6.7
Change-Id: Ib44998f8c55485df71d1fca0724c533f81405ff4
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ff1273b360a38418de22829ac815f6ffddd53ddf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-19 15:09:46 +00:00
Wladimir Leuschner d6f33a70c8 QWindows11Style:Increase QDateTimeEdit width for layouted QDateTimeEdits
Fixes: QTBUG-124235
Pick-to: 6.7
Change-Id: I252dd59a716e4897baf96988307a335671bb141b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5a1ea842c9259f4b0cddd5b2166d9736516af257)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:00:44 +00:00
Wladimir Leuschner b3a25e845a QWindows11Style: Increase QSpinBox width for layouted QSpinboxes
QSpinboxes used the sizeFromContents from QWindowsVistaStyle, which
produced a too small contentRect for the newly horizontal layouted
buttons on QSpinBox. This patch sets a minimum width for the content
rect, when QWindows11Style is used.

Fixes: QTBUG-124118
Pick-to: 6.7
Change-Id: Ibf58c8da360242587e55f8096fa3157459041ba6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bfe8ac4ebff7a1e8114068f2f46e73c588735690)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00