1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-02-04 02:43:32 +00:00

Workshop - Fix default sorting being blank

Sidebar - Allow right-clicking a profile to open the menu without opening the profile
Profile editor - Fix editor not stopping to focus the profile
This commit is contained in:
Robert 2025-12-13 16:19:16 +01:00
parent 0eb2c3a3b2
commit 8e4a430e19
5 changed files with 13 additions and 6 deletions

View File

@ -183,12 +183,11 @@ internal class ProfileEditorService : IProfileEditorService
// Activate the profile and it's mode off of the UI thread
await Task.Run(() =>
{
_profileService.FocusProfile = profileConfiguration;
// Activate the profile if one was provided
if (profileConfiguration != null)
{
_profileService.FocusProfile = profileConfiguration;
_profileService.ActivateProfile(profileConfiguration);
}
// If there is no profile configuration or module, deliberately set the override to null
_moduleService.SetActivationOverride(profileConfiguration?.Module);

View File

@ -203,7 +203,7 @@ public partial class ProfileEditorViewModel : RoutableScreen<ProfileViewModelPar
/// <inheritdoc />
public override async Task OnClosing(NavigationArguments args)
{
if (!args.Path.StartsWith("profile-editor"))
if (!args.Path.StartsWith("profile"))
{
ProfileConfiguration = null;
await _profileEditorService.ChangeCurrentProfileConfiguration(null);

View File

@ -71,6 +71,7 @@
ColumnDefinitions="Auto,*,Auto,Auto"
Background="Transparent"
ContextFlyout="{StaticResource ProfileMenuFlyout}"
PointerPressed="ProfileContainerGrid_OnPointerPressed"
Classes.flyout-open="{CompiledBinding IsOpen, Source={StaticResource ProfileMenuFlyout}}">
<shared:ProfileConfigurationIcon Grid.Column="0"
x:Name="ProfileIcon"

View File

@ -1,4 +1,5 @@
using Avalonia.Markup.Xaml;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Sidebar;
@ -10,4 +11,10 @@ public partial class SidebarProfileConfigurationView : ReactiveUserControl<Sideb
InitializeComponent();
}
private void ProfileContainerGrid_OnPointerPressed(object? sender, PointerPressedEventArgs e)
{
// When right-clicking only open the context menu, don't select the profile
if (e.GetCurrentPoint(this).Properties.IsRightButtonPressed)
e.Handled = true;
}
}

View File

@ -17,7 +17,7 @@ public partial class EntryListInputViewModel : ViewModelBase
public EntryListInputViewModel(ISettingsService settingsService)
{
_search = _lastSearch;
_sortBy = settingsService.GetSetting("Workshop.SortBy", 10);
_sortBy = settingsService.GetSetting("Workshop.SortBy", 0);
_sortBy.AutoSave = true;
}