icon browser: Stop using gtk_widget_show/hide
authorMatthias Clasen <mclasen@redhat.com>
Mon, 28 Nov 2022 11:26:28 +0000 (06:26 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 28 Nov 2022 19:34:55 +0000 (14:34 -0500)
demos/icon-browser/iconbrowserwin.c

index d0da5c464c5c320b0d8c17a47f5494e642a5cadd..de0dea873f95d47fc46da878217d7ee8c921b158 100644 (file)
@@ -192,26 +192,13 @@ item_activated (GtkGridView       *view,
   set_image (win->image5, name, 32);
   set_image (win->image6, name, 48);
   set_image (win->image7, name, 64);
+  gtk_widget_set_visible (win->image8, symbolic);
+  gtk_widget_set_visible (win->label8, symbolic);
   if (symbolic)
-    {
-      gtk_widget_show (win->image8);
-      gtk_widget_show (win->label8);
-      set_image (win->image8, name, 64);
-    }
-  else
-    {
-      gtk_widget_hide (win->image8);
-      gtk_widget_hide (win->label8);
-    }
+    set_image (win->image8, name, 64);
+  gtk_widget_set_visible (win->description, description && description[0]);
   if (description && description[0])
-    {
-      gtk_label_set_text (GTK_LABEL (win->description), description);
-      gtk_widget_show (win->description);
-    }
-  else
-    {
-      gtk_widget_hide (win->description);
-    }
+    gtk_label_set_text (GTK_LABEL (win->description), description);
 
   gtk_window_present (GTK_WINDOW (win->details));