Merge lp:~elementary-pantheon/slingshot/switcher-styles into lp:~elementary-pantheon/slingshot/trunk

Proposed by Daniel Fore on 2017-01-03
Status: Merged
Approved by: Felipe Escoto on 2017-01-15
Approved revision: 715
Merged at revision: 719
Proposed branch: lp:~elementary-pantheon/slingshot/switcher-styles
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 355 lines (+278/-5)
7 files modified
data/icons.gresource.xml (+8/-0)
data/pager-checked-symbolic.svg (+78/-0)
data/view-filter-symbolic-rtl.svg (+78/-0)
data/view-filter-symbolic.svg (+78/-0)
src/CMakeLists.txt (+4/-1)
src/Slingshot.vala (+5/-0)
src/Widgets/Switcher.vala (+27/-4)
To merge this branch: bzr merge lp:~elementary-pantheon/slingshot/switcher-styles
Reviewer Review Type Date Requested Status
Felipe Escoto 2017-01-03 Approve on 2017-01-15
Review via email: mp+314034@code.launchpad.net

Commit message

* Changes pager style from numbers to dots
* Add custom icons to a gresource

Description of the change

-

To post a comment you must log in.
715. By Daniel Fore on 2017-01-07

add dot styles to switcher

Felipe Escoto (philip.scott) wrote :

I'll have to get used to the dots, but it lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'data/icons.gresource.xml'
2--- data/icons.gresource.xml 1970-01-01 00:00:00 +0000
3+++ data/icons.gresource.xml 2017-01-07 18:58:10 +0000
4@@ -0,0 +1,8 @@
5+<?xml version="1.0" encoding="UTF-8"?>
6+<gresources>
7+ <gresource prefix="/org/pantheon/slingshot/icons">
8+ <file alias="pager-checked-symbolic.svg" compressed="true" preprocess="xml-stripblanks">pager-checked-symbolic.svg</file>
9+ <file alias="view-filter-symbolic.svg" compressed="true" preprocess="xml-stripblanks">view-filter-symbolic.svg</file>
10+ <file alias="view-filter-symbolic-rtl.svg" compressed="true" preprocess="xml-stripblanks">view-filter-symbolic-rtl.svg</file>
11+ </gresource>
12+</gresources>
13
14=== added file 'data/pager-checked-symbolic.svg'
15--- data/pager-checked-symbolic.svg 1970-01-01 00:00:00 +0000
16+++ data/pager-checked-symbolic.svg 2017-01-07 18:58:10 +0000
17@@ -0,0 +1,78 @@
18+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
19+<svg
20+ xmlns:dc="http://purl.org/dc/elements/1.1/"
21+ xmlns:cc="http://creativecommons.org/ns#"
22+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
23+ xmlns:svg="http://www.w3.org/2000/svg"
24+ xmlns="http://www.w3.org/2000/svg"
25+ width="16"
26+ version="1.1"
27+ id="svg7384"
28+ height="16">
29+ <metadata
30+ id="metadata90">
31+ <rdf:RDF>
32+ <cc:Work
33+ rdf:about="">
34+ <dc:format>image/svg+xml</dc:format>
35+ <dc:type
36+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
37+ <dc:title>elementary Symbolic Icon Theme</dc:title>
38+ </cc:Work>
39+ </rdf:RDF>
40+ </metadata>
41+ <title
42+ id="title9167">elementary Symbolic Icon Theme</title>
43+ <defs
44+ id="defs7386">
45+ <filter
46+ id="filter7554"
47+ color-interpolation-filters="sRGB">
48+ <feBlend
49+ mode="darken"
50+ in2="BackgroundImage"
51+ id="feBlend7556" />
52+ </filter>
53+ <filter
54+ id="filter7554-7"
55+ color-interpolation-filters="sRGB">
56+ <feBlend
57+ mode="darken"
58+ in2="BackgroundImage"
59+ id="feBlend7556-6" />
60+ </filter>
61+ </defs>
62+ <g
63+ transform="translate(-433.00035,52)"
64+ style="display:inline"
65+ label="status"
66+ id="layer9" />
67+ <g
68+ transform="translate(-433.00035,52)"
69+ style="display:inline"
70+ id="layer10" />
71+ <g
72+ transform="translate(-433.00035,52)"
73+ style="display:inline"
74+ id="layer13" />
75+ <g
76+ transform="translate(-433.00035,52)"
77+ id="layer14" />
78+ <g
79+ transform="translate(-433.00035,52)"
80+ style="display:inline"
81+ id="layer15" />
82+ <g
83+ transform="translate(-433.00035,52)"
84+ style="display:inline"
85+ id="g71291" />
86+ <g
87+ transform="matrix(0.80281628,0,0,0.80281628,-346.04226,43.323916)"
88+ style="display:inline"
89+ id="layer12">
90+ <path
91+ style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';text-indent:0pt;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78125;marker:none"
92+ id="path4646-0"
93+ d="m 441.00035,-48.98246 c -2.74957,0 -4.98246,2.23288 -4.98246,4.98246 0,2.74957 2.23289,4.98246 4.98246,4.98246 2.74957,0 4.98246,-2.23289 4.98246,-4.98246 0,-2.74958 -2.23289,-4.98246 -4.98246,-4.98246 z" />
94+ </g>
95+</svg>
96
97=== added file 'data/view-filter-symbolic-rtl.svg'
98--- data/view-filter-symbolic-rtl.svg 1970-01-01 00:00:00 +0000
99+++ data/view-filter-symbolic-rtl.svg 2017-01-07 18:58:10 +0000
100@@ -0,0 +1,78 @@
101+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
102+<svg
103+ xmlns:dc="http://purl.org/dc/elements/1.1/"
104+ xmlns:cc="http://creativecommons.org/ns#"
105+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
106+ xmlns:svg="http://www.w3.org/2000/svg"
107+ xmlns="http://www.w3.org/2000/svg"
108+ height="16"
109+ id="svg7384"
110+ version="1.1"
111+ width="16">
112+ <metadata
113+ id="metadata90">
114+ <rdf:RDF>
115+ <cc:Work
116+ rdf:about="">
117+ <dc:format>image/svg+xml</dc:format>
118+ <dc:type
119+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
120+ <dc:title>elementary Symbolic Icon Theme</dc:title>
121+ </cc:Work>
122+ </rdf:RDF>
123+ </metadata>
124+ <title
125+ id="title9167">elementary Symbolic Icon Theme</title>
126+ <defs
127+ id="defs7386">
128+ <filter
129+ color-interpolation-filters="sRGB"
130+ id="filter7554">
131+ <feBlend
132+ id="feBlend7556"
133+ in2="BackgroundImage"
134+ mode="darken" />
135+ </filter>
136+ <filter
137+ color-interpolation-filters="sRGB"
138+ id="filter7554-7">
139+ <feBlend
140+ id="feBlend7556-6"
141+ in2="BackgroundImage"
142+ mode="darken" />
143+ </filter>
144+ </defs>
145+ <g
146+ id="layer9"
147+ label="status"
148+ style="display:inline"
149+ transform="translate(-353.00061,-88)" />
150+ <g
151+ id="layer10"
152+ style="display:inline"
153+ transform="translate(-353.00061,-88)" />
154+ <g
155+ id="layer13"
156+ style="display:inline"
157+ transform="translate(-353.00061,-88)" />
158+ <g
159+ id="layer14"
160+ transform="translate(-353.00061,-88)" />
161+ <g
162+ id="layer15"
163+ style="display:inline"
164+ transform="translate(-353.00061,-88)" />
165+ <g
166+ id="g71291"
167+ style="display:inline"
168+ transform="translate(-353.00061,-88)" />
169+ <g
170+ id="layer12"
171+ style="display:inline"
172+ transform="translate(-353.00061,-88)">
173+ <path
174+ d="m 359.00102,97 0,4 -4,0 0,-4 4,0 z m -1,1 -2,0 0,2 2,0 0,-2 z m 1,-7 0,4 -4,0 0,-4 4,0 z m -1,1 -2,0 0,2 2,0 0,-2 z m 6,5 0,1 4,0 0,-1 z m 0,3 0,1 4,0 0,-1 z m 0,-6 0,1 4,0 0,-1 z m 0,-3 0,1 4,0 0,-1 z m -2,-1 -1,0 0,12 1,0 z"
175+ id="path25740"
176+ style="color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
177+ </g>
178+</svg>
179
180=== added file 'data/view-filter-symbolic.svg'
181--- data/view-filter-symbolic.svg 1970-01-01 00:00:00 +0000
182+++ data/view-filter-symbolic.svg 2017-01-07 18:58:10 +0000
183@@ -0,0 +1,78 @@
184+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
185+<svg
186+ xmlns:dc="http://purl.org/dc/elements/1.1/"
187+ xmlns:cc="http://creativecommons.org/ns#"
188+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
189+ xmlns:svg="http://www.w3.org/2000/svg"
190+ xmlns="http://www.w3.org/2000/svg"
191+ height="16"
192+ id="svg7384"
193+ version="1.1"
194+ width="16">
195+ <metadata
196+ id="metadata90">
197+ <rdf:RDF>
198+ <cc:Work
199+ rdf:about="">
200+ <dc:format>image/svg+xml</dc:format>
201+ <dc:type
202+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
203+ <dc:title>elementary Symbolic Icon Theme</dc:title>
204+ </cc:Work>
205+ </rdf:RDF>
206+ </metadata>
207+ <title
208+ id="title9167">elementary Symbolic Icon Theme</title>
209+ <defs
210+ id="defs7386">
211+ <filter
212+ color-interpolation-filters="sRGB"
213+ id="filter7554">
214+ <feBlend
215+ id="feBlend7556"
216+ in2="BackgroundImage"
217+ mode="darken" />
218+ </filter>
219+ <filter
220+ color-interpolation-filters="sRGB"
221+ id="filter7554-7">
222+ <feBlend
223+ id="feBlend7556-6"
224+ in2="BackgroundImage"
225+ mode="darken" />
226+ </filter>
227+ </defs>
228+ <g
229+ id="layer9"
230+ label="status"
231+ style="display:inline"
232+ transform="translate(-333.00061,-88)" />
233+ <g
234+ id="layer10"
235+ style="display:inline"
236+ transform="translate(-333.00061,-88)" />
237+ <g
238+ id="layer13"
239+ style="display:inline"
240+ transform="translate(-333.00061,-88)" />
241+ <g
242+ id="layer14"
243+ transform="translate(-333.00061,-88)" />
244+ <g
245+ id="layer15"
246+ style="display:inline"
247+ transform="translate(-333.00061,-88)" />
248+ <g
249+ id="g71291"
250+ style="display:inline"
251+ transform="translate(-333.00061,-88)" />
252+ <g
253+ id="layer12"
254+ style="display:inline"
255+ transform="translate(-333.00061,-88)">
256+ <path
257+ d="m 343.0002,97 0,4 4,0 0,-4 -4,0 z m 1,1 2,0 0,2 -2,0 0,-2 z m -1,-7 0,4 4,0 0,-4 -4,0 z m 1,1 2,0 0,2 -2,0 0,-2 z m -6,5 0,1 -4,0 0,-1 z m 0,3 0,1 -4,0 0,-1 z m 0,-6 0,1 -4,0 0,-1 z m 0,-3 0,1 -4,0 0,-1 z m 2,-1 1,0 0,12 -1,0 z"
258+ id="rect3055"
259+ style="color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
260+ </g>
261+</svg>
262
263=== modified file 'src/CMakeLists.txt'
264--- src/CMakeLists.txt 2015-11-21 11:47:57 +0000
265+++ src/CMakeLists.txt 2017-01-07 18:58:10 +0000
266@@ -44,8 +44,11 @@
267
268 add_definitions(${DEPS_CFLAGS})
269
270+include (GResource)
271+glib_compile_resources (GLIB_RESOURCES_ICONS SOURCE ../data/icons.gresource.xml)
272+
273 # Library
274-add_library (${CMAKE_PROJECT_NAME} MODULE ${VALA_C})
275+add_library (${CMAKE_PROJECT_NAME} MODULE ${VALA_C} ${GLIB_RESOURCES_ICONS})
276 target_link_libraries(${CMAKE_PROJECT_NAME} ${DEPS_LIBRARIES})
277
278 target_link_libraries(${CMAKE_PROJECT_NAME} synapse-plugins)
279
280=== modified file 'src/Slingshot.vala'
281--- src/Slingshot.vala 2016-07-02 16:06:02 +0000
282+++ src/Slingshot.vala 2017-01-07 18:58:10 +0000
283@@ -32,6 +32,11 @@
284 description:_("The app-menu indicator"));
285 }
286
287+ construct {
288+ weak Gtk.IconTheme default_theme = Gtk.IconTheme.get_default ();
289+ default_theme.add_resource_path ("/org/pantheon/slingshot/icons");
290+ }
291+
292 void on_close_indicator () {
293 close ();
294 }
295
296=== modified file 'src/Widgets/Switcher.vala'
297--- src/Widgets/Switcher.vala 2014-09-04 05:58:55 +0000
298+++ src/Widgets/Switcher.vala 2017-01-07 18:58:10 +0000
299@@ -19,6 +19,19 @@
300
301 public class Slingshot.Widgets.Switcher : Gtk.Box {
302
303+ const string SWITCHER_STYLE_CSS = """
304+ .switcher {
305+ background-color: transparent;
306+ border: none;
307+ box-shadow: none;
308+ opacity: 0.4;
309+ }
310+
311+ .switcher:checked {
312+ opacity: 1;
313+ }
314+ """;
315+
316 public int size {
317 get {
318 return (int) buttons.size;
319@@ -38,6 +51,16 @@
320 pack_end (new Gtk.Grid (), true, true, 0);
321 }
322
323+ construct {
324+ var provider = new Gtk.CssProvider ();
325+ try {
326+ provider.load_from_data (SWITCHER_STYLE_CSS, SWITCHER_STYLE_CSS.length);
327+ Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
328+ } catch (Error e) {
329+ critical (e.message);
330+ }
331+ }
332+
333 public void set_stack (Gtk.Stack stack) {
334 if (this.stack != null) {
335 clear_children ();
336@@ -49,9 +72,9 @@
337 }
338
339 private void add_child (Gtk.Widget widget) {
340- var button = new Gtk.ToggleButton.with_label ((buttons.size +1).to_string ());
341- button.width_request = 30;
342- button.can_focus = false;
343+ var button = new Gtk.ToggleButton ();
344+ button.image = new Gtk.Image.from_icon_name ("pager-checked-symbolic", Gtk.IconSize.MENU);
345+ button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
346 button.get_style_context ().add_class ("switcher");
347 button.button_release_event.connect (() => {
348 foreach (var entry in buttons.entries) {
349@@ -124,4 +147,4 @@
350 }
351 }
352 }
353-}
354\ No newline at end of file
355+}

Subscribers

People subscribed via source and target branches