diff options
author | Christian Dywan <christian@twotoasts.de> | 2018-08-29 13:08:22 +0200 |
---|---|---|
committer | Christian Dywan <christian@twotoasts.de> | 2018-08-29 13:08:22 +0200 |
commit | edb3a948005c4c23ff98ac663211dd7f1870387e (patch) | |
tree | a9b81a8af3774cae139a03434b1ff26b2d26a8d2 | |
parent | fc7ef0d06a1d7a51c809af1080b8c85c1e3682a7 (diff) | |
download | midori-git-delete-suggestion-button.tar.gz |
Show delete button to remove suggestions from historydelete-suggestion-button
Functionality is analoguous to pressing Delete.
-rw-r--r-- | core/suggestion-row.vala | 5 | ||||
-rw-r--r-- | ui/suggestion-row.ui | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/core/suggestion-row.vala b/core/suggestion-row.vala index 402d2578..e8152ff4 100644 --- a/core/suggestion-row.vala +++ b/core/suggestion-row.vala @@ -26,6 +26,8 @@ namespace Midori { Gtk.Label title; [GtkChild] Gtk.Label uri; + [GtkChild] + Gtk.Button delete; public SuggestionRow (DatabaseItem item) { Object (item: item); if (item is SuggestionItem) { @@ -66,6 +68,9 @@ namespace Midori { } }); } + // Delete button to remove suggestions from history + this.delete.visible = item.database != null; + this.delete.clicked.connect (() => { item.delete.begin (); }); } string? strip_uri_prefix (string uri) { diff --git a/ui/suggestion-row.ui b/ui/suggestion-row.ui index ce1b4dcb..db9ba588 100644 --- a/ui/suggestion-row.ui +++ b/ui/suggestion-row.ui @@ -40,6 +40,21 @@ <property name="visible">yes</property> </object> </child> + <child> + <object class="GtkButton" id="delete"> + <property name="relief">none</property> + <property name="focus-on-click">no</property> + <property name="valign">center</property> + <child> + <object class="GtkImage"> + <property name="icon-name">edit-delete-symbolic</property> + <!-- menu --> + <property name="icon-size">1</property> + <property name="visible">yes</property> + </object> + </child> + </object> + </child> </object> </child> </template> |