[gnome-software] sources dialog: Set headerbar as an internal child in the .ui file
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] sources dialog: Set headerbar as an internal child in the .ui file
- Date: Fri, 21 Mar 2014 11:27:35 +0000 (UTC)
commit 167e034cde073c8d166749cc2db2671ea79101f1
Author: Kalev Lember <kalevlember gmail com>
Date: Sat Mar 15 14:37:42 2014 +0100
sources dialog: Set headerbar as an internal child in the .ui file
https://bugzilla.gnome.org/show_bug.cgi?id=726413
src/gs-sources-dialog.c | 7 ----
src/gs-sources-dialog.ui | 77 +++++++++++++++++++++------------------------
2 files changed, 36 insertions(+), 48 deletions(-)
---
diff --git a/src/gs-sources-dialog.c b/src/gs-sources-dialog.c
index b97b81a..1aec22b 100644
--- a/src/gs-sources-dialog.c
+++ b/src/gs-sources-dialog.c
@@ -35,7 +35,6 @@ struct _GsSourcesDialogPrivate
GtkWidget *button_back;
GtkWidget *button_remove;
GtkWidget *grid_noresults;
- GtkWidget *header;
GtkWidget *label2;
GtkWidget *listbox;
GtkWidget *listbox_apps;
@@ -358,11 +357,6 @@ gs_sources_dialog_init (GsSourcesDialog *dialog)
priv->cancellable = g_cancellable_new ();
- g_object_ref (priv->header);
- gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (priv->header)), priv->header);
- gtk_window_set_titlebar (GTK_WINDOW (dialog), priv->header);
- g_object_unref (priv->header);
-
gtk_list_box_set_header_func (GTK_LIST_BOX (priv->listbox),
list_header_func,
dialog,
@@ -400,7 +394,6 @@ gs_sources_dialog_class_init (GsSourcesDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GsSourcesDialog, button_back);
gtk_widget_class_bind_template_child_private (widget_class, GsSourcesDialog, button_remove);
gtk_widget_class_bind_template_child_private (widget_class, GsSourcesDialog, grid_noresults);
- gtk_widget_class_bind_template_child_private (widget_class, GsSourcesDialog, header);
gtk_widget_class_bind_template_child_private (widget_class, GsSourcesDialog, label2);
gtk_widget_class_bind_template_child_private (widget_class, GsSourcesDialog, listbox);
gtk_widget_class_bind_template_child_private (widget_class, GsSourcesDialog, listbox_apps);
diff --git a/src/gs-sources-dialog.ui b/src/gs-sources-dialog.ui
index 6563cf0..29b4267 100644
--- a/src/gs-sources-dialog.ui
+++ b/src/gs-sources-dialog.ui
@@ -10,58 +10,53 @@
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
+ <property name="use_header_bar">1</property>
+ <child internal-child="headerbar">
+ <object class="GtkHeaderBar">
<child>
- <object class="GtkHeaderBar" id="header">
+ <object class="GtkButton" id="button_back">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="show_close_button">True</property>
-
- <child>
- <object class="GtkButton" id="button_back">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="button_back_accessible">
- <property name="accessible-name" translatable="yes">Go back</property>
- </object>
- </child>
- <style>
- <class name="image-button"/>
- </style>
- <child>
- <object class="GtkImage" id="image_back">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-previous-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="button_back_accessible">
+ <property name="accessible-name" translatable="yes">Go back</property>
</object>
</child>
- <child type="title">
- <object class="GtkLabel" id="label_header">
- <property name="can_focus">False</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="image_back">
<property name="visible">True</property>
- <property name="label" translatable="yes">Software Sources</property>
- <property name="selectable">False</property>
- <style>
- <class name="title"/>
- </style>
+ <property name="can_focus">False</property>
+ <property name="icon_name">go-previous-symbolic</property>
+ <property name="icon_size">1</property>
</object>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="pack-type">start</property>
</packing>
</child>
+ <child type="title">
+ <object class="GtkLabel" id="label_header">
+ <property name="can_focus">False</property>
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Software Sources</property>
+ <property name="selectable">False</property>
+ <style>
+ <class name="title"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]