mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
ux: re-arrange options in apperance page
This commit is contained in:
parent
7d49d2b913
commit
7b71f8512d
3 changed files with 22 additions and 34 deletions
|
@ -132,14 +132,10 @@ namespace SourceGit
|
|||
var app = Current as App;
|
||||
var targetLocale = app.Resources[localeKey] as ResourceDictionary;
|
||||
if (targetLocale == null || targetLocale == app._activeLocale)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (app._activeLocale != null)
|
||||
{
|
||||
app.Resources.MergedDictionaries.Remove(app._activeLocale);
|
||||
}
|
||||
|
||||
app.Resources.MergedDictionaries.Add(targetLocale);
|
||||
app._activeLocale = targetLocale;
|
||||
|
@ -150,17 +146,11 @@ namespace SourceGit
|
|||
var app = Current as App;
|
||||
|
||||
if (theme.Equals("Light", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
app.RequestedThemeVariant = ThemeVariant.Light;
|
||||
}
|
||||
else if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
app.RequestedThemeVariant = ThemeVariant.Dark;
|
||||
}
|
||||
else
|
||||
{
|
||||
app.RequestedThemeVariant = ThemeVariant.Default;
|
||||
}
|
||||
|
||||
if (app._colorOverrides != null)
|
||||
{
|
||||
|
@ -173,6 +163,7 @@ namespace SourceGit
|
|||
try
|
||||
{
|
||||
var resDic = new ResourceDictionary();
|
||||
|
||||
var schema = JsonSerializer.Deserialize(File.ReadAllText(colorsFile), JsonCodeGen.Default.DictionaryStringString);
|
||||
foreach (var kv in schema)
|
||||
resDic[kv.Key] = Color.Parse(kv.Value);
|
||||
|
@ -191,9 +182,7 @@ namespace SourceGit
|
|||
if (Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
if (desktop.MainWindow.Clipboard is { } clipbord)
|
||||
{
|
||||
await clipbord.SetTextAsync(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue