From 712d3f243a1e2697e00605383ec5d486a39dd3f1 Mon Sep 17 00:00:00 2001 From: CascadePass <106619481+CascadePass@users.noreply.github.com> Date: Thu, 12 Jun 2025 23:18:41 -0700 Subject: [PATCH] Make Settings Available Immediately Improve CommandTextBox to allow multiple buttons instead of only one, and use this ability to make settings available before an image is loaded. --- src/Glazier.UI/CommandTextBox.xaml | 8 +++- src/Glazier.UI/CommandTextBox.xaml.cs | 55 ++++++++++++++++++++++++++- src/Glazier.UI/LoadImageForm.xaml | 27 +++++++++++-- src/Glazier.UI/WorkspaceViewModel.cs | 10 ++++- 4 files changed, 92 insertions(+), 8 deletions(-) diff --git a/src/Glazier.UI/CommandTextBox.xaml b/src/Glazier.UI/CommandTextBox.xaml index b621cc0..fc72422 100644 --- a/src/Glazier.UI/CommandTextBox.xaml +++ b/src/Glazier.UI/CommandTextBox.xaml @@ -7,18 +7,24 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - + + + + ), typeof(CommandTextBox), new PropertyMetadata(null) + ); + #endregion public CommandTextBox() { this.InitializeComponent(); + this.Buttons = []; } #region Dependency Properties (Getters/Setters) @@ -78,6 +86,49 @@ public ICommand Command set { SetValue(CommandProperty, value); } } + public ObservableCollection + + + + diff --git a/src/Glazier.UI/WorkspaceViewModel.cs b/src/Glazier.UI/WorkspaceViewModel.cs index 60c7169..e2dec17 100644 --- a/src/Glazier.UI/WorkspaceViewModel.cs +++ b/src/Glazier.UI/WorkspaceViewModel.cs @@ -35,7 +35,7 @@ public class WorkspaceViewModel : ViewModel private IThemeListener themeListener; private IFileDialogProvider dialogProvider; - private DelegateCommand browseForImageFile, saveImageData, viewLargePreviewCommand, viewMaskCommand; + private DelegateCommand browseForImageFile, saveImageData, viewLargePreviewCommand, viewMaskCommand, editSettingsCommand; #endregion @@ -299,6 +299,8 @@ public bool IsMaskVisible public ICommand ViewMaskCommand => this.viewMaskCommand ??= new(this.ViewMaskImplementation); + public ICommand EditSettingsCommand => this.editSettingsCommand ??= new(this.EditSettingsImplementation); + #endregion @@ -511,6 +513,12 @@ internal void ViewLargePreviewImplementation() previewWindow.ShowDialog(); } + internal void EditSettingsImplementation() + { + this.IsSettingsPageVisible = true; + this.SettingsViewModel.IsSettingsPageOpen = true; + } + #endregion #region Event Handlers