[gnome-control-center] background: Add "add" button
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Add "add" button
- Date: Mon, 14 Feb 2011 13:27:06 +0000 (UTC)
commit 575d8d2463e415c8deef72a585d90e371ea2c33e
Author: Bastien Nocera <hadess hadess net>
Date: Mon Feb 14 10:21:35 2011 +0000
background: Add "add" button
To allow adding arbitrary files to the list.
panels/background/background.ui | 37 ++++++++++++++++++++++++++++--
panels/background/cc-background-panel.c | 9 +++++++
2 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/panels/background/background.ui b/panels/background/background.ui
index 53fd990..c3ffc13 100644
--- a/panels/background/background.ui
+++ b/panels/background/background.ui
@@ -30,7 +30,7 @@
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="spacing">0</property>
<child>
<object class="GtkComboBox" id="sources-combobox">
<property name="visible">True</property>
@@ -45,10 +45,11 @@
<packing>
<property name="expand">False</property>
<property name="position">0</property>
+ <property name="padding">6</property>
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="width_request">220</property>
<property name="height_request">380</property>
<property name="visible">True</property>
@@ -75,27 +76,57 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkToolbar" id="toolbar1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_size">1</property>
+ <child>
+ <object class="GtkToolButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">list-add-symbolic</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="heading-hbox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">24</property>
<child>
<object class="GtkLabel" id="background-label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label">Current background</property>
<attributes>
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 5464dcf..015afbc 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -757,6 +757,7 @@ cc_background_panel_init (CcBackgroundPanel *self)
GError *err = NULL;
GtkWidget *widget;
GtkListStore *store;
+ GtkStyleContext *context;
priv = self->priv = BACKGROUND_PANEL_PRIVATE (self);
@@ -830,6 +831,14 @@ cc_background_panel_init (CcBackgroundPanel *self)
G_CALLBACK (backgrounds_changed_cb),
self);
+ /* Join treeview and buttons */
+ widget = WID ("scrolledwindow1");
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
+ widget = WID ("toolbar1");
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
+
/* setup preview area */
widget = WID ("preview-area");
g_signal_connect (widget, "draw", G_CALLBACK (preview_draw_cb),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]