mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-02 02:44:41 +00:00
@@ -210,27 +210,24 @@ public partial class App : Application
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Initialize MessageBox patching
|
|
||||||
bool modernMessageBox = SettingHelper.Get("ModernMessageBox", true, "QuickLook");
|
|
||||||
if (modernMessageBox) MessageBoxPatcher.Initialize();
|
|
||||||
|
|
||||||
// Set initial theme based on system settings
|
// Set initial theme based on system settings
|
||||||
ThemeManager.Apply(OSThemeHelper.AppsUseDarkTheme() ? ApplicationTheme.Dark : ApplicationTheme.Light);
|
ThemeManager.Apply(OSThemeHelper.AppsUseDarkTheme() ? ApplicationTheme.Dark : ApplicationTheme.Light);
|
||||||
SystemEvents.UserPreferenceChanged += (_, _) =>
|
SystemEvents.UserPreferenceChanged += (_, _) =>
|
||||||
ThemeManager.Apply(OSThemeHelper.AppsUseDarkTheme() ? ApplicationTheme.Dark : ApplicationTheme.Light);
|
ThemeManager.Apply(OSThemeHelper.AppsUseDarkTheme() ? ApplicationTheme.Dark : ApplicationTheme.Light);
|
||||||
UxTheme.ApplyPreferredAppMode();
|
UxTheme.ApplyPreferredAppMode();
|
||||||
|
|
||||||
// Initialize TrayIcon
|
|
||||||
_ = TrayIconManager.GetInstance();
|
|
||||||
|
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
|
|
||||||
|
// Initialize MessageBox patching
|
||||||
|
bool modernMessageBox = SettingHelper.Get("ModernMessageBox", true, "QuickLook");
|
||||||
|
if (modernMessageBox) MessageBoxPatcher.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Application_Startup(object sender, StartupEventArgs e)
|
private void Application_Startup(object sender, StartupEventArgs e)
|
||||||
{
|
{
|
||||||
if (!EnsureOSVersion()
|
if (!EnsureOSVersion()
|
||||||
|| !EnsureFirstInstance(e.Args)
|
|| !EnsureFirstInstance(e.Args)
|
||||||
|| !EnsureFolderWritable(SettingHelper.LocalDataPath))
|
|| !EnsureFolderWritable(SettingHelper.LocalDataPath))
|
||||||
{
|
{
|
||||||
_cleanExit = false;
|
_cleanExit = false;
|
||||||
Shutdown();
|
Shutdown();
|
||||||
@@ -325,8 +322,10 @@ public partial class App : Application
|
|||||||
}
|
}
|
||||||
// Second instance: duplicate
|
// Second instance: duplicate
|
||||||
else
|
else
|
||||||
|
{
|
||||||
MessageBox.Show(TranslationHelper.Get("APP_SECOND_TEXT"), TranslationHelper.Get("APP_SECOND"),
|
MessageBox.Show(TranslationHelper.Get("APP_SECOND_TEXT"), TranslationHelper.Get("APP_SECOND"),
|
||||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
1
QuickLook/GlobalUsing.cs
Normal file
1
QuickLook/GlobalUsing.cs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
global using MessageBox = Wpf.Ui.Violeta.Controls.MessageBox;
|
Reference in New Issue
Block a user