mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Profile properties - Fix custom module icons missing
Profiles - Fix duplicating a profile causing weird behaviour Sidebar - Remember category collapse state
This commit is contained in:
1 parent
4c3e9b2784
commit
e9eebc4f36
5 files changed
+29
-14
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Artemis.Core.Modules;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar.Dialogs.ProfileEdit
|
||||
@@ -8,8 +9,12 @@ namespace Artemis.UI.Screens.Sidebar.Dialogs.ProfileEdit
|
||||
public ProfileModuleViewModel(Module module)
|
||||
{
|
||||
Module = module;
|
||||
Icon = module.DisplayIcon;
|
||||
Name = module.DisplayName;
|
||||
if (module.DisplayIcon != null)
|
||||
Icon = module.DisplayIcon.EndsWith(".svg") ? module.Plugin.ResolveRelativePath(module.DisplayIcon) : module.DisplayIcon;
|
||||
else
|
||||
Icon = PackIconKind.QuestionMark.ToString();
|
||||
|
||||
Description = module.Info.Description;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace Artemis.UI.Screens.Sidebar
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
private readonly IProfileService _profileService;
|
||||
private SidebarProfileConfigurationViewModel _selectedProfileConfiguration;
|
||||
private bool _showItems;
|
||||
private readonly DefaultDropHandler _defaultDropHandler;
|
||||
private bool _addingProfile;
|
||||
|
||||
@@ -43,7 +42,6 @@ namespace Artemis.UI.Screens.Sidebar
|
||||
_dialogService = dialogService;
|
||||
_vmFactory = vmFactory;
|
||||
_eventAggregator = eventAggregator;
|
||||
_showItems = !profileCategory.IsCollapsed;
|
||||
_defaultDropHandler = new DefaultDropHandler();
|
||||
|
||||
ProfileCategory = profileCategory;
|
||||
@@ -53,15 +51,15 @@ namespace Artemis.UI.Screens.Sidebar
|
||||
|
||||
public bool ShowItems
|
||||
{
|
||||
get => _showItems;
|
||||
get => !ProfileCategory.IsCollapsed;
|
||||
set
|
||||
{
|
||||
if (!SetAndNotify(ref _showItems, value)) return;
|
||||
|
||||
if (value)
|
||||
CreateProfileViewModels();
|
||||
else
|
||||
ProfileCategory.IsCollapsed = !value;
|
||||
if (ProfileCategory.IsCollapsed)
|
||||
Items.Clear();
|
||||
else
|
||||
CreateProfileViewModels();
|
||||
_profileService.SaveProfileCategory(ProfileCategory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +216,8 @@ namespace Artemis.UI.Screens.Sidebar
|
||||
/// <inheritdoc />
|
||||
protected override void OnActivate()
|
||||
{
|
||||
CreateProfileViewModels();
|
||||
if (ShowItems)
|
||||
CreateProfileViewModels();
|
||||
base.OnActivate();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user