[libdazzle] examples: log information about titlebar transition changes



commit 11c499abe55f70f3a6e0b7236f8f67dd3d14bff9
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 1 15:04:24 2020 -0700

    examples: log information about titlebar transition changes

 examples/app/example-window.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/examples/app/example-window.c b/examples/app/example-window.c
index 4e59b65..0fca32a 100644
--- a/examples/app/example-window.c
+++ b/examples/app/example-window.c
@@ -142,6 +142,23 @@ on_page_changed (GtkNotebook   *notebook,
   gtk_header_bar_set_subtitle (self->header_bar, subtitle);
 }
 
+static void
+on_titlebar_animation (ExampleWindow *self,
+                       GParamSpec    *pspec)
+{
+  g_autoptr(GEnumClass) enum_class = NULL;
+  DzlTitlebarAnimation mode;
+  GEnumValue *value;
+
+  g_assert (EXAMPLE_IS_WINDOW (self));
+
+  mode = dzl_application_window_get_titlebar_animation (DZL_APPLICATION_WINDOW (self));
+
+  enum_class = g_type_class_ref (DZL_TYPE_TITLEBAR_ANIMATION);
+  value = g_enum_get_value (enum_class, mode);
+  g_print ("Titlebar Animation: %s\n", value->value_nick);
+}
+
 static void
 example_window_class_init (ExampleWindowClass *klass)
 {
@@ -164,6 +181,11 @@ example_window_init (ExampleWindow *self)
 
   gtk_widget_init_template (GTK_WIDGET (self));
 
+  g_signal_connect (self,
+                    "notify::titlebar-animation",
+                    G_CALLBACK (on_titlebar_animation),
+                    NULL);
+
   g_signal_connect (self->notebook,
                     "notify::page",
                     G_CALLBACK (on_page_changed),


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