Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added Themes/Classic/AutoTranslate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Classic/PointSync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Classic/SpeechToText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Dark/AutoTranslate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Dark/PointSync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Dark/SpeechToText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Light/AutoTranslate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Light/PointSync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Themes/Light/SpeechToText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/ui/Assets/Themes.zip
Binary file not shown.
26 changes: 26 additions & 0 deletions src/ui/Features/Main/Layout/InitToolbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions src/ui/Features/Options/Settings/SettingsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ private List<SettingsSection> 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)),
Expand Down
6 changes: 6 additions & 0 deletions src/ui/Features/Options/Settings/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/ui/Logic/Config/Language/Main/LanguageMainToolbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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}";
Expand Down
4 changes: 4 additions & 0 deletions src/ui/Logic/Config/Language/Options/LanguageSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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";
Expand Down
4 changes: 4 additions & 0 deletions src/ui/Logic/Config/SeAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -136,6 +138,8 @@ public SeAppearance()
ToolbarShowPointSync = false;
ToolbarShowBeautifyTimeCodes = false;
ToolbarShowBurnIn = false;
ToolbarShowAutoTranslate = false;
ToolbarShowSpeechToText = false;
ToolbarShowSettings = true;
ToolbarShowLayout = true;
ToolbarShowSourceView = false;
Expand Down