[gtk/default-handling: 24/25] inspector: Stop showing default widget in misc



commit 8880d274603dcd5cb99fd917772df1061c9c339c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 28 19:25:31 2019 +0000

    inspector: Stop showing default widget in misc
    
    This is just a regular window property now,
    no need for special casing.

 gtk/inspector/misc-info.c  | 53 ----------------------------------------------
 gtk/inspector/misc-info.ui | 36 -------------------------------
 2 files changed, 89 deletions(-)
---
diff --git a/gtk/inspector/misc-info.c b/gtk/inspector/misc-info.c
index f082553a6b..44d37a5870 100644
--- a/gtk/inspector/misc-info.c
+++ b/gtk/inspector/misc-info.c
@@ -47,9 +47,6 @@ struct _GtkInspectorMiscInfoPrivate {
   GtkWidget *state;
   GtkWidget *buildable_id_row;
   GtkWidget *buildable_id;
-  GtkWidget *default_widget_row;
-  GtkWidget *default_widget;
-  GtkWidget *default_widget_button;
   GtkWidget *mnemonic_label_row;
   GtkWidget *mnemonic_label;
   GtkWidget *request_mode_row;
@@ -186,38 +183,6 @@ show_object (GtkInspectorMiscInfo *sl,
   gtk_inspector_object_tree_select_object (sl->priv->object_tree, object);
 }
 
-static void
-update_default_widget (GtkInspectorMiscInfo *sl)
-{
-  GtkWidget *widget;
-
-  widget = gtk_window_get_default_widget (GTK_WINDOW (sl->priv->object));
-  if (widget)
-    {
-      gchar *tmp;
-      tmp = g_strdup_printf ("%p", widget);
-      gtk_label_set_label (GTK_LABEL (sl->priv->default_widget), tmp);
-      g_free (tmp);
-      gtk_widget_set_sensitive (sl->priv->default_widget_button, TRUE);
-    }
-  else
-    {
-      gtk_label_set_label (GTK_LABEL (sl->priv->default_widget), "NULL");   
-      gtk_widget_set_sensitive (sl->priv->default_widget_button, FALSE);
-    }
-}
-
-static void
-show_default_widget (GtkWidget *button, GtkInspectorMiscInfo *sl)
-{
-  GtkWidget *widget;
-
-  update_default_widget (sl);
-  widget = gtk_window_get_default_widget (GTK_WINDOW (sl->priv->object));
-  if (widget)
-    show_object (sl, G_OBJECT (widget), "properties"); 
-}
-
 static void
 show_mnemonic_label (GtkWidget *button, GtkInspectorMiscInfo *sl)
 {
@@ -326,11 +291,6 @@ update_info (gpointer data)
                           gtk_buildable_get_name (GTK_BUILDABLE (sl->priv->object)));
     }
 
-  if (GTK_IS_WINDOW (sl->priv->object))
-    {
-      update_default_widget (sl);
-    }
-
   if (GDK_IS_FRAME_CLOCK (sl->priv->object))
     {
       GdkFrameClock *clock;
@@ -441,15 +401,6 @@ gtk_inspector_misc_info_set_object (GtkInspectorMiscInfo *sl,
       gtk_widget_hide (sl->priv->buildable_id_row);
     }
 
-  if (GTK_IS_WINDOW (object))
-    {
-      gtk_widget_show (sl->priv->default_widget_row);
-    }
-  else
-    {
-      gtk_widget_hide (sl->priv->default_widget_row);
-    }
-
   if (GDK_IS_FRAME_CLOCK (object))
     {
       gtk_widget_show (sl->priv->framecount_row);
@@ -563,9 +514,6 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, state);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, buildable_id_row);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, buildable_id);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, default_widget_row);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, default_widget);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, default_widget_button);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, mnemonic_label_row);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, mnemonic_label);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, request_mode_row);
@@ -598,7 +546,6 @@ gtk_inspector_misc_info_class_init (GtkInspectorMiscInfoClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, child_visible_row);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorMiscInfo, child_visible);
 
-  gtk_widget_class_bind_template_callback (widget_class, show_default_widget);
   gtk_widget_class_bind_template_callback (widget_class, show_frame_clock);
 }
 
diff --git a/gtk/inspector/misc-info.ui b/gtk/inspector/misc-info.ui
index 414a5d2fc1..dcfcc8b8a3 100644
--- a/gtk/inspector/misc-info.ui
+++ b/gtk/inspector/misc-info.ui
@@ -148,41 +148,6 @@
                     </child>
                   </object>
                 </child>
-                <child>
-                  <object class="GtkListBoxRow" id="default_widget_row">
-                    <property name="activatable">0</property>
-                    <child>
-                      <object class="GtkBox">
-                        <property name="margin">10</property>
-                        <property name="spacing">40</property>
-                        <child>
-                          <object class="GtkLabel" id="default_widget_label">
-                            <property name="label" translatable="yes">Default Widget</property>
-                            <property name="halign">start</property>
-                            <property name="valign">baseline</property>
-                            <property name="xalign">0.0</property>
-                            <property name="hexpand">1</property>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="default_widget">
-                            <property name="selectable">1</property>
-                            <property name="halign">end</property>
-                            <property name="valign">baseline</property>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkButton" id="default_widget_button">
-                            <property name="halign">end</property>
-                            <property name="valign">baseline</property>
-                            <property name="label" translatable="yes">Properties</property>
-                            <signal name="clicked" handler="show_default_widget"/>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                </child>
                 <child>
                   <object class="GtkListBoxRow" id="mnemonic_label_row">
                     <property name="activatable">0</property>
@@ -605,7 +570,6 @@
       <widget name="refcount_label"/>
       <widget name="state_label"/>
       <widget name="buildable_id_label"/>
-      <widget name="default_widget_label"/>
       <widget name="frame_clock_label"/>
     </widgets>
   </object>


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