[gtk/gtk-3-24: 1/2] fontchooser: Fix size label not being hidden



commit b5ea2c78d681804898241c19356a211b623de801
Author: James Westman <flyingpimonster gmail com>
Date:   Tue Jan 14 16:01:16 2020 -0600

    fontchooser: Fix size label not being hidden
    
    Even when the level property of a font chooser did not include
    GTK_FONT_CHOOSER_LEVEL_SIZE, the "Size" label was still displayed.
    
    Fixes #2378.

 gtk/gtkfontchooserwidget.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index b858d92c29..8d48cd5ff7 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -112,6 +112,7 @@ struct _GtkFontChooserWidgetPrivate
   gchar           *preview_text;
   gboolean         show_preview_entry;
 
+  GtkWidget *size_label;
   GtkWidget *size_spin;
   GtkWidget *size_slider;
   GtkWidget *size_slider2;
@@ -715,6 +716,7 @@ gtk_font_chooser_widget_class_init (GtkFontChooserWidgetClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, filter_model);
   gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, preview);
   gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, preview2);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_label);
   gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_spin);
   gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_slider);
   gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserWidget, size_slider2);
@@ -2466,11 +2468,13 @@ gtk_font_chooser_widget_set_level (GtkFontChooserWidget *fontchooser,
     {
       gtk_widget_show (priv->size_slider);
       gtk_widget_show (priv->size_spin);
+      gtk_widget_show (priv->size_label);
     }
   else
    {
       gtk_widget_hide (priv->size_slider);
       gtk_widget_hide (priv->size_spin);
+      gtk_widget_hide (priv->size_label);
    }
 
   gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);


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