mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
UI - Fixed various rename dialogs cancelling instead of submitting when pressing enter
Submission wizard - Allow window to scroll when setting up layer adaption hints Local web API - Added status endpoint to determine whether webserver is running
This commit is contained in:
1 parent
d96581f11c
commit
8d5640aba3
11 files changed
+79
-51
No files matched your search
@@ -7,9 +7,6 @@
|
||||
x:Class="Artemis.UI.Screens.Sidebar.SidebarCategoryEditView"
|
||||
x:DataType="sidebar:SidebarCategoryEditViewModel">
|
||||
<StackPanel>
|
||||
<StackPanel.KeyBindings>
|
||||
<KeyBinding Gesture="Enter" Command="{CompiledBinding Enter}" />
|
||||
</StackPanel.KeyBindings>
|
||||
<TextBox Text="{CompiledBinding CategoryName}" Watermark="Category name"/>
|
||||
<TextBox Name="NameTextBox" Text="{CompiledBinding CategoryName}" Watermark="Category name"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.UI.Shared.Extensions;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
using Avalonia.Threading;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
@@ -10,7 +11,18 @@ public partial class SidebarCategoryEditView : ReactiveUserControl<SidebarCatego
|
||||
public SidebarCategoryEditView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.WhenActivated(_ => this.ClearAllDataValidationErrors());
|
||||
this.WhenActivated(_ =>
|
||||
{
|
||||
this.ClearAllDataValidationErrors();
|
||||
Dispatcher.UIThread.Post(DelayedAutoFocus);
|
||||
});
|
||||
}
|
||||
|
||||
private async void DelayedAutoFocus()
|
||||
{
|
||||
// Don't ask
|
||||
await Task.Delay(200);
|
||||
NameTextBox.SelectAll();
|
||||
NameTextBox.Focus();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,6 @@ public class SidebarCategoryEditViewModel : ContentDialogViewModelBase
|
||||
_categoryName = _category.Name;
|
||||
|
||||
Confirm = ReactiveCommand.Create(ExecuteConfirm, ValidationContext.Valid);
|
||||
Enter = ReactiveCommand.Create(() => ContentDialog?.Hide(ContentDialogResult.Primary), Confirm.CanExecute);
|
||||
this.ValidationRule(vm => vm.CategoryName, categoryName => !string.IsNullOrWhiteSpace(categoryName?.Trim()), "You must specify a valid name");
|
||||
this.ValidationRule(vm => vm.CategoryName, categoryName => profileService.ProfileCategories.All(c => c.Name != categoryName?.Trim()), "You must specify a unique name");
|
||||
}
|
||||
@@ -36,7 +35,6 @@ public class SidebarCategoryEditViewModel : ContentDialogViewModelBase
|
||||
}
|
||||
|
||||
public ReactiveCommand<Unit, Unit> Confirm { get; }
|
||||
public ReactiveCommand<Unit, Unit> Enter { get; }
|
||||
|
||||
private void ExecuteConfirm()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user