small bug fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using cfs_tracker.Helpers;
|
||||
using cfs_tracker.Services;
|
||||
using cfs_tracker.ViewModels;
|
||||
using Microsoft.Maui.Layouts;
|
||||
using System.Collections.Specialized;
|
||||
@@ -66,6 +67,16 @@ public partial class OptionsPage : ContentPage
|
||||
{
|
||||
if (e.PropertyName == nameof(OptionsViewModel.SelectedTab))
|
||||
Dispatcher.Dispatch(EnsureAppearanceEditorsIfNeeded);
|
||||
|
||||
if (e.PropertyName == nameof(OptionsViewModel.RequiresShellReload) && _viewModel.RequiresShellReload)
|
||||
{
|
||||
_viewModel.ClearShellReloadFlag();
|
||||
Dispatcher.Dispatch(async () =>
|
||||
{
|
||||
if (Application.Current is App app)
|
||||
await app.ReloadShellAsync("//options", OptionsViewModel.OptionsTab.Appearance);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsureAppearanceEditorsIfNeeded()
|
||||
@@ -112,7 +123,7 @@ public partial class OptionsPage : ContentPage
|
||||
|
||||
var defaultLabel = new Label
|
||||
{
|
||||
Text = $"Standard: {NormalizeHex(item.Fallback, item.Fallback)}",
|
||||
Text = $"{LocalizationService.Translate("Common_Default")}: {NormalizeHex(item.Fallback, item.Fallback)}",
|
||||
FontSize = 12
|
||||
};
|
||||
defaultLabel.SetDynamicResource(Label.TextColorProperty, "TextMuted");
|
||||
@@ -137,6 +148,7 @@ public partial class OptionsPage : ContentPage
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
Margin = new Thickness(0, 0, 0, 10)
|
||||
};
|
||||
chooseButton.Text = LocalizationService.Translate("Options_Appearance_ChooseColor");
|
||||
chooseButton.SetDynamicResource(Button.BackgroundColorProperty, "ButtonSecondaryBackground");
|
||||
chooseButton.SetDynamicResource(Button.TextColorProperty, "ButtonSecondaryText");
|
||||
chooseButton.Clicked += (_, _) => OpenColorDialog(item);
|
||||
@@ -184,7 +196,7 @@ public partial class OptionsPage : ContentPage
|
||||
_dialogWorkingHex = _dialogInitialHex;
|
||||
|
||||
ColorDialogTitleLabel.Text = item.Title;
|
||||
ColorDialogDefaultLabel.Text = $"Standardwert: {NormalizeHex(item.Fallback, item.Fallback)}";
|
||||
ColorDialogDefaultLabel.Text = $"{LocalizationService.Translate("Common_DefaultValue")}: {NormalizeHex(item.Fallback, item.Fallback)}";
|
||||
|
||||
ApplyDialogHex(_dialogWorkingHex, resetBrightness: true);
|
||||
ColorDialogOverlay.IsVisible = true;
|
||||
|
||||
Reference in New Issue
Block a user