[gtk+] shortcuts: Show icons and subtitles for gestures in search results
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] shortcuts: Show icons and subtitles for gestures in search results
- Date: Sun, 3 Jan 2016 16:10:52 +0000 (UTC)
commit bd4b3091f6e1f900d4a3effcfd93d7c97f46ef1c
Author: Felix Riemann <friemann gnome org>
Date: Sun Jan 3 15:22:06 2016 +0100
shortcuts: Show icons and subtitles for gestures in search results
https://bugzilla.gnome.org/show_bug.cgi?id=760097
gtk/gtkshortcutswindow.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 5fa7667..4a61478 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -182,7 +182,12 @@ gtk_shortcuts_window_add_search_item (GtkWidget *child, gpointer data)
gchar *accelerator = NULL;
gchar *title = NULL;
gchar *hash_key = NULL;
+ GIcon *icon = NULL;
+ gboolean icon_set = FALSE;
+ gboolean subtitle_set = FALSE;
GtkTextDirection direction;
+ GtkShortcutType shortcut_type;
+ gchar *subtitle;
gchar *str;
gchar *keywords;
@@ -192,6 +197,9 @@ gtk_shortcuts_window_add_search_item (GtkWidget *child, gpointer data)
"accelerator", &accelerator,
"title", &title,
"direction", &direction,
+ "icon-set", &icon_set,
+ "subtitle-set", &subtitle_set,
+ "shortcut-type", &shortcut_type,
NULL);
hash_key = g_strdup_printf ("%s-%s", title, accelerator);
@@ -209,10 +217,22 @@ gtk_shortcuts_window_add_search_item (GtkWidget *child, gpointer data)
"accelerator", accelerator,
"title", title,
"direction", direction,
+ "shortcut-type", shortcut_type,
"accel-size-group", priv->search_image_group,
"title-size-group", priv->search_text_group,
NULL);
-
+ if (icon_set)
+ {
+ g_object_get (child, "icon", &icon, NULL);
+ g_object_set (item, "icon", icon, NULL);
+ g_clear_object (&icon);
+ }
+ if (subtitle_set)
+ {
+ g_object_get (child, "subtitle", &subtitle, NULL);
+ g_object_set (item, "subtitle", subtitle, NULL);
+ g_free (subtitle);
+ }
str = g_strdup_printf ("%s %s", accelerator, title);
keywords = g_utf8_strdown (str, -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]