diff --git a/Themes/Classic/AutoTranslate.png b/Themes/Classic/AutoTranslate.png new file mode 100644 index 00000000000..0c4e67c3ceb Binary files /dev/null and b/Themes/Classic/AutoTranslate.png differ diff --git a/Themes/Classic/PointSync.png b/Themes/Classic/PointSync.png new file mode 100644 index 00000000000..ce54e54d3e3 Binary files /dev/null and b/Themes/Classic/PointSync.png differ diff --git a/Themes/Classic/RemoveTextForHI.png b/Themes/Classic/RemoveTextForHi.png similarity index 100% rename from Themes/Classic/RemoveTextForHI.png rename to Themes/Classic/RemoveTextForHi.png diff --git a/Themes/Classic/SpeechToText.png b/Themes/Classic/SpeechToText.png new file mode 100644 index 00000000000..5072938139b Binary files /dev/null and b/Themes/Classic/SpeechToText.png differ diff --git a/Themes/Dark/AutoTranslate.png b/Themes/Dark/AutoTranslate.png new file mode 100644 index 00000000000..80816fbab7d Binary files /dev/null and b/Themes/Dark/AutoTranslate.png differ diff --git a/Themes/Dark/PointSync.png b/Themes/Dark/PointSync.png new file mode 100644 index 00000000000..e201eaa261f Binary files /dev/null and b/Themes/Dark/PointSync.png differ diff --git a/Themes/Dark/SpeechToText.png b/Themes/Dark/SpeechToText.png new file mode 100644 index 00000000000..c9ba4467548 Binary files /dev/null and b/Themes/Dark/SpeechToText.png differ diff --git a/Themes/Light/AutoTranslate.png b/Themes/Light/AutoTranslate.png new file mode 100644 index 00000000000..fcaa45f5caf Binary files /dev/null and b/Themes/Light/AutoTranslate.png differ diff --git a/Themes/Light/PointSync.png b/Themes/Light/PointSync.png new file mode 100644 index 00000000000..347846d3ddc Binary files /dev/null and b/Themes/Light/PointSync.png differ diff --git a/Themes/Light/SpeechToText.png b/Themes/Light/SpeechToText.png new file mode 100644 index 00000000000..fc350a43cdc Binary files /dev/null and b/Themes/Light/SpeechToText.png differ diff --git a/src/ui/Assets/Themes.zip b/src/ui/Assets/Themes.zip index ff61189545a..8a93f90a044 100644 Binary files a/src/ui/Assets/Themes.zip and b/src/ui/Assets/Themes.zip differ diff --git a/src/ui/Features/Main/Layout/InitToolbar.cs b/src/ui/Features/Main/Layout/InitToolbar.cs index c3495cde986..6cf4a663452 100644 --- a/src/ui/Features/Main/Layout/InitToolbar.cs +++ b/src/ui/Features/Main/Layout/InitToolbar.cs @@ -250,6 +250,32 @@ private static Grid CreateToolbar(MainViewModel vm) isLastSeparator = false; } + if (appearance.ToolbarShowAutoTranslate) + { + stackPanelLeft.Children.Add(new Button + { + Content = MakeImage("AutoTranslate"), + Command = vm.ShowAutoTranslateCommand, + Background = Brushes.Transparent, + [AutomationProperties.NameProperty] = languageHints.AutoTranslateHint, + [ToolTip.TipProperty] = UiUtil.MakeToolTip(languageHints.AutoTranslateHint, shortcuts, nameof(vm.ShowAutoTranslateCommand)), + }); + isLastSeparator = false; + } + + if (appearance.ToolbarShowSpeechToText) + { + stackPanelLeft.Children.Add(new Button + { + Content = MakeImage("SpeechToText"), + Command = vm.ShowSpeechToTextWhisperCommand, + Background = Brushes.Transparent, + [AutomationProperties.NameProperty] = languageHints.SpeechToTextHint, + [ToolTip.TipProperty] = UiUtil.MakeToolTip(languageHints.SpeechToTextHint, shortcuts, nameof(vm.ShowSpeechToTextWhisperCommand)), + }); + isLastSeparator = false; + } + if (appearance.ToolbarShowSettings) { diff --git a/src/ui/Features/Options/Settings/SettingsPage.cs b/src/ui/Features/Options/Settings/SettingsPage.cs index 5e2aa304250..7fd908ec8d4 100644 --- a/src/ui/Features/Options/Settings/SettingsPage.cs +++ b/src/ui/Features/Options/Settings/SettingsPage.cs @@ -766,6 +766,8 @@ private List CreateSections() MakeCheckboxSetting(Se.Language.Options.Settings.ShowToolbarPointSync, nameof(_vm.ShowToolbarPointSync)), MakeCheckboxSetting(Se.Language.Options.Settings.ShowToolbarBeautifyTimeCodes, nameof(_vm.ShowToolbarBeautifyTimeCodes)), MakeCheckboxSetting(Se.Language.Options.Settings.ShowToolbarBurnIn, nameof(_vm.ShowToolbarBurnIn)), + MakeCheckboxSetting(Se.Language.Options.Settings.ShowToolbarAutoTranslate, nameof(_vm.ShowToolbarAutoTranslate)), + MakeCheckboxSetting(Se.Language.Options.Settings.ShowToolbarSpeechToText, nameof(_vm.ShowToolbarSpeechToText)), MakeCheckboxSetting(Se.Language.Options.Settings.ShowToolbarSettings, nameof(_vm.ShowToolbarSettings)), MakeCheckboxSetting(Se.Language.Options.Settings.ShowToolbarLayout, nameof(_vm.ShowToolbarLayout)), MakeCheckboxSetting(Se.Language.Options.Shortcuts.SourceView, nameof(_vm.ShowToolbarSourceView)), diff --git a/src/ui/Features/Options/Settings/SettingsViewModel.cs b/src/ui/Features/Options/Settings/SettingsViewModel.cs index 6588e1f332d..86658f4aee7 100644 --- a/src/ui/Features/Options/Settings/SettingsViewModel.cs +++ b/src/ui/Features/Options/Settings/SettingsViewModel.cs @@ -207,6 +207,8 @@ partial void OnMaxLinesChanged(int? value) [ObservableProperty] private bool _showToolbarPointSync; [ObservableProperty] private bool _showToolbarBeautifyTimeCodes; [ObservableProperty] private bool _showToolbarBurnIn; + [ObservableProperty] private bool _showToolbarAutoTranslate; + [ObservableProperty] private bool _showToolbarSpeechToText; [ObservableProperty] private bool _fixCommonErrorsSkipStep1; [ObservableProperty] private bool _showToolbarSettings; [ObservableProperty] private bool _showToolbarLayout; @@ -825,6 +827,8 @@ private void LoadSettings() ShowToolbarPointSync = appearance.ToolbarShowPointSync; ShowToolbarBeautifyTimeCodes = appearance.ToolbarShowBeautifyTimeCodes; ShowToolbarBurnIn = appearance.ToolbarShowBurnIn; + ShowToolbarAutoTranslate = appearance.ToolbarShowAutoTranslate; + ShowToolbarSpeechToText = appearance.ToolbarShowSpeechToText; ShowToolbarSettings = appearance.ToolbarShowSettings; ShowToolbarLayout = appearance.ToolbarShowLayout; ShowToolbarSourceView = appearance.ToolbarShowSourceView; @@ -1644,6 +1648,8 @@ private void SaveSettings() appearance.ToolbarShowPointSync = ShowToolbarPointSync; appearance.ToolbarShowBeautifyTimeCodes = ShowToolbarBeautifyTimeCodes; appearance.ToolbarShowBurnIn = ShowToolbarBurnIn; + appearance.ToolbarShowAutoTranslate = ShowToolbarAutoTranslate; + appearance.ToolbarShowSpeechToText = ShowToolbarSpeechToText; appearance.ToolbarShowSettings = ShowToolbarSettings; appearance.ToolbarShowLayout = ShowToolbarLayout; appearance.ToolbarShowSourceView = ShowToolbarSourceView; diff --git a/src/ui/Logic/Config/Language/Main/LanguageMainToolbar.cs b/src/ui/Logic/Config/Language/Main/LanguageMainToolbar.cs index e51ccb8a005..e5fe4695627 100644 --- a/src/ui/Logic/Config/Language/Main/LanguageMainToolbar.cs +++ b/src/ui/Logic/Config/Language/Main/LanguageMainToolbar.cs @@ -16,6 +16,8 @@ public class LanguageMainToolbar public string PointSyncHint { get; set; } public string BeautifyTimeCodesHint { get; set; } public string BurnInHint { get; set; } + public string AutoTranslateHint { get; set; } + public string SpeechToTextHint { get; set; } public string SettingsHint { get; set; } public string LayoutHint { get; set; } public string HelpHint { get; set; } @@ -46,6 +48,8 @@ public LanguageMainToolbar() PointSyncHint = "Point sync via another subtitle {0}"; BeautifyTimeCodesHint = "Beautify time codes {0}"; BurnInHint = "Burn subtitles into a video file {0}"; + AutoTranslateHint = "Auto-translate {0}"; + SpeechToTextHint = "Speech to text {0}"; SettingsHint = "Adjust program settings and preferences {0}"; LayoutHint = "Change toolbar and panel layout {0}"; HelpHint = "Open help website {0}"; diff --git a/src/ui/Logic/Config/Language/Options/LanguageSettings.cs b/src/ui/Logic/Config/Language/Options/LanguageSettings.cs index 694d9d6df37..08d446a7fe1 100644 --- a/src/ui/Logic/Config/Language/Options/LanguageSettings.cs +++ b/src/ui/Logic/Config/Language/Options/LanguageSettings.cs @@ -190,6 +190,8 @@ public class LanguageSettings public string ShowToolbarPointSync { get; set; } public string ShowToolbarBeautifyTimeCodes { get; set; } public string ShowToolbarBurnIn { get; set; } + public string ShowToolbarAutoTranslate { get; set; } + public string ShowToolbarSpeechToText { get; set; } public string ShowToolbarSettings { get; set; } public string ShowToolbarLayout { get; set; } public string ShowToolbarHelp { get; set; } @@ -539,6 +541,8 @@ public LanguageSettings() ShowToolbarPointSync = "Show point sync icon"; ShowToolbarBeautifyTimeCodes = "Show beautify time codes icon"; ShowToolbarBurnIn = "Show burn-in icon"; + ShowToolbarAutoTranslate = "Show auto-translate icon"; + ShowToolbarSpeechToText = "Show speech to text icon"; ShowToolbarSettings = "Show settings icon"; ShowToolbarLayout = "Show layout icon"; ShowToolbarHelp = "Show help icon"; diff --git a/src/ui/Logic/Config/SeAppearance.cs b/src/ui/Logic/Config/SeAppearance.cs index 162f611f74c..f1e098a7b66 100644 --- a/src/ui/Logic/Config/SeAppearance.cs +++ b/src/ui/Logic/Config/SeAppearance.cs @@ -62,6 +62,8 @@ public class SeAppearance public bool ToolbarShowPointSync { get; set; } public bool ToolbarShowBeautifyTimeCodes { get; set; } public bool ToolbarShowBurnIn { get; set; } + public bool ToolbarShowAutoTranslate { get; set; } + public bool ToolbarShowSpeechToText { get; set; } public bool ToolbarShowSettings { get; set; } public bool ToolbarShowLayout { get; set; } public bool ToolbarShowSourceView { get; set; } @@ -136,6 +138,8 @@ public SeAppearance() ToolbarShowPointSync = false; ToolbarShowBeautifyTimeCodes = false; ToolbarShowBurnIn = false; + ToolbarShowAutoTranslate = false; + ToolbarShowSpeechToText = false; ToolbarShowSettings = true; ToolbarShowLayout = true; ToolbarShowSourceView = false;