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