[gimp] libgimp: make GimpFontSelectButton interpret NULL as the current font



commit 89feeecc96614ba38c6fd20d474302da0738280f
Author: Michael Natterer <mitch gimp org>
Date:   Sun Aug 4 17:14:18 2019 +0200

    libgimp: make GimpFontSelectButton interpret NULL as the current font
    
    like all other select buttons do.

 libgimp/gimpbrushselectbutton.c |  2 --
 libgimp/gimpfontselectbutton.c  | 17 +++++++++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/libgimp/gimpbrushselectbutton.c b/libgimp/gimpbrushselectbutton.c
index 6df97de2dd..07f982b9c8 100644
--- a/libgimp/gimpbrushselectbutton.c
+++ b/libgimp/gimpbrushselectbutton.c
@@ -298,8 +298,6 @@ gimp_brush_select_button_init (GimpBrushSelectButton *button)
 
   priv->inside = gimp_brush_select_button_create_inside (button);
   gtk_container_add (GTK_CONTAINER (button), priv->inside);
-
-  priv->popup = NULL;
 }
 
 /**
diff --git a/libgimp/gimpfontselectbutton.c b/libgimp/gimpfontselectbutton.c
index 1c2e1b5382..5d0a802c6c 100644
--- a/libgimp/gimpfontselectbutton.c
+++ b/libgimp/gimpfontselectbutton.c
@@ -252,9 +252,22 @@ gimp_font_select_button_set_font (GimpFontSelectButton *button,
   select_button = GIMP_SELECT_BUTTON (button);
 
   if (select_button->temp_callback)
-    gimp_fonts_set_popup (select_button->temp_callback, font_name);
+    {
+      gimp_fonts_set_popup (select_button->temp_callback, font_name);
+    }
   else
-    gimp_font_select_button_callback (font_name, FALSE, button);
+    {
+      gchar *name;
+
+      if (font_name && *font_name)
+        name = g_strdup (font_name);
+      else
+        name = gimp_context_get_font ();
+
+      gimp_font_select_button_callback (name, FALSE, button);
+
+      g_free (name);
+    }
 }
 
 


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