From 561f76581b671d447f41fdbf4f8e5fa62c217634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Tue, 30 Sep 2025 19:04:52 +0200 Subject: [PATCH] Got rid of shortcut icons --- .../UI/AddShortcutWindow/AddShortcutWindow.cs | 27 +++---------------- .../AddShortcutWindow/AddShortcutWindow.xml | 4 +-- src/App/UI/MainWindow/MainWindow.xml | 10 +++---- .../PasswordStoreShortcutCollection.cs | 17 ++---------- src/App/ViewModels/PasswordStoreViewModel.cs | 8 +----- src/Models/PasswordStore.cs | 1 - 6 files changed, 11 insertions(+), 56 deletions(-) diff --git a/src/App/UI/AddShortcutWindow/AddShortcutWindow.cs b/src/App/UI/AddShortcutWindow/AddShortcutWindow.cs index 2e5ff74..10f72f2 100644 --- a/src/App/UI/AddShortcutWindow/AddShortcutWindow.cs +++ b/src/App/UI/AddShortcutWindow/AddShortcutWindow.cs @@ -10,8 +10,6 @@ public class AddShortcutWindow private const string dialogId = "add_shortcut_dialog"; private Gtk.Button? closeButton; private const string closeButtonId = "close_button"; - private Gtk.Button? iconPickerButton; - private const string iconPickerButtonId = "icon_picker_button"; private EntryRow? displayNameEntryRow; private const string displayNameEntryRowId = "display_name_entry_row"; private ActionRow? folderActionRow; @@ -44,13 +42,6 @@ public class AddShortcutWindow } closeButton.OnClicked += Close; - iconPickerButton = builder.GetObject(iconPickerButtonId) as Gtk.Button; - if (iconPickerButton == null) - { - throw new NullReferenceException(iconPickerButtonId); - } - iconPickerButton.OnClicked += OpenIconPicker; - displayNameEntryRow = builder.GetObject(displayNameEntryRowId) as EntryRow; if (displayNameEntryRow == null) { @@ -92,31 +83,19 @@ public class AddShortcutWindow private void CreateShortcut() { - if (displayNameEntryRow == null || browseButton == null || iconPickerButton == null) + if (displayNameEntryRow == null || browseButton == null) return; var displayName = displayNameEntryRow.GetText(); var path = ((ButtonContent)browseButton.Child).Label; - var iconName = iconPickerButton.Label; - if (string.IsNullOrWhiteSpace(displayName) || path.Equals("Browse") || string.IsNullOrWhiteSpace(path) || string.IsNullOrWhiteSpace(iconName)) + if (string.IsNullOrWhiteSpace(displayName) || path.Equals("Browse") || string.IsNullOrWhiteSpace(path)) return; - shortcuts.Add(path, displayName, iconName); + shortcuts.Add(path, displayName); Dialog.Close(); } - private void OpenIconPicker(object sender, EventArgs e) - { - var chooser = new Gtk.EmojiChooser(); - chooser.SetParent(iconPickerButton); - chooser.OnEmojiPicked += (s, e) => - { - iconPickerButton.Label = e.Text; - }; - chooser.Show(); - } - private void Close(object sender, EventArgs e) { Dialog.Close(); diff --git a/src/App/UI/AddShortcutWindow/AddShortcutWindow.xml b/src/App/UI/AddShortcutWindow/AddShortcutWindow.xml index db67b84..4148ef8 100644 --- a/src/App/UI/AddShortcutWindow/AddShortcutWindow.xml +++ b/src/App/UI/AddShortcutWindow/AddShortcutWindow.xml @@ -38,7 +38,7 @@ Name - + Location diff --git a/src/App/UI/MainWindow/MainWindow.xml b/src/App/UI/MainWindow/MainWindow.xml index f1c2a79..6c22c69 100644 --- a/src/App/UI/MainWindow/MainWindow.xml +++ b/src/App/UI/MainWindow/MainWindow.xml @@ -136,16 +136,12 @@ - + + diff --git a/src/App/ViewModels/PasswordStoreShortcutCollection.cs b/src/App/ViewModels/PasswordStoreShortcutCollection.cs index 01145f5..3c68ed0 100644 --- a/src/App/ViewModels/PasswordStoreShortcutCollection.cs +++ b/src/App/ViewModels/PasswordStoreShortcutCollection.cs @@ -77,19 +77,6 @@ public class PasswordStoreShortcutCollection : ObservableCollection _model.DisplayName; } - public string? IconName - { - get => _model.IconName; - } - public string Path { get => _model.Path; @@ -30,13 +25,12 @@ public class PasswordStoreViewModel : INotifyPropertyChanged _model = item; } - public PasswordStoreViewModel(string path, string? displayName = "New Shortcut", string? iconName = "text-x-generic-symbolic") + public PasswordStoreViewModel(string path, string? displayName = "New Shortcut") { _model = new PasswordStore { DisplayName = displayName, Path = path, - IconName = iconName }; } } diff --git a/src/Models/PasswordStore.cs b/src/Models/PasswordStore.cs index 28f6517..e46348a 100644 --- a/src/Models/PasswordStore.cs +++ b/src/Models/PasswordStore.cs @@ -5,5 +5,4 @@ public class PasswordStore public uint ID { get; set; } public string Path { get; set; } public string? DisplayName { get; set; } - public string? IconName { get; set; } } \ No newline at end of file