[libadwaita/wip/exalm/tab-overview] Demo



commit f5aba5b61e3eab4a2d1b6178c03664c3cec75a11
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Aug 28 21:02:25 2022 +0400

    Demo

 demo/pages/tab-view/adw-tab-view-demo-window.c  | 16 ++++++++++++++++
 demo/pages/tab-view/adw-tab-view-demo-window.ui |  3 ---
 demo/style.css                                  |  5 +++++
 3 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/demo/pages/tab-view/adw-tab-view-demo-window.c b/demo/pages/tab-view/adw-tab-view-demo-window.c
index 575eacd2..19e731ca 100644
--- a/demo/pages/tab-view/adw-tab-view-demo-window.c
+++ b/demo/pages/tab-view/adw-tab-view-demo-window.c
@@ -608,6 +608,8 @@ static void
 adw_tab_view_demo_window_init (AdwTabViewDemoWindow *self)
 {
   GActionMap *action_map;
+  GdkDisplay *display;
+  AdwStyleManager *style_manager;
 
   gtk_widget_init_template (GTK_WIDGET (self));
 
@@ -636,6 +638,18 @@ adw_tab_view_demo_window_init (AdwTabViewDemoWindow *self)
   adw_tab_overview_setup_extra_drop_target (self->tab_overview,
                                             GDK_ACTION_COPY,
                                             (GType[1]) { G_TYPE_STRING }, 1);
+
+  display = gtk_widget_get_display (GTK_WIDGET (self));
+  style_manager = adw_style_manager_get_for_display (display);
+
+  g_signal_connect_object (style_manager, "notify::dark",
+                           G_CALLBACK (adw_tab_view_queue_refresh_thumbnails),
+                           self->view,
+                           G_CONNECT_SWAPPED);
+  g_signal_connect_object (style_manager, "notify::high-contrast",
+                           G_CALLBACK (adw_tab_view_queue_refresh_thumbnails),
+                           self->view,
+                           G_CONNECT_SWAPPED);
 }
 
 AdwTabViewDemoWindow *
@@ -650,4 +664,6 @@ adw_tab_view_demo_window_prepopulate (AdwTabViewDemoWindow *self)
   tab_new (NULL, NULL, self);
   tab_new (NULL, NULL, self);
   tab_new (NULL, NULL, self);
+
+  adw_tab_view_queue_refresh_thumbnails (self->view);
 }
diff --git a/demo/pages/tab-view/adw-tab-view-demo-window.ui b/demo/pages/tab-view/adw-tab-view-demo-window.ui
index 440cbd92..11784b0f 100644
--- a/demo/pages/tab-view/adw-tab-view-demo-window.ui
+++ b/demo/pages/tab-view/adw-tab-view-demo-window.ui
@@ -63,9 +63,6 @@
                 <signal name="setup-menu" handler="setup_menu_cb" swapped="true"/>
                 <signal name="create-window" handler="create_window_cb" swapped="true"/>
                 <signal name="indicator-activated" handler="indicator_activated_cb" swapped="true"/>
-                <style>
-                  <class name="view"/>
-                </style>
               </object>
             </child>
           </object>
diff --git a/demo/style.css b/demo/style.css
index 53aa8b52..10dfe79a 100644
--- a/demo/style.css
+++ b/demo/style.css
@@ -48,3 +48,8 @@ flowbox.inline flowboxchild {
   border-radius: 24px;
   background: linear-gradient(to bottom, @green_2, @green_5);
 }
+
+tabview > * {
+  background-color: @view_bg_color;
+  color: @view_fg_color;
+}


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