mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Profiles - Retain suspension state toggled by keybinds
This commit is contained in:
parent
52d53f1d23
commit
02ab5ad764
@ -109,22 +109,26 @@ internal class ProfileService : IProfileService
|
|||||||
if (profileConfiguration.HotkeyMode == ProfileConfigurationHotkeyMode.None)
|
if (profileConfiguration.HotkeyMode == ProfileConfigurationHotkeyMode.None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool before = profileConfiguration.IsSuspended;
|
||||||
foreach (ArtemisKeyboardKeyEventArgs e in _pendingKeyboardEvents)
|
foreach (ArtemisKeyboardKeyEventArgs e in _pendingKeyboardEvents)
|
||||||
{
|
{
|
||||||
if (profileConfiguration.HotkeyMode == ProfileConfigurationHotkeyMode.Toggle)
|
if (profileConfiguration.HotkeyMode == ProfileConfigurationHotkeyMode.Toggle)
|
||||||
{
|
{
|
||||||
if (profileConfiguration.EnableHotkey != null &&
|
if (profileConfiguration.EnableHotkey != null && profileConfiguration.EnableHotkey.MatchesEventArgs(e))
|
||||||
profileConfiguration.EnableHotkey.MatchesEventArgs(e))
|
|
||||||
profileConfiguration.IsSuspended = !profileConfiguration.IsSuspended;
|
profileConfiguration.IsSuspended = !profileConfiguration.IsSuspended;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (profileConfiguration.IsSuspended && profileConfiguration.EnableHotkey != null && profileConfiguration.EnableHotkey.MatchesEventArgs(e))
|
if (profileConfiguration.IsSuspended && profileConfiguration.EnableHotkey != null && profileConfiguration.EnableHotkey.MatchesEventArgs(e))
|
||||||
profileConfiguration.IsSuspended = false;
|
profileConfiguration.IsSuspended = false;
|
||||||
if (!profileConfiguration.IsSuspended && profileConfiguration.DisableHotkey != null && profileConfiguration.DisableHotkey.MatchesEventArgs(e))
|
else if (!profileConfiguration.IsSuspended && profileConfiguration.DisableHotkey != null && profileConfiguration.DisableHotkey.MatchesEventArgs(e))
|
||||||
profileConfiguration.IsSuspended = true;
|
profileConfiguration.IsSuspended = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If suspension was changed, save the category
|
||||||
|
if (before != profileConfiguration.IsSuspended)
|
||||||
|
SaveProfileCategory(profileConfiguration.Category);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateDefaultProfileCategories()
|
private void CreateDefaultProfileCategories()
|
||||||
@ -422,7 +426,7 @@ internal class ProfileService : IProfileService
|
|||||||
_profileCategories.Remove(profileCategory);
|
_profileCategories.Remove(profileCategory);
|
||||||
_profileCategoryRepository.Remove(profileCategory.Entity);
|
_profileCategoryRepository.Remove(profileCategory.Entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnProfileCategoryRemoved(new ProfileCategoryEventArgs(profileCategory));
|
OnProfileCategoryRemoved(new ProfileCategoryEventArgs(profileCategory));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user