[gupnp-tools] av-cp: Use headerbars in DIDL-Lite dialog



commit f442fefc757cd1135f7bdab0897bf437c918e20b
Author: Jens Georg <mail jensge org>
Date:   Sat Jul 18 14:57:47 2020 +0200

    av-cp: Use headerbars in DIDL-Lite dialog

 data/didl-lite-dialog.ui.in |  5 ++++-
 src/av-cp/didl-dialog.c     | 12 +++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/data/didl-lite-dialog.ui.in b/data/didl-lite-dialog.ui.in
index 15cbf46..7261e27 100644
--- a/data/didl-lite-dialog.ui.in
+++ b/data/didl-lite-dialog.ui.in
@@ -11,6 +11,9 @@
     <property name="default_height">480</property>
     <property name="type_hint">dialog</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no"/>
+    <child type="titlebar">
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox">
         <property name="visible">True</property>
@@ -67,7 +70,7 @@
       </object>
     </child>
     <action-widgets>
-      <action-widget response="0">didl-close-button</action-widget>
+      <action-widget response="-7">didl-close-button</action-widget>
     </action-widgets>
   </template>
 </interface>
diff --git a/src/av-cp/didl-dialog.c b/src/av-cp/didl-dialog.c
index 489f688..d13cdff 100644
--- a/src/av-cp/didl-dialog.c
+++ b/src/av-cp/didl-dialog.c
@@ -109,7 +109,17 @@ av_cp_didl_dialog_constructed (GObject *object)
 AVCPDidlDialog *
 av_cp_didl_dialog_new (void)
 {
-        return g_object_new (AV_CP_TYPE_DIDL_DIALOG, NULL);
+        GtkSettings *settings = gtk_settings_get_default ();
+        int use_header;
+
+        g_object_get (G_OBJECT (settings),
+                                "gtk-dialogs-use-header",
+                                &use_header,
+                                NULL);
+
+        return g_object_new (AV_CP_TYPE_DIDL_DIALOG,
+                             "use-header-bar", use_header == 1 ? TRUE : FALSE,
+                             NULL);
 }
 
 void


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