diff options
author | Christian Dywan <christian@twotoasts.de> | 2018-08-30 10:58:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 10:58:25 +0200 |
commit | 7c32f7410be9dc4ba5f80a249841414ec9e14764 (patch) | |
tree | c5acb08c992adc637b760a1366bb5da7725917d7 | |
parent | 10eca362366ed25b2b0be83eb5b814306c68ff4f (diff) | |
download | midori-git-7c32f7410be9dc4ba5f80a249841414ec9e14764.tar.gz |
Show delete button to remove suggestions from history (#27)
![screenshot from 2018-08-29 13-20-00](https://user-images.githubusercontent.com/1204189/44784820-25580a80-ab8f-11e8-8ca4-4f5664d16000.png)
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> |