Commit Graph

73 Commits (d3f26e2bbdb7941ad4422dbe31bca1160bbe4adf)

Author SHA1 Message Date
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
Wladimir Leuschner ac74885507 QWindows11Style: Use float coordinates for ticks in QSlider
Fixes: QTBUG-127788
Pick-to: 6.7
Change-Id: If7620aade30c45c409cb442a7ed6e4a8aea7551e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 47ba48e0245e6f57ae0c76db626eb63ce6924cfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:01:20 +00:00
Wladimir Leuschner 11473410c2 QWindows11Style: Make MdiControls darkmode aware
Pick-to: 6.7
Change-Id: I525602c9757a8fed3d5ab6d64fe856adaa75b83d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 982314aace15109857784b0b6c3b49cc6e13b9b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:54 +00:00
Marius Kittler a75b432c8a Fix QCommandLinkButton in Windows 11 style when darkmode is used
Fix polishing QCommandLinkButton in Windows 11 style: The condition
for QCommandLinkButton needs to be checked before the condition for
QAbstractButton; otherwise it is never entered and the colors from
the Vista style are used breaking darkmode.

Pick-to: 6.7
Change-Id: Ie9e1c20b38a52b2d72f28279e38deb533595b974
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a17c34d2b7ef8391e5485d0ba06966ece793d184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 21:57:52 +00:00
Wladimir Leuschner 4b4c5b06a0 QWindows11Style: Use QProgressStyleAnimation for QProgressBar
Currently for an indeterminate QProgressBar in QWindows11Style, a busy
drawing is triggered, consuming more CPU resources than necessary. This
patch avoids the busy drawing by using QProgressStyleAnimation, which
only triggers a redraw for specified Fps.

Fixes: QTBUG-127112
Pick-to: 6.7
Change-Id: I46da8ffcb849563c771dbc72af4c7e8b306b4802
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 384acdc1cf2cc6472c9eb9d2d79077736ded0e92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 10:11:40 +00:00
Wladimir Leuschner d1e523c8b6 QWindows11Style: Make ItemViews respect alternating row colors
Fixes: QTBUG-124564
Pick-to: 6.7
Change-Id: I2665ecb253d0413d57e67d598593e8064b1ab84e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5d73d64f3eaab51518a4385e2a0a3cec8be91769)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:33:05 +00:00
Wladimir Leuschner b64031a6d1 QWindows11Style: Remove frame from ToolButton in QToolBar
Remove the frame of ToolButtons in QToolBar area when not hovered or
selected

Pick-to: 6.7
Change-Id: I11bd7b513871d6d1e0d9bfba761acf061f50e524
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85c4084331a1049d3e2377f5516cd0d93819ac04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 13:38:18 +00:00
Wladimir Leuschner 2a10643d44 QWindows11Style: Change appearance when Button is disabled/hovered
Fixes: QTBUG-126503
Fixes: QTBUG-125781
Pick-to: 6.7
Change-Id: Ib3e1ff2cab2c82c04445d238861766dd93237ce0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3aca4589b06c6614538c9d96cd1c38e548499e82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:03:37 +00:00
Wladimir Leuschner 41df8e68cb QWindows11Style: Respect ItemViewItem foreground color
Fixes: QTBUG-126596
Fixes: QTBUG-126543
Pick-to: 6.7
Change-Id: I39803927259092be98dad02fa286bc92520ce43f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 7dc67d98976b7de7a34f74c9840d98aa5512d8dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-30 06:44:24 +00:00
Wladimir Leuschner a821bb2d32 QWindows11Style: Fix darkmode for ToolButtons in Toolbars
Fixes: QTBUG-126348
Pick-to: 6.7
Change-Id: I7088a6ba2395cce8f79f41831cf22475cd85dfe6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 86bcddac5f68e9f1d163fac75c09ef8bd0502e1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:47 +00:00
Wladimir Leuschner b457376c03 QWindows11Style: Increase min size of QAbstractSpinbox Widgets
With WinUI3 a new layout of the lineedit and buttons was introduced. The
buttons are now aligned horizontally instead of vertically. Trying to
mimic that layout in widgets results in too few space for the text in
the lineedit. This patch increases the minimum width when using the
QWindows11Style for QAbstractSpinBox elements and saves the original
width in a property in case the style is changed at runtime to restore
the original geometry.

Fixes: QTBUG-124235
Fixes: QTBUG-124150
Pick-to: 6.7
Change-Id: I8067b338fa4a2c1efd0a1b0644fb8a563601385b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-29 20:12:45 +02:00
Wladimir Leuschner b7874f1fab QWindows11Style: Initialize colorSchemeIndex/highContrastTheme in ctor
When creating a QWindows11Style with QStyleFactory::create() the current
colorSchemeIndex and highContrastTheme usage is not set. Those values
are now queried and set also in the Constructor of QWindows11Style.

Fixes: QTBUG-124524
Pick-to: 6.7
Change-Id: I42a3aa5bafb0ff4193b8644ac1895a78b8c82120
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-21 22:25:56 +02:00
Volker Hilsheimer 08f6a9a522 Fix build with -no-feature-mdiarea
Amends 96fcb4ef84.

Fixes: QTBUG-125506
Pick-to: 6.7
Change-Id: I8d7b4396623f4420f6901c44146a0cfd2cda4e5c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2024-05-21 18:53:10 +02:00
Wladimir Leuschner 392c5fab81 QWindows11Style: Use absolute Slider positioning
WinUI3 changed the behavior of Sliders by not using steps anymore but
by absolute change.

Fixes: QTBUG-125154
Pick-to: 6.7 6.7.1
Change-Id: I708f2584432b277b0c1fc0b2587137ce71714e69
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-05-14 08:41:59 +02:00
Volker Hilsheimer 5cdac10b46 Windows 11 style: simplify code to polish palette
There are two cases in which we let the style polish a palette:

- after merging the system palette and the style's standard palette
- or when a widget-class specific palette gets set

A style needs to know which colors of the palette it can safely
overwrite with style-specific preferences. For that to work, we
need to reset the resolve mask of the synthesized palette (first
case) to 0 before polishing. Palettes set explicitly by application
code will then have resolve bits set, and the polishing can
respect those colors and not overwrite them.

Simplify the polish() implementation then to check whether the
respective color's resolve bit is set, and only overwrite it with
the style's preferred color if the bit is clear. Move that logic
into a macro for simplification.

This amends b733d31f27 and makes
sure that colors that are set by the application explicitly don't
get overridden by the style.

Task-number: QTBUG-124490
Task-number: QTBUG-124286
Change-Id: I69e1e3da93f661ebdafee0b62adbb3d411322443
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-03 14:04:51 +02:00
Volker Hilsheimer 8bc80f2e1a Remove QGuiApplicationPrivate::colorScheme()
Use the platform theme or QStyleHints instead.

Task-number: QTBUG-124490
Change-Id: Iab12faa726d3031d6a250664468dac333c2c2e0c
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-05-02 19:03:42 +02:00
Wladimir Leuschner b733d31f27 QWindows11Style: Respect user set Stylesheets
QWindows11Style inherits from QWindowsVistaStyle for which StyleSheet
theming is deactivated. QWindows11Style draws most elements with
QPainter and should therefore be able to use overrides by StyleSheets.
This patch checks, whether QWindows11Style is used and enables the
theming by declaring it not to be a QPixmap based style. Further drawing
routines for QComboBox, QPushButton and QLineEdit are now drawing always
the base background and when they are hovered a alpha mask is used to
overdraw the elemens to create a highlight effect.

Fixes: QTBUG-124286
Pick-to: 6.7 6.7.1
Change-Id: I65436493bc2b1572c0d9423a066caea3ba9e1459
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-30 17:46:34 +02:00
Santhosh Kumar 8f283aa299 Fix progress bar rendering issue when using windows 11 style
The Windows 11 style checks for QProgressBar type and gets the
respective orientation required for rendering. This creates an issue
when we use QStyleItemDelegate as it's not QProgressBar type. This patch
removes that condition and gets the orientation information through the
style option similar to Windows Vista style.

Fixes: QTBUG-124447
Pick-to: 6.7
Change-Id: Ic2b36d79d7af017262e44dd2800ad45fbe63f8f2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2024-04-29 18:26:15 +02:00
Wladimir Leuschner 7d7d843a3e Windows11Style:Save unpolished palette for QAbstractScrollArea::viewport
When using QWindows11Style, the viewports background has to be set to
Qt::transparent to have the effect of rounded corners in ItemViews and
Combobox flyouts. Other Windows styles do not make use of transparent
windows, so this polishment needs to be reverted in case the style
changes. Other styles also do not manipulate the
QAbstractScrollArea::viewport palette and thus changing color schemes
results in not applying the new color scheme.

Fixes: QTBUG-123928
Pick-to: 6.7 6.7.1
Change-Id: Icb529124f63587e75bb56e40e8b1fcfe3c61c55d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-04-26 02:24:54 +02:00
Marius Kittler 30061e8960 Avoid crash with Windows 11 style when no widget passed
The documentation of `QStyle::drawControl()` states that
"The widget argument is optional" so it must not be used
unconditionally.

Pick-to: 6.7
Change-Id: I8b5a8ed421c0ae2c667925e448c9a029b6deedfd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-04-22 14:48:50 +00:00
Volker Hilsheimer 96fcb4ef84 Replace expensive inherits with cheaper qobject_cast (2)
In the Windows 11 style, it's better to include the headers for specific
widget types at the expense of compile time, than to pay a regular
runtime cost from using expensive inherits().

Add const, fix style, and break excessively long lines related to this
change.

Pick-to: 6.7
Change-Id: I2c8c6d98267d9ff3542decda71e08e462cf9807c
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
2024-04-19 13:13:31 +02:00
Wladimir Leuschner a35f57d429 QWindows11Style: Check for nullptr after qobject_cast
Fixes: QTBUG-123791
Pick-to: 6.7
Change-Id: I050196bdf45754509a223c89652e0be7e0160a98
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-04-09 18:12:18 +00:00
Wladimir Leuschner 587003c3cc QWindows11Style: Add offset for decoration in QComboBoxPrivateContainer
Pick-to: 6.7.0 6.7
Change-Id: Ib9043e1b3041c88d757ddd5ada6c0edcf2bb6129
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-03-21 21:05:28 +01:00
Wladimir Leuschner df24438e6a QWindows11Style: HighDPI aware qDrawPlainRoundedRect
Pick-to: 6.7
Change-Id: Ic9562a20bce59c265c539a1378f5f8fd8e9e9a17
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-15 03:59:26 +00:00
Wladimir Leuschner a1d18276a8 QWindows11Style: HighDPI aware progressbars
Draw progressbars and progressbar handles on sub-pixel coordinates to be
HighDPI aware.

Pick-to: 6.7
Change-Id: Ib4f39c3b3a05d9f47c045dd6032d7544b7add175
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-12 20:27:42 +01:00
Wladimir Leuschner 91df9d1bbf QWindows11Style: HighDPI aware scrollbars
Draw scrollbars and scrollbar handles on sub-pixel coordinates to be
HighDPI aware.

Pick-to: 6.7
Change-Id: Iab7c8566f31a58f83d03ec6644be68bf130682ce
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-12 19:27:42 +00:00
Wladimir Leuschner 91b04d5cf1 QWindows11Style: Draw ScrollArea opaque in QAbstractItemView
Pick-to: 6.7
Change-Id: Ica2c62355a576dda4eaefacbc41b8609009d0073
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-07 15:13:38 +00:00
Wladimir Leuschner f75e554c6a QWindows11Style: Update font size in menubar items and spacing between items
Reduce the spacing between menu bar items and change
font size to 10pt.

Fixes: QTBUG-120639
Pick-to: 6.7
Change-Id: Ic16e74f4a2426be6d6ef40904919d92785d96ce5
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-07 10:05:38 +00:00
Wladimir Leuschner c785d56ae0 QWindows11Style: Draw frames HighDPI aware
Draw frames and lines on sub-pixel coordinates to be HighDPI aware.

Pick-to: 6.7
Change-Id: Ie4eed73b3e5780216fad0b6a919cbe18391f2b79
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-05 15:43:29 +01:00
Wladimir Leuschner 172422fcee Increase padding for LineEdit controls in QWindows11Style
Pick-to: 6.7
Change-Id: Ibf8e43160d7ae0aff04040f0e2bcf5bfbda52e1d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-01 18:00:32 +00:00
Wladimir Leuschner 1a55926196 QWindows11Style: Fix transparency for overlapping ItemView editing
Fixes: QTBUG-120254
Pick-to: 6.7
Change-Id: Iabaee612f5a0613cbbcafe566b4a14d01cefa47c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-01 16:21:07 +01:00
Wladimir Leuschner 41854cfaac QWindows11Style: Revert Windows global palette changes
Revert Windows global palette changes and set the QPalette for
QWindows11Style in QWindows11Style::polish

Fixes: QTBUG-120571
Pick-to: 6.7
Change-Id: Iad4eb699c2dbfed38a917e6c9bc378c4262dc66e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-29 22:15:24 +01:00