summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2018-08-30 10:58:25 +0200
committerGitHub <noreply@github.com>2018-08-30 10:58:25 +0200
commit7c32f7410be9dc4ba5f80a249841414ec9e14764 (patch)
treec5acb08c992adc637b760a1366bb5da7725917d7
parent10eca362366ed25b2b0be83eb5b814306c68ff4f (diff)
downloadmidori-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.vala5
-rw-r--r--ui/suggestion-row.ui15
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>