Compare commits

...

2 Commits

Author SHA1 Message Date
ema
3ae4eeb26d Improve CLI performance
Some checks failed
MSBuild / build (push) Has been cancelled
MSBuild / publish (push) Has been cancelled
2025-08-04 00:17:07 +08:00
ema
da0033b52a Improve CLI performance #1706 #1731 2025-08-03 22:20:35 +08:00
2 changed files with 9 additions and 9 deletions

View File

@@ -210,9 +210,7 @@ public partial class App : Application
}
};
// Initialize MessageBox patching
bool modernMessageBox = SettingHelper.Get("ModernMessageBox", true, "QuickLook");
if (modernMessageBox) MessageBoxPatcher.Initialize();
base.OnStartup(e);
// Set initial theme based on system settings
ThemeManager.Apply(OSThemeHelper.AppsUseDarkTheme() ? ApplicationTheme.Dark : ApplicationTheme.Light);
@@ -220,17 +218,16 @@ public partial class App : Application
ThemeManager.Apply(OSThemeHelper.AppsUseDarkTheme() ? ApplicationTheme.Dark : ApplicationTheme.Light);
UxTheme.ApplyPreferredAppMode();
// Initialize TrayIcon
_ = TrayIconManager.GetInstance();
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)
{
if (!EnsureOSVersion()
|| !EnsureFirstInstance(e.Args)
|| !EnsureFolderWritable(SettingHelper.LocalDataPath))
|| !EnsureFirstInstance(e.Args)
|| !EnsureFolderWritable(SettingHelper.LocalDataPath))
{
_cleanExit = false;
Shutdown();
@@ -325,8 +322,10 @@ public partial class App : Application
}
// Second instance: duplicate
else
{
MessageBox.Show(TranslationHelper.Get("APP_SECOND_TEXT"), TranslationHelper.Get("APP_SECOND"),
MessageBoxButton.OK, MessageBoxImage.Information);
}
return false;
}

1
QuickLook/GlobalUsing.cs Normal file
View File

@@ -0,0 +1 @@
global using MessageBox = Wpf.Ui.Violeta.Controls.MessageBox;