Mac UI adjustments (#1415)

This commit is contained in:
Raivis Dejus 2026-03-08 00:27:52 +02:00 committed by GitHub
commit 36f2d41557
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 28 additions and 8 deletions

View file

@ -176,9 +176,7 @@ msgstr "Eksportēt mapē"
#: buzz/widgets/preferences_dialog/general_preferences_widget.py
msgid "Live recording mode"
msgstr ""
"Dzīvā ieraksta\n"
"režīms"
msgstr "Dzīvā ieraksta režīms"
#: buzz/widgets/preferences_dialog/general_preferences_widget.py
msgid ""
@ -458,9 +456,7 @@ msgstr "Klusuma slieksnis:"
#: buzz/widgets/transcriber/advanced_settings_dialog.py
msgid "Live recording mode:"
msgstr ""
"Dzīvā ieraksta\n"
"režīms:"
msgstr "Dzīvā ieraksta režīms:"
#: buzz/widgets/transcriber/advanced_settings_dialog.py
msgid "Line separator:"

View file

@ -1,3 +1,4 @@
import platform
import webbrowser
from typing import Optional
@ -48,9 +49,11 @@ class MenuBar(QMenuBar):
about_label = _("About")
about_action = QAction(f'{about_label} {APP_NAME}', self)
about_action.triggered.connect(self.on_about_action_triggered)
about_action.setMenuRole(QAction.MenuRole.AboutRole)
self.preferences_action = QAction(_("Preferences..."), self)
self.preferences_action.triggered.connect(self.on_preferences_action_triggered)
self.preferences_action.setMenuRole(QAction.MenuRole.PreferencesRole)
help_label = _("Help")
help_action = QAction(f'{help_label}', self)
@ -63,7 +66,8 @@ class MenuBar(QMenuBar):
file_menu.addAction(self.import_url_action)
file_menu.addAction(self.import_folder_action)
help_menu = self.addMenu(_("Help"))
help_menu_title = _("Help") + ("\u200B" if platform.system() == "Darwin" else "")
help_menu = self.addMenu(help_menu_title)
help_menu.addAction(about_action)
help_menu.addAction(help_action)
help_menu.addAction(self.preferences_action)

View file

@ -7,6 +7,7 @@ from PyQt6.QtWidgets import QWidget, QFormLayout, QPushButton
from buzz.locale import _
from buzz.settings.shortcut import Shortcut
from buzz.settings.shortcuts import Shortcuts
from buzz.widgets.line_edit import LineEdit
from buzz.widgets.sequence_edit import SequenceEdit
@ -19,8 +20,10 @@ class ShortcutsEditorPreferencesWidget(QWidget):
self.shortcuts = shortcuts
self.layout = QFormLayout(self)
_field_height = LineEdit().sizeHint().height()
for shortcut in Shortcut:
sequence_edit = SequenceEdit(shortcuts.get(shortcut), self)
sequence_edit.setFixedHeight(_field_height)
sequence_edit.keySequenceChanged.connect(
self.get_key_sequence_changed(shortcut)
)

View file

@ -45,6 +45,7 @@ class AdvancedSettingsDialog(QDialog):
self.setMinimumWidth(800)
layout = QFormLayout(self)
layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
transcription_settings_title= _("Speech recognition settings")
transcription_settings_title_label = QLabel(f"<h4>{transcription_settings_title}</h4>", self)
@ -102,6 +103,7 @@ class AdvancedSettingsDialog(QDialog):
self.silence_threshold_spin_box.setDecimals(4)
self.silence_threshold_spin_box.setValue(transcription_options.silence_threshold)
self.silence_threshold_spin_box.valueChanged.connect(self.on_silence_threshold_changed)
self.silence_threshold_spin_box.setFixedWidth(70)
layout.addRow(_("Silence threshold:"), self.silence_threshold_spin_box)
# Live recording mode
@ -112,7 +114,8 @@ class AdvancedSettingsDialog(QDialog):
self.settings.value(Settings.Key.RECORDING_TRANSCRIBER_MODE, 0)
)
self.recording_mode_combo.currentIndexChanged.connect(self.on_recording_mode_changed)
layout.addRow(_("Live recording mode:"), self.recording_mode_combo)
self.recording_mode_combo.setFixedWidth(200)
layout.addRow(_("Live recording mode") + ":", self.recording_mode_combo)
self.line_separator_line_edit = QLineEdit(self)
line_sep_display = repr(transcription_options.line_separator)[1:-1] or r"\n\n"
@ -127,6 +130,7 @@ class AdvancedSettingsDialog(QDialog):
self.transcription_step_spin_box.setDecimals(1)
self.transcription_step_spin_box.setValue(transcription_options.transcription_step)
self.transcription_step_spin_box.valueChanged.connect(self.on_transcription_step_changed)
self.transcription_step_spin_box.setFixedWidth(80)
self.transcription_step_label = QLabel(_("Transcription step:"))
layout.addRow(self.transcription_step_label, self.transcription_step_spin_box)
@ -192,6 +196,7 @@ class AdvancedSettingsDialog(QDialog):
self.export_file_type_combo.setCurrentIndex(type_index)
self.export_file_type_combo.setEnabled(self._export_enabled)
self.export_file_type_combo.currentIndexChanged.connect(self.on_export_file_type_changed)
self.export_file_type_combo.setFixedWidth(200)
self.export_file_type_label = QLabel(_("Export file type:"))
self.export_file_type_label.setEnabled(self._export_enabled)
layout.addRow(self.export_file_type_label, self.export_file_type_combo)
@ -205,10 +210,22 @@ class AdvancedSettingsDialog(QDialog):
self.export_max_entries_spin.setValue(max_entries)
self.export_max_entries_spin.setEnabled(self._export_enabled)
self.export_max_entries_spin.valueChanged.connect(self.on_export_max_entries_changed)
self.export_max_entries_spin.setFixedWidth(70)
self.export_max_entries_label = QLabel(_("Limit export entries\n(0 = export all):"))
self.export_max_entries_label.setEnabled(self._export_enabled)
layout.addRow(self.export_max_entries_label, self.export_max_entries_spin)
_field_height = self.llm_model_line_edit.sizeHint().height()
for widget in (
self.line_separator_line_edit,
self.silence_threshold_spin_box,
self.recording_mode_combo,
self.transcription_step_spin_box,
self.export_file_type_combo,
self.export_max_entries_spin,
):
widget.setFixedHeight(_field_height)
button_box = QDialogButtonBox(
QDialogButtonBox.StandardButton(QDialogButtonBox.StandardButton.Ok), self
)