mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 06:46:04 +02:00
Minimize to tray at startup
This commit is contained in:
+1
-2
@@ -94,9 +94,8 @@ namespace VRCX
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
catch
|
||||
catch(ThreadInterruptedException)
|
||||
{
|
||||
// ThreadInterruptedException
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-2
@@ -103,7 +103,15 @@ namespace VRCX
|
||||
{
|
||||
state = FormWindowState.Minimized;
|
||||
}
|
||||
WindowState = state;
|
||||
if ("true".Equals(VRCXStorage.Instance.Get("VRCX_StartAsMinimizedState")) &&
|
||||
"true".Equals(VRCXStorage.Instance.Get("VRCX_CloseToTray")))
|
||||
{
|
||||
BeginInvoke(new MethodInvoker(Hide));
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowState = state;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -136,7 +144,7 @@ namespace VRCX
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (e.CloseReason == CloseReason.UserClosing &&
|
||||
"true".Equals(SharedVariable.Instance.Get("config:vrcx_closetotray")))
|
||||
"true".Equals(VRCXStorage.Instance.Get("VRCX_CloseToTray")))
|
||||
{
|
||||
e.Cancel = true;
|
||||
Hide();
|
||||
|
||||
@@ -148,9 +148,8 @@ namespace VRCX
|
||||
{
|
||||
Thread.Sleep(32);
|
||||
}
|
||||
catch
|
||||
catch(ThreadInterruptedException)
|
||||
{
|
||||
// ThreadInterruptedException
|
||||
}
|
||||
|
||||
if (_active)
|
||||
|
||||
+8
-2
@@ -12335,7 +12335,13 @@ speechSynthesis.getVoices();
|
||||
);
|
||||
$app.data.isStartAsMinimizedState =
|
||||
VRCXStorage.Get('VRCX_StartAsMinimizedState') === 'true';
|
||||
$app.data.isCloseToTray = configRepository.getBool('VRCX_CloseToTray');
|
||||
$app.data.isCloseToTray = VRCXStorage.Get('VRCX_CloseToTray') === 'true';
|
||||
if (configRepository.getBool('VRCX_CloseToTray')) {
|
||||
// move back to JSON
|
||||
$app.data.isCloseToTray = configRepository.getBool('VRCX_CloseToTray');
|
||||
VRCXStorage.Set('VRCX_CloseToTray', $app.data.isCloseToTray.toString());
|
||||
configRepository.remove('VRCX_CloseToTray');
|
||||
}
|
||||
var saveVRCXWindowOption = function () {
|
||||
configRepository.setBool(
|
||||
'VRCX_StartAtWindowsStartup',
|
||||
@@ -12345,7 +12351,7 @@ speechSynthesis.getVoices();
|
||||
'VRCX_StartAsMinimizedState',
|
||||
this.isStartAsMinimizedState.toString()
|
||||
);
|
||||
configRepository.setBool('VRCX_CloseToTray', this.isCloseToTray);
|
||||
VRCXStorage.Set('VRCX_CloseToTray', this.isCloseToTray.toString());
|
||||
AppApi.SetStartup(this.isStartAtWindowsStartup);
|
||||
};
|
||||
$app.watch.isStartAtWindowsStartup = saveVRCXWindowOption;
|
||||
|
||||
Reference in New Issue
Block a user