Merge lp:~elementary-apps/switchboard/category-label-css into lp:~elementary-pantheon/switchboard/switchboard

Proposed by Danielle Foré
Status: Merged
Approved by: David Gomes
Approved revision: no longer in the source branch.
Merged at revision: 404
Proposed branch: lp:~elementary-apps/switchboard/category-label-css
Merge into: lp:~elementary-pantheon/switchboard/switchboard
Diff against target: 24 lines (+13/-1)
1 file modified
src/CategoryView.vala (+13/-1)
To merge this branch: bzr merge lp:~elementary-apps/switchboard/category-label-css
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+188234@code.launchpad.net

Commit message

convert category label style from pango markup to CSS

Description of the change

Changes category label styling from pango markup to CSS.
Makes the text dark grey (based on switchboard bg color) instead of black.
gives the text a shadow.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

Add some newlines, like before and after the try/catch block. All good otherwise.

review: Needs Fixing
403. By Danielle Foré

Add margins to category separators.

Revision history for this message
David Gomes (davidgomes) :
review: Approve
404. By Danielle Foré

convert category label style from pango markup to CSS

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CategoryView.vala'
2--- src/CategoryView.vala 2013-09-29 18:33:41 +0000
3+++ src/CategoryView.vala 2013-09-29 19:24:19 +0000
4@@ -37,7 +37,19 @@
5 typeof(string), typeof(bool), typeof(string));
6 store.set_sort_column_id (1, Gtk.SortType.ASCENDING);
7
8- var category_label = new Gtk.Label ("<big><b>" + _(category_names[i]) + "</b></big>");
9+ var category_label = new Gtk.Label (_(category_names[i]));
10+ var fg_css = new Gtk.CssProvider ();
11+
12+ try {
13+ fg_css.load_from_data ("*{
14+ color: shade (@bg_color, 0.4);
15+ font: open sans 11;
16+ font-weight: 600;
17+ text-shadow: 0 1px alpha (#fff, 0.6);
18+ }", -1);
19+ } catch (Error e) { warning (e.message); }
20+
21+ category_label.get_style_context ().add_provider (fg_css, 20000);
22 category_label.margin_left = 12;
23 category_label.margin_right = 8;
24 var filtered = new Gtk.TreeModelFilter (store, null);

Subscribers

People subscribed via source and target branches