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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Use the platform theme or QStyleHints instead.
Task-number: QTBUG-124490
Change-Id: Iab12faa726d3031d6a250664468dac333c2c2e0c
Reviewed-by: Doris Verria <doris.verria@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>