1
0

qt: add text to toolbar button

The toolbar button is very small and some users probably don't even
notice it. As we have lots of space in the toolbar anyways i think it
makes sense to add some text to it to make it more visible and easier to
click. Maybe this is also useful for screen readers.
This commit is contained in:
f321x
2025-10-22 16:01:59 +02:00
parent 8a53da93d5
commit c2068a4e4b

View File

@@ -110,7 +110,9 @@ class QMenuWithConfig(QMenu):
def create_toolbar_with_menu(config: 'SimpleConfig', title): def create_toolbar_with_menu(config: 'SimpleConfig', title):
menu = QMenuWithConfig(config) menu = QMenuWithConfig(config)
toolbar_button = QToolButton() toolbar_button = QToolButton()
toolbar_button.setText(_('Tools'))
toolbar_button.setIcon(read_QIcon("preferences.png")) toolbar_button.setIcon(read_QIcon("preferences.png"))
toolbar_button.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon)
toolbar_button.setMenu(menu) toolbar_button.setMenu(menu)
toolbar_button.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup) toolbar_button.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup)
toolbar_button.setFocusPolicy(Qt.FocusPolicy.NoFocus) toolbar_button.setFocusPolicy(Qt.FocusPolicy.NoFocus)