From decc80341f71245b2b249b9001082c2f8e29e675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Wed, 17 Sep 2025 13:30:09 +0200 Subject: [PATCH] Add edit button to shortcut rows --- App/UI/MainWindow.xml | 4 +- .../Models/PasswordStoreShortcutCollection.cs | 44 +++++++++++-------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/App/UI/MainWindow.xml b/App/UI/MainWindow.xml index 3505941..b854161 100644 --- a/App/UI/MainWindow.xml +++ b/App/UI/MainWindow.xml @@ -14,8 +14,8 @@ - 250 - 250 + 300 + 300 { Console.WriteLine($"[DEBUG] Opening: {shortcut.Path}"); }; return row; - } - - private void UpdateRowFromItem(PasswordStoreShortcut shortcut, ref ActionRow row) - { - row.SetTitle(shortcut.DisplayName); - row.SetSubtitle(shortcut.Path); + } + + private void UpdateRowFromItem(PasswordStoreShortcut shortcut, ref ActionRow row) + { + row.SetTitle(shortcut.DisplayName); + row.SetSubtitle(shortcut.Path); //Update icon - var existingIcon = row.GetFirstChild() as Gtk.Image; - if (existingIcon == null) - { - var icon = new Gtk.Image(); - icon.SetFromIconName(shortcut.IconName); - row.AddPrefix(icon); - } - else - { - existingIcon.SetFromIconName(shortcut.IconName); - } + var existingIcon = row.GetFirstChild() as Gtk.Image; + if (existingIcon == null) + { + var icon = new Gtk.Image(); + icon.SetFromIconName(shortcut.IconName); + row.AddPrefix(icon); + } + else + { + existingIcon.SetFromIconName(shortcut.IconName); + } + + // Edit button + var edit = new Button(); + edit.AddCssClass("flat"); + edit.SetValign(Align.Center); + edit.IconName = "document-edit-symbolic"; + row.AddSuffix(edit); } } \ No newline at end of file