[Xfce4-commits] [xfce/xfce4-panel] 01/01: windowmenu: Replace deprecated gtk_widget_modify_font

noreply at xfce.org noreply at xfce.org
Wed Aug 21 18:10:58 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit cd8cad6baf6927b441fac22b13b107e80dae2a0a
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed Aug 21 18:10:24 2019 +0200

    windowmenu: Replace deprecated gtk_widget_modify_font
---
 plugins/windowmenu/windowmenu.c | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/plugins/windowmenu/windowmenu.c b/plugins/windowmenu/windowmenu.c
index 73d5dfb..cca4e1d 100644
--- a/plugins/windowmenu/windowmenu.c
+++ b/plugins/windowmenu/windowmenu.c
@@ -853,9 +853,10 @@ window_menu_plugin_menu_workspace_item_active (GtkWidget     *mi,
 static GtkWidget *
 window_menu_plugin_menu_workspace_item_new (WnckWorkspace        *workspace,
                                             WindowMenuPlugin     *plugin,
-                                            PangoFontDescription *bold)
+                                            gboolean              bold)
 {
   const gchar *name;
+  gchar       *label_text = NULL;
   gchar       *utf8 = NULL, *name_num = NULL;
   GtkWidget   *mi, *label;
 
@@ -883,8 +884,15 @@ window_menu_plugin_menu_workspace_item_new (WnckWorkspace        *workspace,
   gtk_label_set_max_width_chars (GTK_LABEL (label), plugin->max_width_chars);
 
   /* modify the label font if needed */
-  if (bold != NULL)
-    gtk_widget_modify_font (label, bold);
+  if (bold)
+    label_text = g_strdup_printf ("<b>%s</b>", name);
+  else
+    label_text = g_strdup_printf ("<i>%s</i>", name);
+  if (label_text)
+  {
+    gtk_label_set_markup (GTK_LABEL (label), label_text);
+    g_free (label_text);
+  }
 
   g_free (utf8);
   g_free (name_num);
@@ -967,6 +975,7 @@ window_menu_plugin_menu_window_item_new (WnckWindow           *window,
                                          gint                  icon_h)
 {
   const gchar *name, *tooltip;
+  gchar       *label_text = NULL;
   gchar       *utf8 = NULL;
   gchar       *decorated = NULL;
   GtkWidget   *mi, *label, *image;
@@ -1006,14 +1015,19 @@ G_GNUC_END_IGNORE_DEPRECATIONS
   /* make the label pretty on long window names */
   label = gtk_bin_get_child (GTK_BIN (mi));
   panel_return_val_if_fail (GTK_IS_LABEL (label), NULL);
-  gtk_label_set_ellipsize (GTK_LABEL (label), plugin->ellipsize_mode);
-  gtk_label_set_max_width_chars (GTK_LABEL (label), plugin->max_width_chars);
-
   /* modify the label font if needed */
   if (wnck_window_is_active (window))
-    gtk_widget_modify_font (label, italic);
+    label_text = g_strdup_printf ("<b><i>%s</i></b>", name);
   else if (wnck_window_or_transient_needs_attention (window))
-    gtk_widget_modify_font (label, bold);
+    label_text = g_strdup_printf ("<b>%s</b>", name);
+  if (label_text)
+    {
+      gtk_label_set_markup (GTK_LABEL (label), label_text);
+      g_free (label_text);
+    }
+
+  gtk_label_set_ellipsize (GTK_LABEL (label), plugin->ellipsize_mode);
+  gtk_label_set_max_width_chars (GTK_LABEL (label), plugin->max_width_chars);
 
   if (plugin->minimized_icon_lucency > 0)
     {
@@ -1204,7 +1218,7 @@ window_menu_plugin_menu_new (WindowMenuPlugin *plugin)
         {
           /* create the workspace menu item */
           mi = window_menu_plugin_menu_workspace_item_new (workspace, plugin,
-              workspace == active_workspace ? bold : italic);
+              workspace == active_workspace);
           gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
           gtk_widget_show (mi);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list