~ubuntu-desktop/rhythmbox/ubuntu

« back to all changes in this revision

Viewing changes to debian/patches/git-toolbar-buttons-styling.patch

  • Committer: Sebastien Bacher
  • Date: 2014-03-12 14:50:42 UTC
  • mfrom: (217.1.1 rhythmbox-ubuntu)
  • Revision ID: seb128@ubuntu.com-20140312145042-y4tnei4bpychbpaw
* debian/patches/git-toolbar-buttons-styling.patch:
  - tweaks to the toolbar styling, thanks Lars Uebernickel

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
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
 
8
linked.
 
9
 
 
10
Also move setting the style classes for toolbar buttons into the .ui
 
11
file.
 
12
 
 
13
https://bugzilla.gnome.org/show_bug.cgi?id=726167
 
14
---
 
15
 data/ui/main-toolbar.ui | 21 +++++++++++++++++++++
 
16
 shell/rb-shell.c        | 22 ----------------------
 
17
 2 files changed, 21 insertions(+), 22 deletions(-)
 
18
 
 
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
 
23
@@ -53,6 +53,9 @@
 
24
             <property name="can_focus">False</property>
 
25
             <property name="margin_top">6</property>
 
26
             <property name="margin_bottom">6</property>
 
27
+            <style>
 
28
+              <class name="linked" />
 
29
+            </style>
 
30
             <child>
 
31
               <object class="GtkButton" id="previous-button">
 
32
                 <property name="visible">True</property>
 
33
@@ -61,6 +64,9 @@
 
34
                 <property name="action_name">app.play-previous</property>
 
35
                 <property name="image">image5</property>
 
36
                 <property name="always_show_image">True</property>
 
37
+                <style>
 
38
+                  <class name="raised" />
 
39
+                </style>
 
40
               </object>
 
41
               <packing>
 
42
                 <property name="expand">False</property>
 
43
@@ -75,6 +81,9 @@
 
44
                 <property name="receives_default">True</property>
 
45
                 <property name="action_name">app.play</property>
 
46
                 <property name="image">image4</property>
 
47
+                <style>
 
48
+                  <class name="raised" />
 
49
+                </style>
 
50
               </object>
 
51
               <packing>
 
52
                 <property name="expand">False</property>
 
53
@@ -89,6 +98,9 @@
 
54
                 <property name="receives_default">True</property>
 
55
                 <property name="action_name">app.play-next</property>
 
56
                 <property name="image">image3</property>
 
57
+                <style>
 
58
+                  <class name="raised" />
 
59
+                </style>
 
60
               </object>
 
61
               <packing>
 
62
                 <property name="expand">False</property>
 
63
@@ -115,6 +127,9 @@
 
64
           <object class="GtkBox" id="box4">
 
65
             <property name="visible">True</property>
 
66
             <property name="can_focus">False</property>
 
67
+            <style>
 
68
+              <class name="linked" />
 
69
+            </style>
 
70
             <child>
 
71
               <object class="GtkToggleButton" id="repeat-button">
 
72
                 <property name="visible">True</property>
 
73
@@ -122,6 +137,9 @@
 
74
                 <property name="receives_default">True</property>
 
75
                 <property name="action_name">app.play-repeat</property>
 
76
                 <property name="image">image2</property>
 
77
+                <style>
 
78
+                  <class name="raised" />
 
79
+                </style>
 
80
               </object>
 
81
               <packing>
 
82
                 <property name="expand">False</property>
 
83
@@ -136,6 +154,9 @@
 
84
                 <property name="receives_default">True</property>
 
85
                 <property name="action_name">app.play-shuffle</property>
 
86
                 <property name="image">image1</property>
 
87
+                <style>
 
88
+                  <class name="raised" />
 
89
+                </style>
 
90
               </object>
 
91
               <packing>
 
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)
 
98
 }
 
99
 
 
100
 static void
 
101
-set_button_classes (GtkBuilder *builder, const char *name)
 
102
-{
 
103
-       GtkWidget *widget;
 
104
-
 
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);
 
108
-}
 
109
-
 
110
-static void
 
111
 construct_load_ui (RBShell *shell)
 
112
 {
 
113
        GApplication *app = g_application_get_default ();
 
114
@@ -718,14 +708,6 @@ construct_load_ui (RBShell *shell)
 
115
        GtkWidget *image;
 
116
        GMenuModel *model;
 
117
        gboolean rtl;
 
118
-       const char *raise_buttons[] = {
 
119
-               "previous-button",
 
120
-               "play-button",
 
121
-               "next-button",
 
122
-               "shuffle-button",
 
123
-               "repeat-button"
 
124
-       };
 
125
-       int i;
 
126
 
 
127
        rb_debug ("shell: loading ui");
 
128
        rb_profile_start ("loading ui");
 
129
@@ -735,10 +717,6 @@ construct_load_ui (RBShell *shell)
 
130
 
 
131
        shell->priv->play_button = GTK_WIDGET (gtk_builder_get_object (builder, "play-button"));
 
132
 
 
133
-       for (i = 0; i < G_N_ELEMENTS (raise_buttons); i++) {
 
134
-               set_button_classes (builder, raise_buttons[i]);
 
135
-       }
 
136
-
 
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),
 
140
-- 
 
141
1.9.0
 
142