Skip to content

Commit

Permalink
Split "Settings & help" into menu item for each tab
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Jul 18, 2024
1 parent af7d96d commit ec20847
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions DesktopClock/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
<MenuItem Command="{Binding CopyToClipboardCommand}" Header="_Copy" />

<MenuItem Command="{Binding HideForNowCommand}" Header="_Hide for now" />

<MenuItem Command="{Binding OpenSettingsCommand}" Header="_Settings &amp; help" />

<Separator />

Expand Down Expand Up @@ -66,6 +64,16 @@

<Separator />

<MenuItem Command="{Binding OpenSettingsCommand}" CommandParameter="0" Header="_Format" />

<MenuItem Command="{Binding OpenSettingsCommand}" CommandParameter="1" Header="_Appearance" />

<MenuItem Command="{Binding OpenSettingsCommand}" CommandParameter="2" Header="_Behavior" />

<MenuItem Command="{Binding OpenSettingsCommand}" CommandParameter="3" Header="H_elp" />

<Separator />

<MenuItem Command="{Binding NewClockCommand}"
Header="Create _new clock"
IsEnabled="{x:Static p:Settings.CanBeSaved}" />
Expand Down
6 changes: 5 additions & 1 deletion DesktopClock/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ public void HideForNow()
/// Opens a new settings window or activates the existing one.
/// </summary>
[RelayCommand]
public void OpenSettings() => App.ShowSingletonWindow<SettingsWindow>(this);
public void OpenSettings(string tabIndex)
{
Settings.Default.SettingsTabIndex = int.Parse(tabIndex);
App.ShowSingletonWindow<SettingsWindow>(this);
}

/// <summary>
/// Asks the user then creates a new clock executable and starts it.
Expand Down

0 comments on commit ec20847

Please sign in to comment.