[gtk/wip/matthiasc/context-menu] widget-factory: Update the touch bubble example



commit 18bb2a3a4ee069d6747c2cc03c5c703d6ccedcc6
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 29 00:13:44 2019 -0500

    widget-factory: Update the touch bubble example
    
    Make the text formatting actions sho up in the
    touch example as well.

 demos/widget-factory/widget-factory.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 01bb0e191c..14139923a4 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -1325,7 +1325,7 @@ toggle_format (GSimpleAction *action,
   if (g_variant_get_boolean (value))
     gtk_text_buffer_apply_tag_by_name (gtk_text_view_get_buffer (text_view), name, &start, &end);
   else
-    gtk_text_buffer_remove_tag_by_name (gtk_text_view_get_buffer (text_view), "bold", &start, &end);
+    gtk_text_buffer_remove_tag_by_name (gtk_text_view_get_buffer (text_view), name, &start, &end);
 }
 
 static GActionGroup *actions;
@@ -1401,13 +1401,15 @@ text_view_add_to_context_menu (GtkTextView *text_view)
 
   menu = gtk_text_view_get_default_context_menu (text_view);
   item = g_menu_item_new (_("Bold"), "format.bold");
-  //g_menu_item_set_attribute (item, "touch-icon", "s", "edit-clear-symbolic");
+  g_menu_item_set_attribute (item, "touch-icon", "s", "format-text-bold-symbolic");
   g_menu_append_item (G_MENU (menu), item);
   g_object_unref (item);
   item = g_menu_item_new (_("Italics"), "format.italic");
+  g_menu_item_set_attribute (item, "touch-icon", "s", "format-text-italic-symbolic");
   g_menu_append_item (G_MENU (menu), item);
   g_object_unref (item);
   item = g_menu_item_new (_("Underline"), "format.underline");
+  g_menu_item_set_attribute (item, "touch-icon", "s", "format-text-underline-symbolic");
   g_menu_append_item (G_MENU (menu), item);
 
   gtk_widget_set_context_menu (GTK_WIDGET (text_view), menu);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]