[gtk/theme-redux: 2/7] inspector: Stop dealing with prefer-dark



commit def96ed2a184f72f39a9527e645afe66a1a4253f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Apr 11 15:51:22 2020 -0400

    inspector: Stop dealing with prefer-dark
    
    This setting is going away.

 gtk/inspector/visual.c  | 29 +----------------------------
 gtk/inspector/visual.ui | 28 ----------------------------
 2 files changed, 1 insertion(+), 56 deletions(-)
---
diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c
index 46349bd595..debcc768bd 100644
--- a/gtk/inspector/visual.c
+++ b/gtk/inspector/visual.c
@@ -62,7 +62,6 @@ struct _GtkInspectorVisualPrivate
   GtkWidget *box;
   GtkWidget *visual_box;
   GtkWidget *theme_combo;
-  GtkWidget *dark_switch;
   GtkWidget *icon_combo;
   GtkWidget *cursor_combo;
   GtkWidget *cursor_size_spin;
@@ -583,25 +582,6 @@ init_theme (GtkInspectorVisual *vis)
     }
 }
 
-static void
-init_dark (GtkInspectorVisual *vis)
-{
-  g_object_bind_property (gtk_settings_get_for_display (vis->priv->display),
-                          "gtk-application-prefer-dark-theme",
-                          vis->priv->dark_switch, "active",
-                          G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
-
-  if (g_getenv ("GTK_THEME") != NULL)
-    {
-      GtkWidget *row;
-
-      /* theme is hardcoded, nothing we can do */
-      gtk_widget_set_sensitive (vis->priv->dark_switch, FALSE);
-      row = gtk_widget_get_ancestor (vis->priv->theme_combo, GTK_TYPE_LIST_BOX_ROW);
-      gtk_widget_set_tooltip_text (row, _("Theme is hardcoded by GTK_THEME"));
-    }
-}
-
 static void
 fill_icons (const gchar *path,
             GHashTable  *t)
@@ -959,12 +939,7 @@ row_activated (GtkListBox         *box,
                GtkListBoxRow      *row,
                GtkInspectorVisual *vis)
 {
-  if (gtk_widget_is_ancestor (vis->priv->dark_switch, GTK_WIDGET (row)))
-    {
-      GtkSwitch *sw = GTK_SWITCH (vis->priv->dark_switch);
-      gtk_switch_set_active (sw, !gtk_switch_get_active (sw));
-    }
-  else if (gtk_widget_is_ancestor (vis->priv->animation_switch, GTK_WIDGET (row)))
+  if (gtk_widget_is_ancestor (vis->priv->animation_switch, GTK_WIDGET (row)))
     {
       GtkSwitch *sw = GTK_SWITCH (vis->priv->animation_switch);
       gtk_switch_set_active (sw, !gtk_switch_get_active (sw));
@@ -1125,7 +1100,6 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, box);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, direction_combo);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, theme_combo);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, dark_switch);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, cursor_combo);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, cursor_size_spin);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, cursor_size_adjustment);
@@ -1172,7 +1146,6 @@ gtk_inspector_visual_set_display  (GtkInspectorVisual *vis,
 
   init_direction (vis);
   init_theme (vis);
-  init_dark (vis);
   init_icons (vis);
   init_cursors (vis);
   init_cursor_size (vis);
diff --git a/gtk/inspector/visual.ui b/gtk/inspector/visual.ui
index bbac09de1d..10b4f4856e 100644
--- a/gtk/inspector/visual.ui
+++ b/gtk/inspector/visual.ui
@@ -74,34 +74,6 @@
                         </child>
                       </object>
                     </child>
-                    <child>
-                      <object class="GtkListBoxRow">
-                        <child>
-                          <object class="GtkBox">
-                            <property name="margin-start">10</property>
-                            <property name="margin-end">10</property>
-                            <property name="margin-top">10</property>
-                            <property name="margin-bottom">10</property>
-                            <property name="spacing">40</property>
-                            <child>
-                              <object class="GtkLabel" id="dark_label">
-                                <property name="label" translatable="yes">Dark Variant</property>
-                                <property name="halign">start</property>
-                                <property name="valign">baseline</property>
-                                <property name="xalign">0.0</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkSwitch" id="dark_switch">
-                                <property name="halign">end</property>
-                                <property name="valign">baseline</property>
-                                <property name="hexpand">1</property>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
                     <child>
                       <object class="GtkListBoxRow">
                         <property name="activatable">0</property>


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