mirror of
https://github.com/DarthAffe/RGBSyncPlus
synced 2025-12-12 17:08:31 +00:00
parent
bd5267b2ca
commit
a4e72347a0
@ -1,2 +1,4 @@
|
|||||||
# RGBSyncPlus
|
# RGBSyncPlus
|
||||||
Tool to syncronize RGB devices
|
Tool to syncronize RGB devices
|
||||||
|
|
||||||
|
If you've issues with the configuration window not opening when clicking the Tray-Icon you can disable Tray-Minimization by changing ```"MinimizeToTray":true``` to ```"MinimizeToTray":false``` in _Settings.json_ in the installation directory. (If this entry isn't already included delete the file and start/close the program once.)
|
||||||
@ -55,6 +55,12 @@ namespace RGBSyncPlus
|
|||||||
|
|
||||||
ApplicationManager.Instance.Settings = settings;
|
ApplicationManager.Instance.Settings = settings;
|
||||||
ApplicationManager.Instance.Initialize();
|
ApplicationManager.Instance.Initialize();
|
||||||
|
|
||||||
|
if (!settings.MinimizeToTray) //HACK DarthAffe 02.12.2018: Workaround to create the window
|
||||||
|
{
|
||||||
|
ApplicationManager.Instance.OpenConfigurationCommand.Execute(null);
|
||||||
|
ApplicationManager.Instance.HideConfigurationCommand.Execute(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,6 +39,9 @@ namespace RGBSyncPlus
|
|||||||
private ActionCommand _openConfiguration;
|
private ActionCommand _openConfiguration;
|
||||||
public ActionCommand OpenConfigurationCommand => _openConfiguration ?? (_openConfiguration = new ActionCommand(OpenConfiguration));
|
public ActionCommand OpenConfigurationCommand => _openConfiguration ?? (_openConfiguration = new ActionCommand(OpenConfiguration));
|
||||||
|
|
||||||
|
private ActionCommand _hideConfiguration;
|
||||||
|
public ActionCommand HideConfigurationCommand => _hideConfiguration ?? (_hideConfiguration = new ActionCommand(HideConfiguration));
|
||||||
|
|
||||||
private ActionCommand _exitCommand;
|
private ActionCommand _exitCommand;
|
||||||
public ActionCommand ExitCommand => _exitCommand ?? (_exitCommand = new ActionCommand(Exit));
|
public ActionCommand ExitCommand => _exitCommand ?? (_exitCommand = new ActionCommand(Exit));
|
||||||
|
|
||||||
@ -133,10 +136,26 @@ namespace RGBSyncPlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HideConfiguration()
|
||||||
|
{
|
||||||
|
if (Settings.MinimizeToTray)
|
||||||
|
{
|
||||||
|
if (_configurationWindow.IsVisible)
|
||||||
|
_configurationWindow.Hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_configurationWindow.WindowState = WindowState.Minimized;
|
||||||
|
}
|
||||||
|
|
||||||
private void OpenConfiguration()
|
private void OpenConfiguration()
|
||||||
{
|
{
|
||||||
if (_configurationWindow == null) _configurationWindow = new ConfigurationWindow();
|
if (_configurationWindow == null) _configurationWindow = new ConfigurationWindow();
|
||||||
_configurationWindow.Show();
|
|
||||||
|
if (!_configurationWindow.IsVisible)
|
||||||
|
_configurationWindow.Show();
|
||||||
|
|
||||||
|
if (_configurationWindow.WindowState == WindowState.Minimized)
|
||||||
|
_configurationWindow.WindowState = WindowState.Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Exit()
|
private void Exit()
|
||||||
|
|||||||
@ -17,6 +17,8 @@ namespace RGBSyncPlus.Configuration
|
|||||||
|
|
||||||
public double UpdateRate { get; set; } = 30.0;
|
public double UpdateRate { get; set; } = 30.0;
|
||||||
|
|
||||||
|
public bool MinimizeToTray { get; set; } = true;
|
||||||
|
|
||||||
public List<SyncGroup> SyncGroups { get; set; } = new List<SyncGroup>();
|
public List<SyncGroup> SyncGroups { get; set; } = new List<SyncGroup>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -76,7 +76,7 @@ namespace RGBSyncPlus.Controls
|
|||||||
closeButton.Click += (sender, args) => ApplicationManager.Instance.ExitCommand.Execute(null);
|
closeButton.Click += (sender, args) => ApplicationManager.Instance.ExitCommand.Execute(null);
|
||||||
|
|
||||||
if (GetTemplateChild("PART_MinimizeButton") is Button minimizeButton)
|
if (GetTemplateChild("PART_MinimizeButton") is Button minimizeButton)
|
||||||
minimizeButton.Click += (sender, args) => Hide();
|
minimizeButton.Click += (sender, args) => ApplicationManager.Instance.HideConfigurationCommand.Execute(null); //HACK DarthAffe 02.12.2018: This is a really dirty hack - hopefully this will never get more than one window ...
|
||||||
|
|
||||||
if (GetTemplateChild("PART_IconButton") is Button iconButton)
|
if (GetTemplateChild("PART_IconButton") is Button iconButton)
|
||||||
iconButton.Click += (sender, args) => IconCommand?.Execute(null);
|
iconButton.Click += (sender, args) => IconCommand?.Execute(null);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user