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
=== modified file 'src/Views/CategoryView.vala'
--- src/Views/CategoryView.vala 2016-06-12 22:00:29 +0000
+++ src/Views/CategoryView.vala 2016-06-16 00:50:20 +0000
@@ -205,7 +205,7 @@
205205
206 private Widgets.CategoryItem get_games_category () {206 private Widgets.CategoryItem get_games_category () {
207 var category = new AppStream.Category ();207 var category = new AppStream.Category ();
208 category.set_name (_("GAMES"));208 category.set_name (_("Games"));
209 var categories = new Gee.LinkedList<string> ();209 var categories = new Gee.LinkedList<string> ();
210 categories.add ("Game");210 categories.add ("Game");
211 category.set_data<Gee.LinkedList> ("categories", categories);211 category.set_data<Gee.LinkedList> ("categories", categories);
@@ -243,8 +243,7 @@
243243
244 private Widgets.CategoryItem get_science_category () {244 private Widgets.CategoryItem get_science_category () {
245 var category = new AppStream.Category ();245 var category = new AppStream.Category ();
246 // TRANSLATORS: We need to force the newline so that the buttons get a decent size246 category.set_name (_("Science & Engineering"));
247 category.set_name (_("Science &\nEngineering"));
248 var categories = new Gee.LinkedList<string> ();247 var categories = new Gee.LinkedList<string> ();
249 categories.add ("Science");248 categories.add ("Science");
250 category.set_data<Gee.LinkedList> ("categories", categories);249 category.set_data<Gee.LinkedList> ("categories", categories);
@@ -256,8 +255,7 @@
256255
257 private Widgets.CategoryItem get_a11y_category () {256 private Widgets.CategoryItem get_a11y_category () {
258 var category = new AppStream.Category ();257 var category = new AppStream.Category ();
259 // TRANSLATORS: We need to force the newline so that the buttons get a decent size258 category.set_name (_("Universal Access"));
260 category.set_name (_("UNIVERSAL\nACCESS"));
261 category.set_icon ("applications-accessibility-symbolic");259 category.set_icon ("applications-accessibility-symbolic");
262 var categories = new Gee.LinkedList<string> ();260 var categories = new Gee.LinkedList<string> ();
263 categories.add ("Accessibility");261 categories.add ("Accessibility");
264262
=== modified file 'src/Widgets/CategoryItem.vala'
--- src/Widgets/CategoryItem.vala 2016-05-04 19:38:51 +0000
+++ src/Widgets/CategoryItem.vala 2016-06-16 00:50:20 +0000
@@ -220,7 +220,6 @@
220220
221 public CategoryItem (AppStream.Category app_category) {221 public CategoryItem (AppStream.Category app_category) {
222 this.app_category = app_category;222 this.app_category = app_category;
223 name_label.label = app_category.name;
224 tooltip_text = app_category.summary ?? "";223 tooltip_text = app_category.summary ?? "";
225 if (app_category.icon != null) {224 if (app_category.icon != null) {
226 display_image.icon_name = app_category.icon;225 display_image.icon_name = app_category.icon;
@@ -263,6 +262,7 @@
263262
264 name_label = new Gtk.Label (null);263 name_label = new Gtk.Label (null);
265 name_label.wrap = true;264 name_label.wrap = true;
265 name_label.max_width_chars = 15;
266 grid.add (name_label);266 grid.add (name_label);
267267
268 var expanded_grid = new Gtk.Grid ();268 var expanded_grid = new Gtk.Grid ();
@@ -280,5 +280,10 @@
280280
281 public void add_category_class (string theme_name) {281 public void add_category_class (string theme_name) {
282 themed_grid.get_style_context ().add_class (theme_name);282 themed_grid.get_style_context ().add_class (theme_name);
283 if (theme_name == "games" || theme_name == "accessibility") {
284 name_label.label = app_category.name.up ();
285 } else {
286 name_label.label = app_category.name;
287 }
283 }288 }
284}289}

Subscribers

People subscribed via source and target branches

to all changes: