[gnome-builder] plugins/buildui: add missing shadow when scrolling



commit 405b3915298c59464ee7ae0efa72cbea5f8e6623
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jul 20 12:30:55 2022 -0700

    plugins/buildui: add missing shadow when scrolling

 src/plugins/buildui/gbp-buildui-targets-dialog.c  | 23 +++++++++++++++++++----
 src/plugins/buildui/gbp-buildui-targets-dialog.ui |  2 +-
 2 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/buildui/gbp-buildui-targets-dialog.c 
b/src/plugins/buildui/gbp-buildui-targets-dialog.c
index 24a33836e..fda3ea179 100644
--- a/src/plugins/buildui/gbp-buildui-targets-dialog.c
+++ b/src/plugins/buildui/gbp-buildui-targets-dialog.c
@@ -32,10 +32,11 @@
 
 struct _GbpBuilduiTargetsDialog
 {
-  AdwWindow   parent_instance;
-  GtkListBox *list_box;
-  GtkSpinner *spinner;
-  guint       busy : 1;
+  AdwWindow           parent_instance;
+  AdwPreferencesPage *page;
+  GtkListBox         *list_box;
+  GtkSpinner         *spinner;
+  guint               busy : 1;
 };
 
 G_DEFINE_FINAL_TYPE (GbpBuilduiTargetsDialog, gbp_buildui_targets_dialog, ADW_TYPE_WINDOW)
@@ -240,6 +241,7 @@ gbp_buildui_targets_dialog_class_init (GbpBuilduiTargetsDialogClass *klass)
   gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/plugins/buildui/gbp-buildui-targets-dialog.ui");
+  gtk_widget_class_bind_template_child (widget_class, GbpBuilduiTargetsDialog, page);
   gtk_widget_class_bind_template_child (widget_class, GbpBuilduiTargetsDialog, list_box);
   gtk_widget_class_bind_template_child (widget_class, GbpBuilduiTargetsDialog, spinner);
 }
@@ -248,4 +250,17 @@ static void
 gbp_buildui_targets_dialog_init (GbpBuilduiTargetsDialog *self)
 {
   gtk_widget_init_template (GTK_WIDGET (self));
+
+#ifdef DEVELOPMENT_BUILD
+  gtk_widget_add_css_class (GTK_WIDGET (self), "devel");
+#endif
+
+  for (GtkWidget *child = gtk_widget_get_first_child (GTK_WIDGET (self->page));
+       child != NULL;
+       child = gtk_widget_get_next_sibling (child))
+    {
+      if (GTK_IS_SCROLLED_WINDOW (child))
+        gtk_widget_add_css_class (child, "shadow-when-scroll");
+    }
+
 }
diff --git a/src/plugins/buildui/gbp-buildui-targets-dialog.ui 
b/src/plugins/buildui/gbp-buildui-targets-dialog.ui
index 206053c2d..f995bc599 100644
--- a/src/plugins/buildui/gbp-buildui-targets-dialog.ui
+++ b/src/plugins/buildui/gbp-buildui-targets-dialog.ui
@@ -12,7 +12,7 @@
           </object>
         </child>
         <child>
-          <object class="AdwPreferencesPage">
+          <object class="AdwPreferencesPage" id="page">
             <child>
               <object class="AdwPreferencesGroup">
                 <property name="title" translatable="yes">Available Build Targets</property>


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