Skip to content

fix: better align access keys with the guidelines #843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0f40638
Add menu mnemonics
smileyhead Mar 7, 2025
0fd6093
Add library.field.add.button, and finalise access keys
smileyhead Mar 7, 2025
a9b9c32
Add library.field.add.button to the preview panel
smileyhead Mar 7, 2025
e1a9587
Add buddy to Language label in Settings window
smileyhead Mar 8, 2025
e2da261
Add mnemonics to the Open Recent menu
smileyhead Mar 8, 2025
4e61a7e
Add mnemonics to the Add Tags window
smileyhead Mar 8, 2025
055c23b
Add mnemonics to New Tag window
smileyhead Mar 8, 2025
ec92802
Add mnemonics to File Extensions window
smileyhead Mar 8, 2025
f2bebe0
Resolve mnemonics conflict with Add Tag string
smileyhead Mar 8, 2025
598cd44
Label the main window drop-downs
smileyhead Mar 8, 2025
f984484
Merge branch 'main' of https://github.com/smileyhead/TagStudio-mnemonics
smileyhead Mar 10, 2025
8555cce
Remove unnecessary semicolon from settings_panel.py (again)
smileyhead Mar 10, 2025
86532c1
Remove unneeded `_alt` strings
smileyhead Mar 10, 2025
7816f58
Merge branch 'main' into main
CyanVoxel Mar 11, 2025
094fd66
Modify non-English language files
smileyhead Mar 20, 2025
cfe8112
Merge branch 'main' of https://github.com/smileyhead/TagStudio-mnemonics
smileyhead Mar 20, 2025
b514ec5
Merge branch 'main' into main
smileyhead Mar 20, 2025
aeb192c
Fix unterminated f-string
smileyhead Mar 20, 2025
7175116
Fix remaining unnecessary keys
smileyhead Mar 20, 2025
cc7fdbf
Fix remaining unnecessary keys (for real this time)
smileyhead Mar 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/tagstudio/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
QStatusBar,
QVBoxLayout,
QWidget,
QLabel,
)

from tagstudio.qt.pagination import Pagination
Expand Down Expand Up @@ -76,15 +77,22 @@ def setupUi(self, MainWindow):
self.horizontalLayout_3.addItem(spacerItem)

# Sorting Dropdowns
self.sorting_mode_label = QLabel(Translations["home.sorting_mode"])
self.sorting_mode_combobox = QComboBox(self.centralwidget)
self.sorting_mode_combobox.setObjectName(u"sortingModeComboBox")
self.horizontalLayout_3.addWidget(self.sorting_mode_label)
self.horizontalLayout_3.addWidget(self.sorting_mode_combobox)
self.sorting_mode_label.setBuddy(self.sorting_mode_combobox)

self.sorting_direction_label = QLabel(Translations["home.sorting_direction"])
self.sorting_direction_combobox = QComboBox(self.centralwidget)
self.sorting_direction_combobox.setObjectName(u"sortingDirectionCombobox")
self.horizontalLayout_3.addWidget(self.sorting_direction_label)
self.horizontalLayout_3.addWidget(self.sorting_direction_combobox)
self.sorting_direction_label.setBuddy(self.sorting_direction_combobox)

# Thumbnail Size placeholder
self.thumb_size_label = QLabel(Translations["home.thumbnail_size_label"])
self.thumb_size_combobox = QComboBox(self.centralwidget)
self.thumb_size_combobox.setObjectName(u"thumbSizeComboBox")
self.thumb_size_combobox.setPlaceholderText(Translations["home.thumbnail_size"])
Expand All @@ -97,7 +105,9 @@ def setupUi(self, MainWindow):
self.thumb_size_combobox.setSizePolicy(sizePolicy)
self.thumb_size_combobox.setMinimumWidth(128)
self.thumb_size_combobox.setMaximumWidth(352)
self.horizontalLayout_3.addWidget(self.thumb_size_label)
self.horizontalLayout_3.addWidget(self.thumb_size_combobox)
self.thumb_size_label.setBuddy(self.thumb_size_combobox)
self.gridLayout.addLayout(self.horizontalLayout_3, 5, 0, 1, 1)

self.splitter = QSplitter()
Expand Down
10 changes: 8 additions & 2 deletions src/tagstudio/qt/modals/build_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:
self.name_title = QLabel(Translations["tag.name"])
self.name_layout.addWidget(self.name_title)
self.name_field = QLineEdit()
self.name_title.setBuddy(self.name_field)
self.name_field.setFixedHeight(24)
self.name_field.textChanged.connect(self.on_name_changed)
self.name_field.setPlaceholderText(Translations["tag.tag_name_required"])
Expand All @@ -106,6 +107,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:
self.shorthand_title = QLabel(Translations["tag.shorthand"])
self.shorthand_layout.addWidget(self.shorthand_title)
self.shorthand_field = QLineEdit()
self.shorthand_title.setBuddy(self.shorthand_field)
self.shorthand_layout.addWidget(self.shorthand_field)

# Aliases --------------------------------------------------------------
Expand All @@ -119,6 +121,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:
self.aliases_layout.addWidget(self.aliases_title)

self.aliases_table = QTableWidget(0, 2)
self.aliases_title.setBuddy(self.aliases_table)
self.aliases_table.horizontalHeader().setVisible(False)
self.aliases_table.verticalHeader().setVisible(False)
self.aliases_table.horizontalHeader().setStretchLastSection(True)
Expand All @@ -127,7 +130,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:
self.aliases_table.setFocusPolicy(Qt.FocusPolicy.NoFocus)

self.aliases_add_button = QPushButton()
self.aliases_add_button.setText("+")
self.aliases_add_button.setText(Translations["tag.alias.new"])
self.aliases_add_button.clicked.connect(self.add_alias_callback)

# Parent Tags ----------------------------------------------------------
Expand All @@ -146,6 +149,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:

self.scroll_contents = QWidget()
self.parent_tags_scroll_layout = QVBoxLayout(self.scroll_contents)
self.parent_tags_title.setBuddy(self.scroll_contents)
self.parent_tags_scroll_layout.setContentsMargins(6, 6, 6, 0)
self.parent_tags_scroll_layout.setAlignment(Qt.AlignmentFlag.AlignTop)

Expand All @@ -159,7 +163,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:

self.parent_tags_add_button = QPushButton()
self.parent_tags_add_button.setCursor(Qt.CursorShape.PointingHandCursor)
self.parent_tags_add_button.setText("+")
self.parent_tags_add_button.setText(Translations["tag.parent_tags.add.button"])
self.parent_tags_layout.addWidget(self.parent_tags_add_button)

exclude_ids: list[int] = list()
Expand Down Expand Up @@ -201,6 +205,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:
)
self.color_button.button.clicked.connect(self.choose_color_modal.show)
self.color_layout.addWidget(self.color_button)
self.color_title.setBuddy(self.color_button)

# Category -------------------------------------------------------------
self.cat_widget = QWidget()
Expand All @@ -211,6 +216,7 @@ def __init__(self, library: Library, tag: Tag | None = None) -> None:
self.cat_layout.setAlignment(Qt.AlignmentFlag.AlignLeft)
self.cat_title = QLabel(Translations["tag.is_category"])
self.cat_checkbox = QCheckBox()
self.cat_title.setBuddy(self.cat_checkbox)
self.cat_checkbox.setFixedSize(22, 22)

primary_color = QColor(get_tag_color(ColorType.PRIMARY, TagColorEnum.DEFAULT))
Expand Down
4 changes: 2 additions & 2 deletions src/tagstudio/qt/modals/delete_unlinked.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def __init__(self, driver: "QtDriver", tracker: MissingRegistry):
self.button_layout.setContentsMargins(6, 6, 6, 6)
self.button_layout.addStretch(1)

self.cancel_button = QPushButton(Translations["generic.cancel_alt"])
self.cancel_button = QPushButton(Translations["generic.cancel"])
self.cancel_button.setDefault(True)
self.cancel_button.clicked.connect(self.hide)
self.button_layout.addWidget(self.cancel_button)

self.delete_button = QPushButton(Translations["generic.delete_alt"])
self.delete_button = QPushButton(Translations["generic.delete"])
self.delete_button.clicked.connect(self.hide)
self.delete_button.clicked.connect(lambda: self.delete_entries())
self.button_layout.addWidget(self.delete_button)
Expand Down
4 changes: 2 additions & 2 deletions src/tagstudio/qt/modals/drop_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, driver: "QtDriver"):
self.skip_button.clicked.connect(lambda: self.begin_transfer(DuplicateChoice.SKIP))
self.button_layout.addWidget(self.skip_button)

self.overwrite_button = QPushButton(Translations["generic.overwrite_alt"])
self.overwrite_button = QPushButton(Translations["generic.overwrite"])
self.overwrite_button.clicked.connect(
lambda: self.begin_transfer(DuplicateChoice.OVERWRITE)
)
Expand All @@ -84,7 +84,7 @@ def __init__(self, driver: "QtDriver"):
self.rename_button.clicked.connect(lambda: self.begin_transfer(DuplicateChoice.RENAME))
self.button_layout.addWidget(self.rename_button)

self.cancel_button = QPushButton(Translations["generic.cancel_alt"])
self.cancel_button = QPushButton(Translations["generic.cancel"])
self.cancel_button.clicked.connect(lambda: self.begin_transfer(DuplicateChoice.CANCEL))
self.button_layout.addWidget(self.cancel_button)

Expand Down
1 change: 1 addition & 0 deletions src/tagstudio/qt/modals/file_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(self, library: "Library"):
self.mode_layout.setSpacing(12)
self.mode_label = QLabel(Translations["ignore_list.mode.label"])
self.mode_combobox = QComboBox()
self.mode_label.setBuddy(self.mode_combobox)
self.mode_combobox.setEditable(False)
self.mode_combobox.addItem("")
self.mode_combobox.addItem("")
Expand Down
2 changes: 1 addition & 1 deletion src/tagstudio/qt/modals/fix_dupes.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, library: "Library", driver: "QtDriver"):
self.button_layout.setContentsMargins(6, 6, 6, 6)
self.button_layout.addStretch(1)

self.done_button = QPushButton(Translations["generic.done_alt"])
self.done_button = QPushButton(Translations["generic.done"])
self.done_button.setDefault(True)
self.done_button.clicked.connect(self.hide)
self.button_layout.addWidget(self.done_button)
Expand Down
2 changes: 1 addition & 1 deletion src/tagstudio/qt/modals/fix_unlinked.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, library: "Library", driver: "QtDriver"):
self.button_layout.setContentsMargins(6, 6, 6, 6)
self.button_layout.addStretch(1)

self.done_button = QPushButton(Translations["generic.done_alt"])
self.done_button = QPushButton(Translations["generic.done"])
self.done_button.setDefault(True)
self.done_button.clicked.connect(self.hide)
self.button_layout.addWidget(self.done_button)
Expand Down
2 changes: 1 addition & 1 deletion src/tagstudio/qt/modals/folders_to_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def __init__(self, library: "Library", driver: "QtDriver"):
self.scroll_area.setFrameShape(QFrame.Shape.NoFrame)
self.scroll_area.setWidget(self.scroll_contents)

self.apply_button = QPushButton(Translations["generic.apply_alt"])
self.apply_button = QPushButton(Translations["generic.apply"])
self.apply_button.setMinimumWidth(100)
self.apply_button.clicked.connect(self.on_apply)

Expand Down
2 changes: 1 addition & 1 deletion src/tagstudio/qt/modals/mirror_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, driver: "QtDriver", tracker: DupeRegistry):
self.button_layout.setContentsMargins(6, 6, 6, 6)
self.button_layout.addStretch(1)

self.cancel_button = QPushButton(Translations["generic.cancel_alt"])
self.cancel_button = QPushButton(Translations["generic.cancel"])
self.cancel_button.setDefault(True)
self.cancel_button.clicked.connect(self.hide)
self.button_layout.addWidget(self.cancel_button)
Expand Down
1 change: 1 addition & 0 deletions src/tagstudio/qt/modals/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self, driver):
"Turkish": "tr",
}
self.language_combobox = QComboBox()
language_label.setBuddy(self.language_combobox)
self.language_combobox.addItems(list(self.languages.keys()))
current_lang: str = str(
driver.settings.value(SettingItems.LANGUAGE, defaultValue="en", type=str)
Expand Down
6 changes: 3 additions & 3 deletions src/tagstudio/qt/modals/tag_color_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(

self.button_layout.addStretch(1)

self.done_button = QPushButton(Translations["generic.done_alt"])
self.done_button = QPushButton(Translations["generic.done"])
self.done_button.clicked.connect(self.hide)
self.button_layout.addWidget(self.done_button)

Expand Down Expand Up @@ -195,10 +195,10 @@ def delete_namespace_dialog(self, prompt: str, callback: Callable) -> None:
message_box.setWindowTitle(Translations["color.namespace.delete.title"])
message_box.setIcon(QMessageBox.Icon.Warning)
cancel_button = message_box.addButton(
Translations["generic.cancel_alt"], QMessageBox.ButtonRole.RejectRole
Translations["generic.cancel"], QMessageBox.ButtonRole.RejectRole
)
message_box.addButton(
Translations["generic.delete_alt"], QMessageBox.ButtonRole.DestructiveRole
Translations["generic.delete"], QMessageBox.ButtonRole.DestructiveRole
)
message_box.setEscapeButton(cancel_button)
result = message_box.exec_()
Expand Down
1 change: 1 addition & 0 deletions src/tagstudio/qt/modals/tag_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def __init__(
self.limit_layout.addWidget(self.limit_title)

self.limit_combobox = QComboBox()
self.limit_title.setBuddy(self.limit_combobox)
self.limit_combobox.setEditable(False)
self.limit_combobox.addItems([str(x) for x in TagSearchPanel._limit_items])
self.limit_combobox.setCurrentIndex(TagSearchPanel._default_limit_idx)
Expand Down
8 changes: 4 additions & 4 deletions src/tagstudio/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def start(self) -> None:
menu_bar.setNativeMenuBar(True)

file_menu = QMenu(Translations["menu.file"], menu_bar)
edit_menu = QMenu(Translations["generic.edit_alt"], menu_bar)
edit_menu = QMenu(Translations["generic.edit"], menu_bar)
view_menu = QMenu(Translations["menu.view"], menu_bar)
tools_menu = QMenu(Translations["menu.tools"], menu_bar)
macros_menu = QMenu(Translations["menu.macros"], menu_bar)
Expand Down Expand Up @@ -1777,13 +1777,13 @@ def update_recent_lib_menu(self):
settings.endGroup()

# Create actions for each library
for library_key in libs_sorted:
for index, library_key in enumerate(libs_sorted):
path = Path(library_key[1][0])
action = QAction(self.open_recent_library_menu)
if filepath_option == ShowFilepathOption.SHOW_FULL_PATHS:
action.setText(str(path))
action.setText(f"&{index + 1}: {str(path)}")
else:
action.setText(str(Path(path).name))
action.setText(f"&{index + 1}: {str(Path(path).name)}")
action.triggered.connect(lambda checked=False, p=path: self.open_library(p))
actions.append(action)

Expand Down
4 changes: 2 additions & 2 deletions src/tagstudio/qt/widgets/color_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ def delete_color(self, color_group: TagColorGroup):
Translations.format("color.confirm_delete", color_name=color_group.name),
)
cancel_button = message_box.addButton(
Translations["generic.cancel_alt"], QMessageBox.ButtonRole.RejectRole
Translations["generic.cancel"], QMessageBox.ButtonRole.RejectRole
)
message_box.addButton(
Translations["generic.delete_alt"], QMessageBox.ButtonRole.DestructiveRole
Translations["generic.delete"], QMessageBox.ButtonRole.DestructiveRole
)
message_box.setEscapeButton(cancel_button)
result = message_box.exec_()
Expand Down
2 changes: 1 addition & 1 deletion src/tagstudio/qt/widgets/preview/field_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def remove_message_box(self, prompt: str, callback: Callable) -> None:
remove_mb.setWindowTitle("Remove Field")
remove_mb.setIcon(QMessageBox.Icon.Warning)
cancel_button = remove_mb.addButton(
Translations["generic.cancel_alt"], QMessageBox.ButtonRole.DestructiveRole
Translations["generic.cancel"], QMessageBox.ButtonRole.DestructiveRole
)
remove_mb.addButton("&Remove", QMessageBox.ButtonRole.RejectRole)
remove_mb.setEscapeButton(cancel_button)
Expand Down
4 changes: 2 additions & 2 deletions src/tagstudio/qt/widgets/preview_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def __init__(self, library: Library, driver: "QtDriver"):
add_buttons_layout.setContentsMargins(0, 0, 0, 0)
add_buttons_layout.setSpacing(6)

self.add_tag_button = QPushButton(Translations["tag.add"])
self.add_tag_button = QPushButton(Translations["tag.add.button"])
self.add_tag_button.setEnabled(False)
self.add_tag_button.setCursor(Qt.CursorShape.PointingHandCursor)
self.add_tag_button.setMinimumHeight(28)
self.add_tag_button.setStyleSheet(PreviewPanel.button_style)

self.add_field_button = QPushButton(Translations["library.field.add"])
self.add_field_button = QPushButton(Translations["library.field.add.button"])
self.add_field_button.setEnabled(False)
self.add_field_button.setCursor(Qt.CursorShape.PointingHandCursor)
self.add_field_button.setMinimumHeight(28)
Expand Down
18 changes: 9 additions & 9 deletions src/tagstudio/resources/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,30 +92,23 @@
"folders_to_tags.open_all": "Alle öffnen",
"folders_to_tags.title": "Aus Verzeichnissen Tags erstellen",
"generic.add": "Hinzufügen",
"generic.apply": "Anwenden",
"generic.apply_alt": "&Anwenden",
"generic.apply": "&Anwenden",
"generic.cancel": "Abbrechen",
"generic.cancel_alt": "Abbre&chen",
"generic.close": "Schließen",
"generic.continue": "Fortfahren",
"generic.copy": "Kopieren",
"generic.cut": "Ausschneiden",
"generic.delete": "Löschen",
"generic.delete_alt": "Löschen",
"generic.done": "Fertig",
"generic.done_alt": "Fertig",
"generic.edit": "Bearbeiten",
"generic.edit_alt": "B&earbeiten",
"generic.edit": "B&earbeiten",
"generic.filename": "Dateiname",
"generic.navigation.back": "Zurück",
"generic.navigation.next": "Weiter",
"generic.none": "Kein(e)",
"generic.overwrite": "Überschreibem",
"generic.overwrite_alt": "Überschreiben",
"generic.paste": "Einfügen",
"generic.recent_libraries": "Aktuelle Bibliotheken",
"generic.rename": "Umbenennen",
"generic.rename_alt": "Umbenennen",
"generic.reset": "Zurücksetzen",
"generic.save": "Speichern",
"generic.skip": "Überspringen",
Expand All @@ -125,11 +118,14 @@
"home.search_library": "Bibliothek durchsuchen",
"home.search_tags": "Tags suchen",
"home.thumbnail_size": "Größe des Vorschaubildes",
"home.sorting_mode": "",
"home.sorting_direction": "",
"home.thumbnail_size.extra_large": "Extra Große Vorschau",
"home.thumbnail_size.large": "Große Vorschau",
"home.thumbnail_size.medium": "Mittelgroße Vorschau",
"home.thumbnail_size.mini": "Mini Vorschau",
"home.thumbnail_size.small": "Kleine Vorschau",
"home.thumbnail_size_label": "",
"ignore_list.add_extension": "D&ateiendung hinzufügen",
"ignore_list.mode.exclude": "Ausschliessen",
"ignore_list.mode.include": "Einschließen",
Expand Down Expand Up @@ -164,6 +160,7 @@
"json_migration.title.old_lib": "<h2>v9.4 Bibliothek</h2>",
"landing.open_create_library": "Bibliothek öffnen/erstellen {shortcut}",
"library.field.add": "Feld hinzufügen",
"library.field.add.button": "",
"library.field.confirm_remove": "Wollen Sie dieses \"{name}\" Feld wirklich entfernen?",
"library.field.mixed_data": "Gemischte Daten",
"library.field.remove": "Feld entfernen",
Expand Down Expand Up @@ -250,7 +247,9 @@
"tag.add": "Tag hinzufügen",
"tag.add.plural": "Tags hinzufügen",
"tag.add_to_search": "Zur Suche hinzufügen",
"tag.add.button": "",
"tag.aliases": "Aliase",
"tag.alias.new": "",
"tag.all_tags": "Alle Tags",
"tag.choose_color": "Tag-Farbe auswählen",
"tag.color": "Farbe",
Expand All @@ -264,6 +263,7 @@
"tag.new": "Neuer Tag",
"tag.parent_tags": "Übergeordnete Tags",
"tag.parent_tags.add": "Übergeordnete Tags hinzufügen",
"tag.parent_tags.add.button": "",
"tag.parent_tags.description": "Dieser Tag kann bei der Suche als Ersatz für jeden dieser übergeordneten Tags verwendet werden.",
"tag.remove": "Tag entfernen",
"tag.search_for_tag": "Nach Tag suchen",
Expand Down
Loading