Merge lp:~elementary-apps/appcenter/fix-uppercase-category into lp:~elementary-apps/appcenter/appcenter

Proposed by Danielle Foré
Status: Merged
Approved by: Cody Garver
Approved revision: 203
Merged at revision: 201
Proposed branch: lp:~elementary-apps/appcenter/fix-uppercase-category
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 63 lines (+9/-6)
2 files modified
src/Views/CategoryView.vala (+3/-5)
src/Widgets/CategoryItem.vala (+6/-1)
To merge this branch: bzr merge lp:~elementary-apps/appcenter/fix-uppercase-category
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+297582@code.launchpad.net

Commit message

* Don't uppercase categories in back button
* Use max-width chars to wrap text instead of /n

Description of the change

Fixes category labels being uppercase in the back button and removes line wrap from string. Sets a max-width chars and does .up () for categories to style them.

To post a comment you must log in.
202. By Danielle Foré

capitalize games

203. By Danielle Foré

remove manual newline from science & engineering

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Views/CategoryView.vala'
2--- src/Views/CategoryView.vala 2016-06-12 22:00:29 +0000
3+++ src/Views/CategoryView.vala 2016-06-16 00:50:20 +0000
4@@ -205,7 +205,7 @@
5
6 private Widgets.CategoryItem get_games_category () {
7 var category = new AppStream.Category ();
8- category.set_name (_("GAMES"));
9+ category.set_name (_("Games"));
10 var categories = new Gee.LinkedList<string> ();
11 categories.add ("Game");
12 category.set_data<Gee.LinkedList> ("categories", categories);
13@@ -243,8 +243,7 @@
14
15 private Widgets.CategoryItem get_science_category () {
16 var category = new AppStream.Category ();
17- // TRANSLATORS: We need to force the newline so that the buttons get a decent size
18- category.set_name (_("Science &\nEngineering"));
19+ category.set_name (_("Science & Engineering"));
20 var categories = new Gee.LinkedList<string> ();
21 categories.add ("Science");
22 category.set_data<Gee.LinkedList> ("categories", categories);
23@@ -256,8 +255,7 @@
24
25 private Widgets.CategoryItem get_a11y_category () {
26 var category = new AppStream.Category ();
27- // TRANSLATORS: We need to force the newline so that the buttons get a decent size
28- category.set_name (_("UNIVERSAL\nACCESS"));
29+ category.set_name (_("Universal Access"));
30 category.set_icon ("applications-accessibility-symbolic");
31 var categories = new Gee.LinkedList<string> ();
32 categories.add ("Accessibility");
33
34=== modified file 'src/Widgets/CategoryItem.vala'
35--- src/Widgets/CategoryItem.vala 2016-05-04 19:38:51 +0000
36+++ src/Widgets/CategoryItem.vala 2016-06-16 00:50:20 +0000
37@@ -220,7 +220,6 @@
38
39 public CategoryItem (AppStream.Category app_category) {
40 this.app_category = app_category;
41- name_label.label = app_category.name;
42 tooltip_text = app_category.summary ?? "";
43 if (app_category.icon != null) {
44 display_image.icon_name = app_category.icon;
45@@ -263,6 +262,7 @@
46
47 name_label = new Gtk.Label (null);
48 name_label.wrap = true;
49+ name_label.max_width_chars = 15;
50 grid.add (name_label);
51
52 var expanded_grid = new Gtk.Grid ();
53@@ -280,5 +280,10 @@
54
55 public void add_category_class (string theme_name) {
56 themed_grid.get_style_context ().add_class (theme_name);
57+ if (theme_name == "games" || theme_name == "accessibility") {
58+ name_label.label = app_category.name.up ();
59+ } else {
60+ name_label.label = app_category.name;
61+ }
62 }
63 }

Subscribers

People subscribed via source and target branches

to all changes: