1
From c6a8e7e2565c94cf3793477d63ac913b5f6d5f47 Mon Sep 17 00:00:00 2001
2
From: Lars Uebernickel <lars.uebernickel@canonical.com>
3
Date: Wed, 12 Mar 2014 11:40:33 +0100
4
Subject: [PATCH] Move .linked class from buttons to their container
6
According to gtk's documentation, GTK_STYLE_CLASS_LINKED has to be set
7
on the surrounding container instead of on the widgets that should be
10
Also move setting the style classes for toolbar buttons into the .ui
13
https://bugzilla.gnome.org/show_bug.cgi?id=726167
15
data/ui/main-toolbar.ui | 21 +++++++++++++++++++++
16
shell/rb-shell.c | 22 ----------------------
17
2 files changed, 21 insertions(+), 22 deletions(-)
19
diff --git a/data/ui/main-toolbar.ui b/data/ui/main-toolbar.ui
20
index aa1dd76..e6a9177 100644
21
--- a/data/ui/main-toolbar.ui
22
+++ b/data/ui/main-toolbar.ui
24
<property name="can_focus">False</property>
25
<property name="margin_top">6</property>
26
<property name="margin_bottom">6</property>
28
+ <class name="linked" />
31
<object class="GtkButton" id="previous-button">
32
<property name="visible">True</property>
34
<property name="action_name">app.play-previous</property>
35
<property name="image">image5</property>
36
<property name="always_show_image">True</property>
38
+ <class name="raised" />
42
<property name="expand">False</property>
44
<property name="receives_default">True</property>
45
<property name="action_name">app.play</property>
46
<property name="image">image4</property>
48
+ <class name="raised" />
52
<property name="expand">False</property>
54
<property name="receives_default">True</property>
55
<property name="action_name">app.play-next</property>
56
<property name="image">image3</property>
58
+ <class name="raised" />
62
<property name="expand">False</property>
64
<object class="GtkBox" id="box4">
65
<property name="visible">True</property>
66
<property name="can_focus">False</property>
68
+ <class name="linked" />
71
<object class="GtkToggleButton" id="repeat-button">
72
<property name="visible">True</property>
74
<property name="receives_default">True</property>
75
<property name="action_name">app.play-repeat</property>
76
<property name="image">image2</property>
78
+ <class name="raised" />
82
<property name="expand">False</property>
84
<property name="receives_default">True</property>
85
<property name="action_name">app.play-shuffle</property>
86
<property name="image">image1</property>
88
+ <class name="raised" />
92
<property name="expand">False</property>
93
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
94
index add6c65..e350c00 100644
95
--- a/shell/rb-shell.c
96
+++ b/shell/rb-shell.c
97
@@ -697,16 +697,6 @@ construct_sources (RBShell *shell)
101
-set_button_classes (GtkBuilder *builder, const char *name)
105
- widget = GTK_WIDGET (gtk_builder_get_object (builder, name));
106
- gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_RAISED);
107
- gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_LINKED);
111
construct_load_ui (RBShell *shell)
113
GApplication *app = g_application_get_default ();
114
@@ -718,14 +708,6 @@ construct_load_ui (RBShell *shell)
118
- const char *raise_buttons[] = {
127
rb_debug ("shell: loading ui");
128
rb_profile_start ("loading ui");
129
@@ -735,10 +717,6 @@ construct_load_ui (RBShell *shell)
131
shell->priv->play_button = GTK_WIDGET (gtk_builder_get_object (builder, "play-button"));
133
- for (i = 0; i < G_N_ELEMENTS (raise_buttons); i++) {
134
- set_button_classes (builder, raise_buttons[i]);
137
rtl = (gtk_widget_get_direction (shell->priv->play_button) == GTK_TEXT_DIR_RTL);
138
image = gtk_button_get_image (GTK_BUTTON (gtk_builder_get_object (builder, "next-button")));
139
gtk_image_set_from_icon_name (GTK_IMAGE (image),