Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 4, 2023
1 parent 4d038bf commit 562520a
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/Launcher/Sucrose.Launcher/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected void Message(string Message)

string Path = SMMI.LauncherLogManager.LogFile();

switch (SSLMM.Theme)
switch (SSLMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
2 changes: 1 addition & 1 deletion src/Live/Sucrose.Live.Aurora/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected void Message(string Message)

string Path = SMMI.AuroraLiveLogManager.LogFile();

switch (SSEMM.Theme)
switch (SSEMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
2 changes: 1 addition & 1 deletion src/Live/Sucrose.Live.CefSharp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected void Message(string Message)

string Path = SMMI.CefSharpLiveLogManager.LogFile();

switch (SSEMM.Theme)
switch (SSEMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
2 changes: 1 addition & 1 deletion src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected void Message(string Message)

string Path = SMMI.MpvPlayerLiveLogManager.LogFile();

switch (SSEMM.Theme)
switch (SSEMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
2 changes: 1 addition & 1 deletion src/Live/Sucrose.Live.Nebula/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected void Message(string Message)

string Path = SMMI.NebulaLiveLogManager.LogFile();

switch (SSEMM.Theme)
switch (SSEMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
2 changes: 1 addition & 1 deletion src/Live/Sucrose.Live.Vexana/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected void Message(string Message)

string Path = SMMI.VexanaLiveLogManager.LogFile();

switch (SSEMM.Theme)
switch (SSEMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
2 changes: 1 addition & 1 deletion src/Live/Sucrose.Live.WebView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected void Message(string Message)

string Path = SMMI.WebViewLiveLogManager.LogFile();

switch (SSEMM.Theme)
switch (SSEMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
2 changes: 1 addition & 1 deletion src/Portal/Sucrose.Portal/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected void Message(string Message)

string Path = SMMI.PortalLogManager.LogFile();

switch (SPMM.Theme)
switch (SPMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path);
Expand Down
4 changes: 2 additions & 2 deletions src/Portal/Sucrose.Portal/Manage/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ internal static class Manager

public static SSDEDT DisplayType => SMMI.EngineSettingManager.GetSetting(SMC.DisplayType, SSDEDT.Screen);

public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill);
public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());

public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());
public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill);

public static WindowBackdropType DefaultBackdropType => WindowBackdropType.None;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private void BackdropSelected(int Index)
ApplicationTheme Theme = ApplicationTheme.Dark;
WindowBackdropType Type = (WindowBackdropType)Index;

if (SPMM.Theme == SEWTT.Light)
if (SPMM.ThemeType == SEWTT.Light)
{
Theme = ApplicationTheme.Light;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private static WindowBackdropType GetWindowBackdropType()
[RelayCommand]
private void OnChangeTheme()
{
if (SPMM.Theme == SEWTT.Dark)
if (SPMM.ThemeType == SEWTT.Dark)
{
SMMI.GeneralSettingManager.SetSetting(SMC.ThemeType, SEWTT.Light);
WUAT.Apply(WUAAT.Light, GetWindowBackdropType(), true, true);
Expand Down
31 changes: 26 additions & 5 deletions src/Portal/Sucrose.Portal/Views/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
using SSDEACT = Sucrose.Shared.Dependency.Enum.ArgumentCommandsType;
using WUAAT = Wpf.Ui.Appearance.ApplicationTheme;
using WUAT = Wpf.Ui.Appearance.ApplicationThemeManager;
using SWHWT = Skylark.Wing.Helper.WindowsTheme;
using SMMI = Sucrose.Manager.Manage.Internal;
using SMC = Sucrose.Memory.Constant;

namespace Sucrose.Portal.Views.Windows
{
Expand All @@ -32,15 +35,33 @@ public MainWindow(SPVMWMWVM ViewModel, INavigationService NavigationService, ISe

InitializeComponent();

if (SPMM.Theme == SEWTT.Dark)
if (SPMM.BackdropType == WindowBackdropType.Auto)
{
WUAT.Apply(WUAAT.Dark);
Light.Visibility = Visibility.Collapsed;
if (SWHWT.GetTheme() == SEWTT.Dark)
{
WUAT.Apply(WUAAT.Dark);
Light.Visibility = Visibility.Collapsed;
SMMI.GeneralSettingManager.SetSetting(SMC.ThemeType, SEWTT.Dark);
}
else
{
WUAT.Apply(WUAAT.Light);
Dark.Visibility = Visibility.Collapsed;
SMMI.GeneralSettingManager.SetSetting(SMC.ThemeType, SEWTT.Light);
}
}
else
{
WUAT.Apply(WUAAT.Light);
Dark.Visibility = Visibility.Collapsed;
if (SPMM.ThemeType == SEWTT.Dark)
{
WUAT.Apply(WUAAT.Dark);
Light.Visibility = Visibility.Collapsed;
}
else
{
WUAT.Apply(WUAAT.Light);
Dark.Visibility = Visibility.Collapsed;
}
}

RootView.SetServiceProvider(ServiceProvider);
Expand Down
4 changes: 2 additions & 2 deletions src/Shared/Engine/Sucrose.Shared.Engine/Manage/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ internal static class Manager

public static SSDEDT DisplayType => SMMI.EngineSettingManager.GetSetting(SMC.DisplayType, SSDEDT.Screen);

public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill);
public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());

public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());
public static SSDEST StretchType => SMMI.EngineSettingManager.GetSetting(SMC.StretchType, SSDEST.Fill);

public static SSDEST DefaultStretchType => SSDEST.None;

Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Sucrose.Shared.Launcher/Command/Report.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void Command()
{
SSLMI.ReportBox = false;

switch (SSLMM.Theme)
switch (SSLMM.ThemeType)
{
case SEWTT.Dark:
SSLVDRB DarkReportBox = new();
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Sucrose.Shared.Launcher/Manage/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Sucrose.Shared.Launcher.Manage
{
internal static class Manager
{
public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());
public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());

public static Mutex Mutex => new(true, SMR.LauncherMutex);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Shared/Sucrose.Shared.Launcher/Manager/TrayIconManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void Initialize()

SSLHR.Corner(ContextMenu);

if (SSLMM.Theme == SEWTT.Dark)
if (SSLMM.ThemeType == SEWTT.Dark)
{
ContextMenu.Renderer = new SSLRDR();
}
Expand All @@ -71,7 +71,7 @@ public void Initialize()

ContextMenu.Items.Add(SSRER.GetValue("Launcher", "OpenText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "OpenIcon"))), CommandInterface);

SSLSSS Separator1 = new(SSLMM.Theme);
SSLSSS Separator1 = new(SSLMM.ThemeType);

if (SSSHL.Run() && (!SMMM.PausePerformance || !SSSHP.Work(SSSMI.Backgroundog)))
{
Expand Down Expand Up @@ -116,14 +116,14 @@ public void Initialize()
}
}

SSLSSS Separator2 = new(SSLMM.Theme);
SSLSSS Separator2 = new(SSLMM.ThemeType);
ContextMenu.Items.Add(Separator2.Strip);

ContextMenu.Items.Add(SSRER.GetValue("Launcher", "SettingText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "SettingIcon"))), CommandSetting);
ContextMenu.Items.Add(SSRER.GetValue("Launcher", "ReportText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "ReportIcon"))), CommandReport);
ContextMenu.Items.Add(SSRER.GetValue("Launcher", "UpdateText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "UpdateIcon"))), CommandUpdate);

SSLSSS Separator3 = new(SSLMM.Theme);
SSLSSS Separator3 = new(SSLMM.ThemeType);
ContextMenu.Items.Add(Separator3.Strip);

ContextMenu.Items.Add(SSRER.GetValue("Launcher", "ExitText"), Image.FromFile(SSSHA.Get(SSRER.GetValue("Launcher", "ExitIcon"))), CommandClose);
Expand Down
6 changes: 3 additions & 3 deletions src/Update/Sucrose.Update/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected void Close()

internal void Info(SSDEUT Type)
{
switch (SUMM.Theme)
switch (SUMM.ThemeType)
{
case SEWTT.Dark:
SUVDIB DarkInfoBox = new(Type);
Expand All @@ -134,7 +134,7 @@ protected void Message(string Message)
string Path = SMMI.UpdateLogManager.LogFile();
string Text = SSRER.GetValue("Update", "HelpText");

switch (SUMM.Theme)
switch (SUMM.ThemeType)
{
case SEWTT.Dark:
SSWDEMB DarkMessageBox = new(Message, Path, Source, Text)
Expand Down Expand Up @@ -306,7 +306,7 @@ protected async void Configure()

if (Result == SSDECT.Pass)
{
switch (SUMM.Theme)
switch (SUMM.ThemeType)
{
case SEWTT.Dark:
SUVDUB DarkUpdateBox = new(Bundle);
Expand Down
2 changes: 1 addition & 1 deletion src/Update/Sucrose.Update/Manage/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class Manager
{
public static string CachePath => Path.Combine(SMR.AppDataPath, SMR.AppName, SMR.CacheFolder, SMR.Bundle);

public static SEWTT Theme => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());
public static SEWTT ThemeType => SMMI.GeneralSettingManager.GetSetting(SMC.ThemeType, SWHWT.GetTheme());

public static Mutex Mutex => new(true, SMR.UpdateMutex);
}
Expand Down

0 comments on commit 562520a

Please sign in to comment.