Bug fixes for QToolButton

Fixed styles for auto-raised QToolButtons. Also added fixes for standard icons in test suites, to ensure they work in Qt5 and Qt6. Added auto-raised icons to `example/widgets.py`.

Closes #22.
main
Alex Huszagh 2022-04-28 10:56:39 -05:00
parent e54c825b90
commit db1019ddd8
9 changed files with 4630 additions and 4322 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1569,7 +1569,25 @@ QSlider::sub-page:vertical
border-radius: 0.19em; border-radius: 0.19em;
} }
QToolButton /* QToolButton */
/**
* QToolButton's that have a push button need to be styled differently,
* and auto-raise is automatically disabled if there is a push button,
* IE, there is no arrow attached to the text in the QToolButton.
* Note that this is not affected by the following:
* popupMode: any pop-up mode does not affect the right arrow style.
* arrowType: only replaces the icon.
* toolButtonStyle: this is almost always set to icon only, even with text.
*
* This particularly affects QFileDialog, but also affects anything with
* auto-raise set to true. Therefore, our styles should only be set when
* auto-raise is false.
*
* The affected issues are #22 and #28.
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/22
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/28
*/
QToolButton[autoRaise="false"]
{ {
background-color: transparent; background-color: transparent;
border: 0.04em solid #76797c; border: 0.04em solid #76797c;
@ -1581,41 +1599,41 @@ QToolButton
min-height: 1.1em; min-height: 1.1em;
} }
QToolButton::right-arrow, QToolButton[autoRaise="false"]::right-arrow,
QToolButton::left-arrow, QToolButton[autoRaise="false"]::left-arrow,
QToolButton::up-arrow, QToolButton[autoRaise="false"]::up-arrow,
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
/* Undo the padding when we have an arrow */ /* Undo the padding when we have an arrow */
padding-right: -1.2em; padding-right: -1.2em;
} }
QToolButton::right-arrow QToolButton[autoRaise="false"]::right-arrow
{ {
image: url(dark:right_arrow.svg); image: url(dark:right_arrow.svg);
} }
QToolButton::left-arrow QToolButton[autoRaise="false"]::left-arrow
{ {
image: url(dark:left_arrow.svg); image: url(dark:left_arrow.svg);
} }
QToolButton::up-arrow QToolButton[autoRaise="false"]::up-arrow
{ {
image: url(dark:up_arrow.svg); image: url(dark:up_arrow.svg);
} }
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
image: url(dark:down_arrow.svg); image: url(dark:down_arrow.svg);
} }
QToolButton:hover QToolButton[autoRaise="false"]:hover
{ {
border: 0.04em solid #3daee9; border: 0.04em solid #3daee9;
} }
QToolButton::menu-indicator QToolButton[autoRaise="false"]::menu-indicator
{ {
border-image: none; border-image: none;
image: url(dark:down_arrow.svg); image: url(dark:down_arrow.svg);
@ -1626,7 +1644,7 @@ QToolButton::menu-indicator
padding-right: 0.09em; padding-right: 0.09em;
} }
QToolButton::menu-arrow QToolButton[autoRaise="false"]::menu-arrow
{ {
border-image: none; border-image: none;
image: url(dark:down_arrow.svg); image: url(dark:down_arrow.svg);
@ -1635,7 +1653,7 @@ QToolButton::menu-arrow
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button QToolButton[autoRaise="false"]::menu-button
{ {
border-top-right-radius: 0.5em; border-top-right-radius: 0.5em;
border-bottom-right-radius: 0.5em; border-bottom-right-radius: 0.5em;
@ -1645,19 +1663,19 @@ QToolButton::menu-button
outline: none; outline: none;
} }
QToolButton::menu-button::menu-arrow QToolButton[autoRaise="false"]::menu-button::menu-arrow
{ {
left: -0.09em; left: -0.09em;
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button:hover QToolButton[autoRaise="false"]::menu-button:hover
{ {
background-color: transparent; background-color: transparent;
} }
QToolButton:checked, QToolButton[autoRaise="false"]:checked,
QToolButton:pressed QToolButton[autoRaise="false"]:pressed
{ {
background-color: #3daee9; background-color: #3daee9;
padding: 0.23em; padding: 0.23em;
@ -1666,7 +1684,7 @@ QToolButton:pressed
outline: none; outline: none;
} }
QToolButton::menu-button:pressed QToolButton[autoRaise="false"]::menu-button:pressed
{ {
background-color: transparent; background-color: transparent;
padding: 0.23em; padding: 0.23em;
@ -1968,4 +1986,4 @@ QMessageBox QPushButton
{ {
min-height: 1.1em; min-height: 1.1em;
min-width: 5em; min-width: 5em;
} }

View File

@ -1569,7 +1569,25 @@ QSlider::sub-page:vertical
border-radius: 0.19em; border-radius: 0.19em;
} }
QToolButton /* QToolButton */
/**
* QToolButton's that have a push button need to be styled differently,
* and auto-raise is automatically disabled if there is a push button,
* IE, there is no arrow attached to the text in the QToolButton.
* Note that this is not affected by the following:
* popupMode: any pop-up mode does not affect the right arrow style.
* arrowType: only replaces the icon.
* toolButtonStyle: this is almost always set to icon only, even with text.
*
* This particularly affects QFileDialog, but also affects anything with
* auto-raise set to true. Therefore, our styles should only be set when
* auto-raise is false.
*
* The affected issues are #22 and #28.
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/22
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/28
*/
QToolButton[autoRaise="false"]
{ {
background-color: transparent; background-color: transparent;
border: 0.04em solid #bab9b8; border: 0.04em solid #bab9b8;
@ -1581,41 +1599,41 @@ QToolButton
min-height: 1.1em; min-height: 1.1em;
} }
QToolButton::right-arrow, QToolButton[autoRaise="false"]::right-arrow,
QToolButton::left-arrow, QToolButton[autoRaise="false"]::left-arrow,
QToolButton::up-arrow, QToolButton[autoRaise="false"]::up-arrow,
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
/* Undo the padding when we have an arrow */ /* Undo the padding when we have an arrow */
padding-right: -1.2em; padding-right: -1.2em;
} }
QToolButton::right-arrow QToolButton[autoRaise="false"]::right-arrow
{ {
image: url(light:right_arrow.svg); image: url(light:right_arrow.svg);
} }
QToolButton::left-arrow QToolButton[autoRaise="false"]::left-arrow
{ {
image: url(light:left_arrow.svg); image: url(light:left_arrow.svg);
} }
QToolButton::up-arrow QToolButton[autoRaise="false"]::up-arrow
{ {
image: url(light:up_arrow.svg); image: url(light:up_arrow.svg);
} }
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
image: url(light:down_arrow.svg); image: url(light:down_arrow.svg);
} }
QToolButton:hover QToolButton[autoRaise="false"]:hover
{ {
border: 0.04em solid rgba(51, 164, 223, 0.5); border: 0.04em solid rgba(51, 164, 223, 0.5);
} }
QToolButton::menu-indicator QToolButton[autoRaise="false"]::menu-indicator
{ {
border-image: none; border-image: none;
image: url(light:down_arrow.svg); image: url(light:down_arrow.svg);
@ -1626,7 +1644,7 @@ QToolButton::menu-indicator
padding-right: 0.09em; padding-right: 0.09em;
} }
QToolButton::menu-arrow QToolButton[autoRaise="false"]::menu-arrow
{ {
border-image: none; border-image: none;
image: url(light:down_arrow.svg); image: url(light:down_arrow.svg);
@ -1635,7 +1653,7 @@ QToolButton::menu-arrow
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button QToolButton[autoRaise="false"]::menu-button
{ {
border-top-right-radius: 0.5em; border-top-right-radius: 0.5em;
border-bottom-right-radius: 0.5em; border-bottom-right-radius: 0.5em;
@ -1645,19 +1663,19 @@ QToolButton::menu-button
outline: none; outline: none;
} }
QToolButton::menu-button::menu-arrow QToolButton[autoRaise="false"]::menu-button::menu-arrow
{ {
left: -0.09em; left: -0.09em;
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button:hover QToolButton[autoRaise="false"]::menu-button:hover
{ {
background-color: transparent; background-color: transparent;
} }
QToolButton:checked, QToolButton[autoRaise="false"]:checked,
QToolButton:pressed QToolButton[autoRaise="false"]:pressed
{ {
background-color: rgba(51, 164, 223, 0.5); background-color: rgba(51, 164, 223, 0.5);
padding: 0.23em; padding: 0.23em;
@ -1666,7 +1684,7 @@ QToolButton:pressed
outline: none; outline: none;
} }
QToolButton::menu-button:pressed QToolButton[autoRaise="false"]::menu-button:pressed
{ {
background-color: transparent; background-color: transparent;
padding: 0.23em; padding: 0.23em;
@ -1968,4 +1986,4 @@ QMessageBox QPushButton
{ {
min-height: 1.1em; min-height: 1.1em;
min-width: 5em; min-width: 5em;
} }

View File

@ -1569,7 +1569,25 @@ QSlider::sub-page:vertical
border-radius: 0.19em; border-radius: 0.19em;
} }
QToolButton /* QToolButton */
/**
* QToolButton's that have a push button need to be styled differently,
* and auto-raise is automatically disabled if there is a push button,
* IE, there is no arrow attached to the text in the QToolButton.
* Note that this is not affected by the following:
* popupMode: any pop-up mode does not affect the right arrow style.
* arrowType: only replaces the icon.
* toolButtonStyle: this is almost always set to icon only, even with text.
*
* This particularly affects QFileDialog, but also affects anything with
* auto-raise set to true. Therefore, our styles should only be set when
* auto-raise is false.
*
* The affected issues are #22 and #28.
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/22
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/28
*/
QToolButton[autoRaise="false"]
{ {
background-color: transparent; background-color: transparent;
border: 0.04em solid #76797c; border: 0.04em solid #76797c;
@ -1581,41 +1599,41 @@ QToolButton
min-height: 1.1em; min-height: 1.1em;
} }
QToolButton::right-arrow, QToolButton[autoRaise="false"]::right-arrow,
QToolButton::left-arrow, QToolButton[autoRaise="false"]::left-arrow,
QToolButton::up-arrow, QToolButton[autoRaise="false"]::up-arrow,
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
/* Undo the padding when we have an arrow */ /* Undo the padding when we have an arrow */
padding-right: -1.2em; padding-right: -1.2em;
} }
QToolButton::right-arrow QToolButton[autoRaise="false"]::right-arrow
{ {
image: url(:/dark/right_arrow.svg); image: url(:/dark/right_arrow.svg);
} }
QToolButton::left-arrow QToolButton[autoRaise="false"]::left-arrow
{ {
image: url(:/dark/left_arrow.svg); image: url(:/dark/left_arrow.svg);
} }
QToolButton::up-arrow QToolButton[autoRaise="false"]::up-arrow
{ {
image: url(:/dark/up_arrow.svg); image: url(:/dark/up_arrow.svg);
} }
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
image: url(:/dark/down_arrow.svg); image: url(:/dark/down_arrow.svg);
} }
QToolButton:hover QToolButton[autoRaise="false"]:hover
{ {
border: 0.04em solid #3daee9; border: 0.04em solid #3daee9;
} }
QToolButton::menu-indicator QToolButton[autoRaise="false"]::menu-indicator
{ {
border-image: none; border-image: none;
image: url(:/dark/down_arrow.svg); image: url(:/dark/down_arrow.svg);
@ -1626,7 +1644,7 @@ QToolButton::menu-indicator
padding-right: 0.09em; padding-right: 0.09em;
} }
QToolButton::menu-arrow QToolButton[autoRaise="false"]::menu-arrow
{ {
border-image: none; border-image: none;
image: url(:/dark/down_arrow.svg); image: url(:/dark/down_arrow.svg);
@ -1635,7 +1653,7 @@ QToolButton::menu-arrow
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button QToolButton[autoRaise="false"]::menu-button
{ {
border-top-right-radius: 0.5em; border-top-right-radius: 0.5em;
border-bottom-right-radius: 0.5em; border-bottom-right-radius: 0.5em;
@ -1645,19 +1663,19 @@ QToolButton::menu-button
outline: none; outline: none;
} }
QToolButton::menu-button::menu-arrow QToolButton[autoRaise="false"]::menu-button::menu-arrow
{ {
left: -0.09em; left: -0.09em;
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button:hover QToolButton[autoRaise="false"]::menu-button:hover
{ {
background-color: transparent; background-color: transparent;
} }
QToolButton:checked, QToolButton[autoRaise="false"]:checked,
QToolButton:pressed QToolButton[autoRaise="false"]:pressed
{ {
background-color: #3daee9; background-color: #3daee9;
padding: 0.23em; padding: 0.23em;
@ -1666,7 +1684,7 @@ QToolButton:pressed
outline: none; outline: none;
} }
QToolButton::menu-button:pressed QToolButton[autoRaise="false"]::menu-button:pressed
{ {
background-color: transparent; background-color: transparent;
padding: 0.23em; padding: 0.23em;
@ -1968,4 +1986,4 @@ QMessageBox QPushButton
{ {
min-height: 1.1em; min-height: 1.1em;
min-width: 5em; min-width: 5em;
} }

View File

@ -1569,7 +1569,25 @@ QSlider::sub-page:vertical
border-radius: 0.19em; border-radius: 0.19em;
} }
QToolButton /* QToolButton */
/**
* QToolButton's that have a push button need to be styled differently,
* and auto-raise is automatically disabled if there is a push button,
* IE, there is no arrow attached to the text in the QToolButton.
* Note that this is not affected by the following:
* popupMode: any pop-up mode does not affect the right arrow style.
* arrowType: only replaces the icon.
* toolButtonStyle: this is almost always set to icon only, even with text.
*
* This particularly affects QFileDialog, but also affects anything with
* auto-raise set to true. Therefore, our styles should only be set when
* auto-raise is false.
*
* The affected issues are #22 and #28.
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/22
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/28
*/
QToolButton[autoRaise="false"]
{ {
background-color: transparent; background-color: transparent;
border: 0.04em solid #bab9b8; border: 0.04em solid #bab9b8;
@ -1581,41 +1599,41 @@ QToolButton
min-height: 1.1em; min-height: 1.1em;
} }
QToolButton::right-arrow, QToolButton[autoRaise="false"]::right-arrow,
QToolButton::left-arrow, QToolButton[autoRaise="false"]::left-arrow,
QToolButton::up-arrow, QToolButton[autoRaise="false"]::up-arrow,
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
/* Undo the padding when we have an arrow */ /* Undo the padding when we have an arrow */
padding-right: -1.2em; padding-right: -1.2em;
} }
QToolButton::right-arrow QToolButton[autoRaise="false"]::right-arrow
{ {
image: url(:/light/right_arrow.svg); image: url(:/light/right_arrow.svg);
} }
QToolButton::left-arrow QToolButton[autoRaise="false"]::left-arrow
{ {
image: url(:/light/left_arrow.svg); image: url(:/light/left_arrow.svg);
} }
QToolButton::up-arrow QToolButton[autoRaise="false"]::up-arrow
{ {
image: url(:/light/up_arrow.svg); image: url(:/light/up_arrow.svg);
} }
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
image: url(:/light/down_arrow.svg); image: url(:/light/down_arrow.svg);
} }
QToolButton:hover QToolButton[autoRaise="false"]:hover
{ {
border: 0.04em solid rgba(51, 164, 223, 0.5); border: 0.04em solid rgba(51, 164, 223, 0.5);
} }
QToolButton::menu-indicator QToolButton[autoRaise="false"]::menu-indicator
{ {
border-image: none; border-image: none;
image: url(:/light/down_arrow.svg); image: url(:/light/down_arrow.svg);
@ -1626,7 +1644,7 @@ QToolButton::menu-indicator
padding-right: 0.09em; padding-right: 0.09em;
} }
QToolButton::menu-arrow QToolButton[autoRaise="false"]::menu-arrow
{ {
border-image: none; border-image: none;
image: url(:/light/down_arrow.svg); image: url(:/light/down_arrow.svg);
@ -1635,7 +1653,7 @@ QToolButton::menu-arrow
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button QToolButton[autoRaise="false"]::menu-button
{ {
border-top-right-radius: 0.5em; border-top-right-radius: 0.5em;
border-bottom-right-radius: 0.5em; border-bottom-right-radius: 0.5em;
@ -1645,19 +1663,19 @@ QToolButton::menu-button
outline: none; outline: none;
} }
QToolButton::menu-button::menu-arrow QToolButton[autoRaise="false"]::menu-button::menu-arrow
{ {
left: -0.09em; left: -0.09em;
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button:hover QToolButton[autoRaise="false"]::menu-button:hover
{ {
background-color: transparent; background-color: transparent;
} }
QToolButton:checked, QToolButton[autoRaise="false"]:checked,
QToolButton:pressed QToolButton[autoRaise="false"]:pressed
{ {
background-color: rgba(51, 164, 223, 0.5); background-color: rgba(51, 164, 223, 0.5);
padding: 0.23em; padding: 0.23em;
@ -1666,7 +1684,7 @@ QToolButton:pressed
outline: none; outline: none;
} }
QToolButton::menu-button:pressed QToolButton[autoRaise="false"]::menu-button:pressed
{ {
background-color: transparent; background-color: transparent;
padding: 0.23em; padding: 0.23em;
@ -1968,4 +1986,4 @@ QMessageBox QPushButton
{ {
min-height: 1.1em; min-height: 1.1em;
min-width: 5em; min-width: 5em;
} }

View File

@ -88,12 +88,13 @@ args, unknown = parser.parse_known_args()
if args.pyqt6: if args.pyqt6:
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
QtCore.QDir.addSearchPath(args.stylesheet, f'{dist}/pyqt6/{args.stylesheet}/') QtCore.QDir.addSearchPath(args.stylesheet, f'{dist}/pyqt6/{args.stylesheet}/')
stylesheet = f'{args.stylesheet}:stylesheet.qss' resource_format = f'{args.stylesheet}:'
else: else:
sys.path.insert(0, home) sys.path.insert(0, home)
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
import breeze_resources import breeze_resources
stylesheet = f':/{args.stylesheet}/stylesheet.qss' resource_format = f':/{args.stylesheet}/'
stylesheet = f'{resource_format}stylesheet.qss'
from PyQtAds import QtAds from PyQtAds import QtAds

View File

@ -85,12 +85,13 @@ args, unknown = parser.parse_known_args()
if args.pyqt6: if args.pyqt6:
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
QtCore.QDir.addSearchPath(args.stylesheet, f'{dist}/pyqt6/{args.stylesheet}/') QtCore.QDir.addSearchPath(args.stylesheet, f'{dist}/pyqt6/{args.stylesheet}/')
stylesheet = f'{args.stylesheet}:stylesheet.qss' resource_format = f'{args.stylesheet}:'
else: else:
sys.path.insert(0, home) sys.path.insert(0, home)
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
import breeze_resources import breeze_resources
stylesheet = f':/{args.stylesheet}/stylesheet.qss' resource_format = f':/{args.stylesheet}/'
stylesheet = f'{resource_format}stylesheet.qss'
# Compat definitions, between Qt5 and Qt6. # Compat definitions, between Qt5 and Qt6.
if args.pyqt6: if args.pyqt6:
@ -114,6 +115,7 @@ if args.pyqt6:
ReadOnly = QtCore.QFile.OpenModeFlag.ReadOnly ReadOnly = QtCore.QFile.OpenModeFlag.ReadOnly
Text = QtCore.QFile.OpenModeFlag.Text Text = QtCore.QFile.OpenModeFlag.Text
East = QtWidgets.QTabWidget.TabPosition.East East = QtWidgets.QTabWidget.TabPosition.East
SP_DialogResetButton = QtWidgets.QStyle.StandardPixmap.SP_DialogResetButton
else: else:
QAction = QtWidgets.QAction QAction = QtWidgets.QAction
Horizontal = QtCore.Qt.Horizontal Horizontal = QtCore.Qt.Horizontal
@ -135,6 +137,7 @@ else:
ReadOnly = QtCore.QFile.ReadOnly ReadOnly = QtCore.QFile.ReadOnly
Text = QtCore.QFile.Text Text = QtCore.QFile.Text
East = QtWidgets.QTabWidget.East East = QtWidgets.QTabWidget.East
SP_DialogResetButton = QtWidgets.QStyle.SP_DialogResetButton
# Need to fix an issue on Wayland on Linux: # Need to fix an issue on Wayland on Linux:
# conda-forge does not support Wayland, for who knows what reason. # conda-forge does not support Wayland, for who knows what reason.
@ -361,6 +364,12 @@ class Ui:
self.bt_menu_button_popup.setPopupMode(MenuButtonPopup) self.bt_menu_button_popup.setPopupMode(MenuButtonPopup)
self.bt_menu_button_popup.setObjectName('bt_menu_button_popup') self.bt_menu_button_popup.setObjectName('bt_menu_button_popup')
self.horizontalLayout.addWidget(self.bt_menu_button_popup) self.horizontalLayout.addWidget(self.bt_menu_button_popup)
self.bt_auto_raise = QtWidgets.QToolButton(self.centralwidget)
self.bt_auto_raise.setAutoRaise(True)
auto_raise_icon = self.bt_auto_raise.style().standardIcon(SP_DialogResetButton)
self.bt_auto_raise.setIcon(auto_raise_icon)
self.bt_auto_raise.setObjectName('bt_auto_raise')
self.horizontalLayout.addWidget(self.bt_auto_raise)
self.line_2 = QtWidgets.QFrame(self.centralwidget) self.line_2 = QtWidgets.QFrame(self.centralwidget)
self.line_2.setFrameShape(VLine) self.line_2.setFrameShape(VLine)
self.line_2.setFrameShadow(Sunken) self.line_2.setFrameShadow(Sunken)

View File

@ -1569,7 +1569,25 @@ QSlider::sub-page:vertical
border-radius: 0.19em; border-radius: 0.19em;
} }
QToolButton /* QToolButton */
/**
* QToolButton's that have a push button need to be styled differently,
* and auto-raise is automatically disabled if there is a push button,
* IE, there is no arrow attached to the text in the QToolButton.
* Note that this is not affected by the following:
* popupMode: any pop-up mode does not affect the right arrow style.
* arrowType: only replaces the icon.
* toolButtonStyle: this is almost always set to icon only, even with text.
*
* This particularly affects QFileDialog, but also affects anything with
* auto-raise set to true. Therefore, our styles should only be set when
* auto-raise is false.
*
* The affected issues are #22 and #28.
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/22
* https://github.com/Alexhuszagh/BreezeStyleSheets/issues/28
*/
QToolButton[autoRaise="false"]
{ {
background-color: transparent; background-color: transparent;
border: 0.04em solid ^midtone^; border: 0.04em solid ^midtone^;
@ -1581,41 +1599,41 @@ QToolButton
min-height: 1.1em; min-height: 1.1em;
} }
QToolButton::right-arrow, QToolButton[autoRaise="false"]::right-arrow,
QToolButton::left-arrow, QToolButton[autoRaise="false"]::left-arrow,
QToolButton::up-arrow, QToolButton[autoRaise="false"]::up-arrow,
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
/* Undo the padding when we have an arrow */ /* Undo the padding when we have an arrow */
padding-right: -1.2em; padding-right: -1.2em;
} }
QToolButton::right-arrow QToolButton[autoRaise="false"]::right-arrow
{ {
image: url(^style^right_arrow.svg); image: url(^style^right_arrow.svg);
} }
QToolButton::left-arrow QToolButton[autoRaise="false"]::left-arrow
{ {
image: url(^style^left_arrow.svg); image: url(^style^left_arrow.svg);
} }
QToolButton::up-arrow QToolButton[autoRaise="false"]::up-arrow
{ {
image: url(^style^up_arrow.svg); image: url(^style^up_arrow.svg);
} }
QToolButton::down-arrow QToolButton[autoRaise="false"]::down-arrow
{ {
image: url(^style^down_arrow.svg); image: url(^style^down_arrow.svg);
} }
QToolButton:hover QToolButton[autoRaise="false"]:hover
{ {
border: 0.04em solid ^highlight^; border: 0.04em solid ^highlight^;
} }
QToolButton::menu-indicator QToolButton[autoRaise="false"]::menu-indicator
{ {
border-image: none; border-image: none;
image: url(^style^down_arrow.svg); image: url(^style^down_arrow.svg);
@ -1626,7 +1644,7 @@ QToolButton::menu-indicator
padding-right: 0.09em; padding-right: 0.09em;
} }
QToolButton::menu-arrow QToolButton[autoRaise="false"]::menu-arrow
{ {
border-image: none; border-image: none;
image: url(^style^down_arrow.svg); image: url(^style^down_arrow.svg);
@ -1635,7 +1653,7 @@ QToolButton::menu-arrow
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button QToolButton[autoRaise="false"]::menu-button
{ {
border-top-right-radius: 0.5em; border-top-right-radius: 0.5em;
border-bottom-right-radius: 0.5em; border-bottom-right-radius: 0.5em;
@ -1645,19 +1663,19 @@ QToolButton::menu-button
outline: none; outline: none;
} }
QToolButton::menu-button::menu-arrow QToolButton[autoRaise="false"]::menu-button::menu-arrow
{ {
left: -0.09em; left: -0.09em;
subcontrol-position: bottom right; subcontrol-position: bottom right;
} }
QToolButton::menu-button:hover QToolButton[autoRaise="false"]::menu-button:hover
{ {
background-color: transparent; background-color: transparent;
} }
QToolButton:checked, QToolButton[autoRaise="false"]:checked,
QToolButton:pressed QToolButton[autoRaise="false"]:pressed
{ {
background-color: ^highlight^; background-color: ^highlight^;
padding: 0.23em; padding: 0.23em;
@ -1666,7 +1684,7 @@ QToolButton:pressed
outline: none; outline: none;
} }
QToolButton::menu-button:pressed QToolButton[autoRaise="false"]::menu-button:pressed
{ {
background-color: transparent; background-color: transparent;
padding: 0.23em; padding: 0.23em;
@ -1968,4 +1986,4 @@ QMessageBox QPushButton
{ {
min-height: 1.1em; min-height: 1.1em;
min-width: 5em; min-width: 5em;
} }

View File

@ -112,14 +112,13 @@ args, unknown = parser.parse_known_args()
if args.pyqt6: if args.pyqt6:
from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6 import QtCore, QtGui, QtWidgets
QtCore.QDir.addSearchPath(args.stylesheet, f'{dist}/pyqt6/{args.stylesheet}/') QtCore.QDir.addSearchPath(args.stylesheet, f'{dist}/pyqt6/{args.stylesheet}/')
style_prefix = f'{args.stylesheet}:' resource_format = f'{args.stylesheet}:'
stylesheet = f'{style_prefix}stylesheet.qss'
else: else:
sys.path.insert(0, home) sys.path.insert(0, home)
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
import breeze_resources import breeze_resources
style_prefix = f':/{args.stylesheet}/' resource_format = f':/{args.stylesheet}/'
stylesheet = f'{style_prefix}stylesheet.qss' stylesheet = f'{resource_format}stylesheet.qss'
# Compat definitions, between Qt5 and Qt6. # Compat definitions, between Qt5 and Qt6.
if args.pyqt6: if args.pyqt6:
@ -184,6 +183,86 @@ if args.pyqt6:
ExistingFile = QtWidgets.QFileDialog.FileMode.ExistingFile ExistingFile = QtWidgets.QFileDialog.FileMode.ExistingFile
Directory = QtWidgets.QFileDialog.FileMode.Directory Directory = QtWidgets.QFileDialog.FileMode.Directory
ExistingFiles = QtWidgets.QFileDialog.FileMode.ExistingFiles ExistingFiles = QtWidgets.QFileDialog.FileMode.ExistingFiles
SP_ArrowBack = QtWidgets.QStyle.StandardPixmap.SP_ArrowBack
SP_ArrowDown = QtWidgets.QStyle.StandardPixmap.SP_ArrowDown
SP_ArrowForward = QtWidgets.QStyle.StandardPixmap.SP_ArrowForward
SP_ArrowLeft = QtWidgets.QStyle.StandardPixmap.SP_ArrowLeft
SP_ArrowRight = QtWidgets.QStyle.StandardPixmap.SP_ArrowRight
SP_ArrowUp = QtWidgets.QStyle.StandardPixmap.SP_ArrowUp
SP_BrowserReload = QtWidgets.QStyle.StandardPixmap.SP_BrowserReload
SP_BrowserStop = QtWidgets.QStyle.StandardPixmap.SP_BrowserStop
SP_CommandLink = QtWidgets.QStyle.StandardPixmap.SP_CommandLink
SP_ComputerIcon = QtWidgets.QStyle.StandardPixmap.SP_ComputerIcon
SP_CustomBase = QtWidgets.QStyle.StandardPixmap.SP_CustomBase
SP_DesktopIcon = QtWidgets.QStyle.StandardPixmap.SP_DesktopIcon
SP_DialogAbortButton = QtWidgets.QStyle.StandardPixmap.SP_DialogAbortButton
SP_DialogApplyButton = QtWidgets.QStyle.StandardPixmap.SP_DialogApplyButton
SP_DialogCancelButton = QtWidgets.QStyle.StandardPixmap.SP_DialogCancelButton
SP_DialogCloseButton = QtWidgets.QStyle.StandardPixmap.SP_DialogCloseButton
SP_DialogDiscardButton = QtWidgets.QStyle.StandardPixmap.SP_DialogDiscardButton
SP_DialogHelpButton = QtWidgets.QStyle.StandardPixmap.SP_DialogHelpButton
SP_DialogIgnoreButton = QtWidgets.QStyle.StandardPixmap.SP_DialogIgnoreButton
SP_DialogNoButton = QtWidgets.QStyle.StandardPixmap.SP_DialogNoButton
SP_DialogNoToAllButton = QtWidgets.QStyle.StandardPixmap.SP_DialogNoToAllButton
SP_DialogOkButton = QtWidgets.QStyle.StandardPixmap.SP_DialogOkButton
SP_DialogOpenButton = QtWidgets.QStyle.StandardPixmap.SP_DialogOpenButton
SP_DialogResetButton = QtWidgets.QStyle.StandardPixmap.SP_DialogResetButton
SP_DialogRetryButton = QtWidgets.QStyle.StandardPixmap.SP_DialogRetryButton
SP_DialogSaveAllButton = QtWidgets.QStyle.StandardPixmap.SP_DialogSaveAllButton
SP_DialogSaveButton = QtWidgets.QStyle.StandardPixmap.SP_DialogSaveButton
SP_DialogYesButton = QtWidgets.QStyle.StandardPixmap.SP_DialogYesButton
SP_DialogYesToAllButton = QtWidgets.QStyle.StandardPixmap.SP_DialogYesToAllButton
SP_DirClosedIcon = QtWidgets.QStyle.StandardPixmap.SP_DirClosedIcon
SP_DirHomeIcon = QtWidgets.QStyle.StandardPixmap.SP_DirHomeIcon
SP_DirIcon = QtWidgets.QStyle.StandardPixmap.SP_DirIcon
SP_DirLinkIcon = QtWidgets.QStyle.StandardPixmap.SP_DirLinkIcon
SP_DirLinkOpenIcon = QtWidgets.QStyle.StandardPixmap.SP_DirLinkOpenIcon
SP_DirOpenIcon = QtWidgets.QStyle.StandardPixmap.SP_DirOpenIcon
SP_DockWidgetCloseButton = QtWidgets.QStyle.StandardPixmap.SP_DockWidgetCloseButton
SP_DriveCDIcon = QtWidgets.QStyle.StandardPixmap.SP_DriveCDIcon
SP_DriveDVDIcon = QtWidgets.QStyle.StandardPixmap.SP_DriveDVDIcon
SP_DriveFDIcon = QtWidgets.QStyle.StandardPixmap.SP_DriveFDIcon
SP_DriveHDIcon = QtWidgets.QStyle.StandardPixmap.SP_DriveHDIcon
SP_DriveNetIcon = QtWidgets.QStyle.StandardPixmap.SP_DriveNetIcon
SP_FileDialogBack = QtWidgets.QStyle.StandardPixmap.SP_FileDialogBack
SP_FileDialogContentsView = QtWidgets.QStyle.StandardPixmap.SP_FileDialogContentsView
SP_FileDialogDetailedView = QtWidgets.QStyle.StandardPixmap.SP_FileDialogDetailedView
SP_FileDialogEnd = QtWidgets.QStyle.StandardPixmap.SP_FileDialogEnd
SP_FileDialogInfoView = QtWidgets.QStyle.StandardPixmap.SP_FileDialogInfoView
SP_FileDialogListView = QtWidgets.QStyle.StandardPixmap.SP_FileDialogListView
SP_FileDialogNewFolder = QtWidgets.QStyle.StandardPixmap.SP_FileDialogNewFolder
SP_FileDialogStart = QtWidgets.QStyle.StandardPixmap.SP_FileDialogStart
SP_FileDialogToParent = QtWidgets.QStyle.StandardPixmap.SP_FileDialogToParent
SP_FileIcon = QtWidgets.QStyle.StandardPixmap.SP_FileIcon
SP_FileLinkIcon = QtWidgets.QStyle.StandardPixmap.SP_FileLinkIcon
SP_LineEditClearButton = QtWidgets.QStyle.StandardPixmap.SP_LineEditClearButton
SP_MediaPause = QtWidgets.QStyle.StandardPixmap.SP_MediaPause
SP_MediaPlay = QtWidgets.QStyle.StandardPixmap.SP_MediaPlay
SP_MediaSeekBackward = QtWidgets.QStyle.StandardPixmap.SP_MediaSeekBackward
SP_MediaSeekForward = QtWidgets.QStyle.StandardPixmap.SP_MediaSeekForward
SP_MediaSkipBackward = QtWidgets.QStyle.StandardPixmap.SP_MediaSkipBackward
SP_MediaSkipForward = QtWidgets.QStyle.StandardPixmap.SP_MediaSkipForward
SP_MediaStop = QtWidgets.QStyle.StandardPixmap.SP_MediaStop
SP_MediaVolume = QtWidgets.QStyle.StandardPixmap.SP_MediaVolume
SP_MediaVolumeMuted = QtWidgets.QStyle.StandardPixmap.SP_MediaVolumeMuted
SP_MessageBoxCritical = QtWidgets.QStyle.StandardPixmap.SP_MessageBoxCritical
SP_MessageBoxInformation = QtWidgets.QStyle.StandardPixmap.SP_MessageBoxInformation
SP_MessageBoxQuestion = QtWidgets.QStyle.StandardPixmap.SP_MessageBoxQuestion
SP_MessageBoxWarning = QtWidgets.QStyle.StandardPixmap.SP_MessageBoxWarning
SP_RestoreDefaultsButton = QtWidgets.QStyle.StandardPixmap.SP_RestoreDefaultsButton
SP_TabCloseButton = QtWidgets.QStyle.StandardPixmap.SP_TabCloseButton
SP_TitleBarCloseButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarCloseButton
SP_TitleBarContextHelpButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarContextHelpButton
SP_TitleBarMaxButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarMaxButton
SP_TitleBarMenuButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarMenuButton
SP_TitleBarMinButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarMinButton
SP_TitleBarNormalButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarNormalButton
SP_TitleBarShadeButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarShadeButton
SP_TitleBarUnshadeButton = QtWidgets.QStyle.StandardPixmap.SP_TitleBarUnshadeButton
SP_ToolBarHorizontalExtensionButton = QtWidgets.QStyle.StandardPixmap.SP_ToolBarHorizontalExtensionButton
SP_ToolBarVerticalExtensionButton = QtWidgets.QStyle.StandardPixmap.SP_ToolBarVerticalExtensionButton
SP_TrashIcon = QtWidgets.QStyle.StandardPixmap.SP_TrashIcon
SP_VistaShield = QtWidgets.QStyle.StandardPixmap.SP_VistaShield
else: else:
QAction = QtWidgets.QAction QAction = QtWidgets.QAction
AlignTop = QtCore.Qt.AlignTop AlignTop = QtCore.Qt.AlignTop
@ -243,6 +322,86 @@ else:
ExistingFile = QtWidgets.QFileDialog.ExistingFile ExistingFile = QtWidgets.QFileDialog.ExistingFile
Directory = QtWidgets.QFileDialog.Directory Directory = QtWidgets.QFileDialog.Directory
ExistingFiles = QtWidgets.QFileDialog.ExistingFiles ExistingFiles = QtWidgets.QFileDialog.ExistingFiles
SP_ArrowBack = QtWidgets.QStyle.SP_ArrowBack
SP_ArrowDown = QtWidgets.QStyle.SP_ArrowDown
SP_ArrowForward = QtWidgets.QStyle.SP_ArrowForward
SP_ArrowLeft = QtWidgets.QStyle.SP_ArrowLeft
SP_ArrowRight = QtWidgets.QStyle.SP_ArrowRight
SP_ArrowUp = QtWidgets.QStyle.SP_ArrowUp
SP_BrowserReload = QtWidgets.QStyle.SP_BrowserReload
SP_BrowserStop = QtWidgets.QStyle.SP_BrowserStop
SP_CommandLink = QtWidgets.QStyle.SP_CommandLink
SP_ComputerIcon = QtWidgets.QStyle.SP_ComputerIcon
SP_CustomBase = QtWidgets.QStyle.SP_CustomBase
SP_DesktopIcon = QtWidgets.QStyle.SP_DesktopIcon
SP_DialogAbortButton = QtWidgets.QStyle.SP_DialogAbortButton
SP_DialogApplyButton = QtWidgets.QStyle.SP_DialogApplyButton
SP_DialogCancelButton = QtWidgets.QStyle.SP_DialogCancelButton
SP_DialogCloseButton = QtWidgets.QStyle.SP_DialogCloseButton
SP_DialogDiscardButton = QtWidgets.QStyle.SP_DialogDiscardButton
SP_DialogHelpButton = QtWidgets.QStyle.SP_DialogHelpButton
SP_DialogIgnoreButton = QtWidgets.QStyle.SP_DialogIgnoreButton
SP_DialogNoButton = QtWidgets.QStyle.SP_DialogNoButton
SP_DialogNoToAllButton = QtWidgets.QStyle.SP_DialogNoToAllButton
SP_DialogOkButton = QtWidgets.QStyle.SP_DialogOkButton
SP_DialogOpenButton = QtWidgets.QStyle.SP_DialogOpenButton
SP_DialogResetButton = QtWidgets.QStyle.SP_DialogResetButton
SP_DialogRetryButton = QtWidgets.QStyle.SP_DialogRetryButton
SP_DialogSaveAllButton = QtWidgets.QStyle.SP_DialogSaveAllButton
SP_DialogSaveButton = QtWidgets.QStyle.SP_DialogSaveButton
SP_DialogYesButton = QtWidgets.QStyle.SP_DialogYesButton
SP_DialogYesToAllButton = QtWidgets.QStyle.SP_DialogYesToAllButton
SP_DirClosedIcon = QtWidgets.QStyle.SP_DirClosedIcon
SP_DirHomeIcon = QtWidgets.QStyle.SP_DirHomeIcon
SP_DirIcon = QtWidgets.QStyle.SP_DirIcon
SP_DirLinkIcon = QtWidgets.QStyle.SP_DirLinkIcon
SP_DirLinkOpenIcon = QtWidgets.QStyle.SP_DirLinkOpenIcon
SP_DirOpenIcon = QtWidgets.QStyle.SP_DirOpenIcon
SP_DockWidgetCloseButton = QtWidgets.QStyle.SP_DockWidgetCloseButton
SP_DriveCDIcon = QtWidgets.QStyle.SP_DriveCDIcon
SP_DriveDVDIcon = QtWidgets.QStyle.SP_DriveDVDIcon
SP_DriveFDIcon = QtWidgets.QStyle.SP_DriveFDIcon
SP_DriveHDIcon = QtWidgets.QStyle.SP_DriveHDIcon
SP_DriveNetIcon = QtWidgets.QStyle.SP_DriveNetIcon
SP_FileDialogBack = QtWidgets.QStyle.SP_FileDialogBack
SP_FileDialogContentsView = QtWidgets.QStyle.SP_FileDialogContentsView
SP_FileDialogDetailedView = QtWidgets.QStyle.SP_FileDialogDetailedView
SP_FileDialogEnd = QtWidgets.QStyle.SP_FileDialogEnd
SP_FileDialogInfoView = QtWidgets.QStyle.SP_FileDialogInfoView
SP_FileDialogListView = QtWidgets.QStyle.SP_FileDialogListView
SP_FileDialogNewFolder = QtWidgets.QStyle.SP_FileDialogNewFolder
SP_FileDialogStart = QtWidgets.QStyle.SP_FileDialogStart
SP_FileDialogToParent = QtWidgets.QStyle.SP_FileDialogToParent
SP_FileIcon = QtWidgets.QStyle.SP_FileIcon
SP_FileLinkIcon = QtWidgets.QStyle.SP_FileLinkIcon
SP_LineEditClearButton = QtWidgets.QStyle.SP_LineEditClearButton
SP_MediaPause = QtWidgets.QStyle.SP_MediaPause
SP_MediaPlay = QtWidgets.QStyle.SP_MediaPlay
SP_MediaSeekBackward = QtWidgets.QStyle.SP_MediaSeekBackward
SP_MediaSeekForward = QtWidgets.QStyle.SP_MediaSeekForward
SP_MediaSkipBackward = QtWidgets.QStyle.SP_MediaSkipBackward
SP_MediaSkipForward = QtWidgets.QStyle.SP_MediaSkipForward
SP_MediaStop = QtWidgets.QStyle.SP_MediaStop
SP_MediaVolume = QtWidgets.QStyle.SP_MediaVolume
SP_MediaVolumeMuted = QtWidgets.QStyle.SP_MediaVolumeMuted
SP_MessageBoxCritical = QtWidgets.QStyle.SP_MessageBoxCritical
SP_MessageBoxInformation = QtWidgets.QStyle.SP_MessageBoxInformation
SP_MessageBoxQuestion = QtWidgets.QStyle.SP_MessageBoxQuestion
SP_MessageBoxWarning = QtWidgets.QStyle.SP_MessageBoxWarning
SP_RestoreDefaultsButton = QtWidgets.QStyle.SP_RestoreDefaultsButton
SP_TabCloseButton = QtWidgets.QStyle.SP_TabCloseButton
SP_TitleBarCloseButton = QtWidgets.QStyle.SP_TitleBarCloseButton
SP_TitleBarContextHelpButton = QtWidgets.QStyle.SP_TitleBarContextHelpButton
SP_TitleBarMaxButton = QtWidgets.QStyle.SP_TitleBarMaxButton
SP_TitleBarMenuButton = QtWidgets.QStyle.SP_TitleBarMenuButton
SP_TitleBarMinButton = QtWidgets.QStyle.SP_TitleBarMinButton
SP_TitleBarNormalButton = QtWidgets.QStyle.SP_TitleBarNormalButton
SP_TitleBarShadeButton = QtWidgets.QStyle.SP_TitleBarShadeButton
SP_TitleBarUnshadeButton = QtWidgets.QStyle.SP_TitleBarUnshadeButton
SP_ToolBarHorizontalExtensionButton = QtWidgets.QStyle.SP_ToolBarHorizontalExtensionButton
SP_ToolBarVerticalExtensionButton = QtWidgets.QStyle.SP_ToolBarVerticalExtensionButton
SP_TrashIcon = QtWidgets.QStyle.SP_TrashIcon
SP_VistaShield = QtWidgets.QStyle.SP_VistaShield
# Need to fix an issue on Wayland on Linux: # Need to fix an issue on Wayland on Linux:
# conda-forge does not support Wayland, for who knows what reason. # conda-forge does not support Wayland, for who knows what reason.
@ -402,10 +561,7 @@ def test_menu(widget, window, font, width, *_):
action3 = QAction('&Action 6', window) action3 = QAction('&Action 6', window)
action3.setCheckable(True) action3.setCheckable(True)
menu.addAction(action3) menu.addAction(action3)
icon_url = f'{style_prefix}close.svg' icon = menu.style().standardIcon(SP_DockWidgetCloseButton)
if args.stylesheet == 'native':
icon_url = None
icon = QtGui.QIcon(icon_url)
menu.addAction(QAction(icon, '&Action 7', window)) menu.addAction(QAction(icon, '&Action 7', window))
menu.addAction(QAction(icon, '&Action 8', window)) menu.addAction(QAction(icon, '&Action 8', window))
submenu.addAction(QAction(icon, '&Action 9', window)) submenu.addAction(QAction(icon, '&Action 9', window))
@ -567,7 +723,7 @@ def test_list(widget, *_):
item = QtWidgets.QListWidgetItem(f'Item {index + 1}') item = QtWidgets.QListWidgetItem(f'Item {index + 1}')
item.setTextAlignment(random.choice(alignments)) item.setTextAlignment(random.choice(alignments))
child.addItem(item) child.addItem(item)
icon = QtGui.QIcon(':/dark/close.svg') icon = menu.style().standardIcon(SP_DockWidgetCloseButton)
for index in range(10): for index in range(10):
item = QtWidgets.QListWidgetItem(icon, f'Item {index + 1}') item = QtWidgets.QListWidgetItem(icon, f'Item {index + 1}')
item.setTextAlignment(random.choice(alignments)) item.setTextAlignment(random.choice(alignments))
@ -601,7 +757,7 @@ def test_toolbar(_, window, *__):
toolbar1.addSeparator() toolbar1.addSeparator()
toolbar1.addAction('&Action 3') toolbar1.addAction('&Action 3')
toolbar1.addAction('&Action 3 Really Long Name') toolbar1.addAction('&Action 3 Really Long Name')
icon = QtGui.QIcon(':/dark/close.svg') icon = menu.style().standardIcon(SP_DockWidgetCloseButton)
toolbar1.addAction(icon, '&Action 4') toolbar1.addAction(icon, '&Action 4')
window.addToolBar(TopToolBarArea, toolbar1) window.addToolBar(TopToolBarArea, toolbar1)
@ -612,7 +768,7 @@ def test_toolbar(_, window, *__):
toolbar2.addSeparator() toolbar2.addSeparator()
toolbar2.addAction('&Action 3') toolbar2.addAction('&Action 3')
toolbar2.addAction('&Action 3 Really Long Name') toolbar2.addAction('&Action 3 Really Long Name')
icon = QtGui.QIcon(':/dark/close.svg') icon = menu.style().standardIcon(SP_DockWidgetCloseButton)
toolbar2.addAction(icon, '&Action 4') toolbar2.addAction(icon, '&Action 4')
window.addToolBar(LeftToolBarArea, toolbar2) window.addToolBar(LeftToolBarArea, toolbar2)
@ -660,7 +816,7 @@ def test_toolbutton(widget, window, *_):
child[5].setArrowType(RightArrow) child[5].setArrowType(RightArrow)
child[6].setArrowType(UpArrow) child[6].setArrowType(UpArrow)
child[7].setArrowType(DownArrow) child[7].setArrowType(DownArrow)
icon = QtGui.QIcon(':/dark/close.svg') icon = menu.style().standardIcon(SP_DockWidgetCloseButton)
child[8].setIcon(icon) child[8].setIcon(icon)
return child, layout_type return child, layout_type
@ -672,7 +828,7 @@ def test_pushbutton(widget, *_):
child.append(abstract_button(widget_type, widget, 'Button 1', checked=True)) child.append(abstract_button(widget_type, widget, 'Button 1', checked=True))
child.append(abstract_button(widget_type, widget, 'Button 2', enabled=False)) child.append(abstract_button(widget_type, widget, 'Button 2', enabled=False))
child.append(abstract_button(widget_type, widget, 'Button 3', checkable=False)) child.append(abstract_button(widget_type, widget, 'Button 3', checkable=False))
icon = QtGui.QIcon(':/dark/close.svg') icon = menu.style().standardIcon(SP_DockWidgetCloseButton)
child.append(abstract_button(widget_type, widget, icon, 'Button 4', checkable=False)) child.append(abstract_button(widget_type, widget, icon, 'Button 4', checkable=False))
return child, layout_type return child, layout_type
@ -923,7 +1079,7 @@ def test_disabled_menu(widget, window, font, width, *_):
action3 = QAction('&Action 6', window) action3 = QAction('&Action 6', window)
action3.setCheckable(True) action3.setCheckable(True)
menu.addAction(action3) menu.addAction(action3)
icon = QtGui.QIcon(':/dark/close.svg') icon = menu.style().standardIcon(SP_DockWidgetCloseButton)
menu.addAction(QAction(icon, '&Action 7', window)) menu.addAction(QAction(icon, '&Action 7', window))
menu.addAction(QAction(icon, '&Action 8', window)) menu.addAction(QAction(icon, '&Action 8', window))
menu.actions()[2].setEnabled(False) menu.actions()[2].setEnabled(False)
@ -1055,6 +1211,14 @@ def test_issue25(widget, window, font, width, *_):
return None, None, False, True return None, None, False, True
def test_issue28(_, window, *__):
dialog = QtWidgets.QFileDialog(window)
dialog.setFileMode(Directory)
execute(dialog)
return None, None, False, True
def test(args, qtargv, test_widget): def test(args, qtargv, test_widget):
'''Test a single widget.''' '''Test a single widget.'''