summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Borges <felipeborges@gnome.org>2017-08-09 16:17:47 +0200
committerFelipe Borges <felipeborges@gnome.org>2017-10-02 11:27:47 +0200
commit555cac76ef35263623cc07d6edead3df23eb70f1 (patch)
tree0ce699fc100c87a3525f79b73d2442d9c787493b
parent820d1d938329eb218cf596bad50a530a33f61d9d (diff)
downloadgnome-control-center-wip/feborges/new-search-panel.tar.gz
search: Add notification advertising the reordering shortcutswip/feborges/new-search-panel
When a list row is selected, reveal a notification instructing how to reorder the list with the keyboard shortcuts. "Use Alt+↑ and Alt+↓ to move rows" https://bugzilla.gnome.org/show_bug.cgi?id=775958
-rw-r--r--panels/search/cc-search-panel.c12
-rw-r--r--panels/search/search.ui24
2 files changed, 35 insertions, 1 deletions
diff --git a/panels/search/cc-search-panel.c b/panels/search/cc-search-panel.c
index 85c71a31f..eb479dca6 100644
--- a/panels/search/cc-search-panel.c
+++ b/panels/search/cc-search-panel.c
@@ -34,6 +34,7 @@ struct _CcSearchPanelPrivate
{
GtkBuilder *builder;
GtkWidget *list_box;
+ GtkWidget *notification;
GCancellable *load_cancellable;
GSettings *search_settings;
@@ -868,6 +869,14 @@ populate_search_providers (CcSearchPanel *self)
}
static void
+on_row_selected (GtkListBox *list_box,
+ GtkListBoxRow *row,
+ CcSearchPanel *self)
+{
+ gtk_revealer_set_reveal_child (GTK_REVEALER (self->priv->notification), TRUE);
+}
+
+static void
cc_search_panel_dispose (GObject *object)
{
CcSearchPanelPrivate *priv = CC_SEARCH_PANEL (object)->priv;
@@ -992,6 +1001,9 @@ cc_search_panel_init (CcSearchPanel *self)
gtk_container_add (GTK_CONTAINER (frame), widget);
self->priv->list_box = widget;
gtk_widget_show (widget);
+ g_signal_connect (widget, "row-selected", G_CALLBACK (on_row_selected), self);
+
+ self->priv->notification = WID ("notification");
/* Drag and Drop */
gtk_drag_dest_set (self->priv->list_box,
diff --git a/panels/search/search.ui b/panels/search/search.ui
index 4f446dcf2..2d9756467 100644
--- a/panels/search/search.ui
+++ b/panels/search/search.ui
@@ -1,7 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <object class="GtkScrolledWindow" id="search_vbox">
+<object class="GtkOverlay" id="search_vbox">
+ <property name="visible">True</property>
+ <child type="overlay">
+ <object class="GtkRevealer" id="notification">
+ <property name="visible">True</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
+ <property name="border-width">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Use Alt+↑ and Alt+↓ to move rows</property>
+ <style>
+ <class name="app-notification"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolled_window">
<property name="visible">True</property>
<property name="hscrollbar_policy">never</property>
<property name="min_content_height">450</property>
@@ -85,4 +105,6 @@
</object>
</child>
</object>
+ </child>
+</object>
</interface>