Skip to content

Commit

Permalink
Improve properties loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dremin committed Jan 1, 2025
1 parent 065134e commit 2bc89bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions RetroBar/PropertiesWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@
ToolTip="{DynamicResource language_tip}" />
</Label>
<ComboBox Name="cboLanguageSelect"
SelectedValue="{Binding Source={x:Static Settings:Settings.Instance}, Path=Language, UpdateSourceTrigger=PropertyChanged}"
SelectionChanged="cboLanguageSelect_SelectionChanged" />
SelectedValue="{Binding Source={x:Static Settings:Settings.Instance}, Path=Language, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<DockPanel>
<Label VerticalAlignment="Center"
Expand Down
18 changes: 10 additions & 8 deletions RetroBar/PropertiesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ private PropertiesWindow(NotificationArea notificationArea, DictionaryManager di
LoadRows();
LoadThemes();
LoadWidth();
LoadVersion();
LoadClockActions();

Settings.Instance.PropertyChanged += Settings_PropertyChanged;
}
Expand All @@ -96,6 +98,11 @@ private void Settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
LoadPreviewHeight();
}
else if (e.PropertyName == nameof(Settings.Language))
{
LoadVersion();
LoadClockActions();
}
}

public static PropertiesWindow Open(NotificationArea notificationArea, DictionaryManager dictionaryManager, AppBarScreen screen, double dpiScale, double barSize)
Expand Down Expand Up @@ -273,19 +280,14 @@ private void AutoStartCheckBox_OnChecked(object sender, RoutedEventArgs e)
}
}

private void cboLanguageSelect_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
LoadVersion();
PopulateClockActionsForPreWindows10();
}

private void PopulateClockActionsForPreWindows10()
private void LoadClockActions()
{
if (EnvironmentHelper.IsWindows10OrBetter)
{
return;
return;
}

// Remove options unsupported prior to Windows 10.
var availableClockActions = (FindResource("clock_click_action_values") as Array)?.Cast<object>().ToList();
if (availableClockActions == null)
{
Expand Down

0 comments on commit 2bc89bf

Please sign in to comment.