[totem] main: Set CSD titlebar with Grilo



commit 81d0fcb13d3161f248d5105ed7323a081b9a6825
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jan 31 09:31:37 2014 +0100

    main: Set CSD titlebar with Grilo

 src/grilo.ui      |   14 --------------
 src/totem-grilo.c |   12 +++++++++++-
 src/totem.c       |    1 -
 3 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/src/grilo.ui b/src/grilo.ui
index 45d741e..5c47e7f 100644
--- a/src/grilo.ui
+++ b/src/grilo.ui
@@ -98,20 +98,6 @@
     <property name="spacing">0</property>
     <property name="orientation">vertical</property>
     <child>
-      <object class="TotemMainToolbar" id="header">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="show-search-button">True</property>
-        <property name="show-select-button">True</property>
-        <property name="select-menu-model">selectmenu</property>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">0</property>
-      </packing>
-    </child>
-    <child>
       <object class="GtkSearchBar" id="search_bar">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 5e0ec29..204ceaf 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -73,6 +73,7 @@ struct _TotemGriloPrivate {
 
        /* Toolbar widgets */
        GtkWidget *header;
+       GMenuModel *selectmenu;
        GSimpleAction *select_all_action;
        GSimpleAction *select_none_action;
        GtkWidget *switcher;
@@ -1876,6 +1877,15 @@ setup_browse (TotemGrilo *self)
                          G_CALLBACK (search_entry_source_changed_cb), self);
 
        /* Toolbar */
+       self->priv->header = g_object_new (TOTEM_TYPE_MAIN_TOOLBAR,
+                                          "show-search-button", TRUE,
+                                          "show-select-button", TRUE,
+                                          "show-close-button", TRUE,
+                                          "select-menu-model", self->priv->selectmenu,
+                                          NULL);
+       gtk_widget_show_all (self->priv->header);
+       gtk_window_set_titlebar (GTK_WINDOW (self->priv->main_window), self->priv->header);
+
        self->priv->select_all_action = g_simple_action_new ("select-all", NULL);
        g_signal_connect (G_OBJECT (self->priv->select_all_action), "activate",
                          G_CALLBACK (select_all_action_cb), self);
@@ -2177,7 +2187,7 @@ totem_grilo_class_init (TotemGriloClass *klass)
                                                              G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
 
        gtk_widget_class_set_template_from_resource (widget_class, "/org/totem/grilo/grilo.ui");
-       gtk_widget_class_bind_template_child_private (widget_class, TotemGrilo, header);
+       gtk_widget_class_bind_template_child_private (widget_class, TotemGrilo, selectmenu);
        gtk_widget_class_bind_template_child_private (widget_class, TotemGrilo, search_bar);
        gtk_widget_class_bind_template_child_private (widget_class, TotemGrilo, search_entry);
        gtk_widget_class_bind_template_child_private (widget_class, TotemGrilo, browser);
diff --git a/src/totem.c b/src/totem.c
index d61870c..9e89ace 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -105,7 +105,6 @@ app_init (Totem *totem, char **argv)
        set_rtl_icon_name (totem, "previous-chapter", "media-skip-backward");
 
        totem->win = GTK_WIDGET (gtk_builder_get_object (totem->xml, "totem_main_window"));
-       gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (totem->win), TRUE);
 
        /* Menubar */
        totem->stack = GTK_WIDGET (gtk_builder_get_object (totem->xml, "tmw_main_stack"));


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