Merge lp:~mhr3/unity-lens-applications/fix-1052513 into lp:unity-lens-applications

Proposed by Michal Hruby on 2012-09-27
Status: Merged
Approved by: Paweł Stołowski on 2012-09-27
Approved revision: 307
Merged at revision: 307
Proposed branch: lp:~mhr3/unity-lens-applications/fix-1052513
Merge into: lp:unity-lens-applications
Diff against target: 54 lines (+18/-4)
1 file modified
src/daemon.vala (+18/-4)
To merge this branch: bzr merge lp:~mhr3/unity-lens-applications/fix-1052513
Reviewer Review Type Date Requested Status
Paweł Stołowski 2012-09-27 Approve on 2012-09-27
Review via email: mp+126624@code.launchpad.net

Commit message

Use size-hint for items in "More suggestions" category

Description of the change

Use the size hint on AnnotatedIcon to ensure correctly sized icon is displayed in the "More suggestions" category.

To post a comment you must log in.
307. By Michal Hruby on 2012-09-27

Add a comment

Paweł Stołowski (stolowski) wrote :

LGTM. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/daemon.vala'
2--- src/daemon.vala 2012-09-25 10:24:12 +0000
3+++ src/daemon.vala 2012-09-27 08:41:22 +0000
4@@ -925,7 +925,8 @@
5 return GLib.Path.get_basename (name);
6 }
7
8- private string get_annotated_icon (Icon app_icon, string price, bool paid)
9+ private string get_annotated_icon (Icon app_icon, string price, bool paid,
10+ bool use_small_icon = true)
11 {
12 var annotated_icon = new AnnotatedIcon (app_icon);
13 annotated_icon.category = CategoryType.APPLICATION;
14@@ -940,6 +941,10 @@
15 {
16 annotated_icon.ribbon = _("Free");
17 }
18+ if (use_small_icon || app_icon.to_string () == GENERIC_APP_ICON)
19+ {
20+ annotated_icon.size_hint = IconSizeHint.SMALL;
21+ }
22
23 return annotated_icon.to_string ();
24 }
25@@ -965,7 +970,12 @@
26 var pinfo = purchase_info.find (app.application_name, app.package_name);
27 if (pinfo != null)
28 {
29- var annotated_icon = get_annotated_icon (app_icon, pinfo.formatted_price, pinfo.paid);
30+ // magazines need to use large icons
31+ bool use_small_icon = app.desktop_file.has_suffix (".desktop");
32+ var annotated_icon = get_annotated_icon (app_icon,
33+ pinfo.formatted_price,
34+ pinfo.paid,
35+ use_small_icon);
36 icon_obj = annotated_icon.to_string ();
37 }
38 else
39@@ -1060,9 +1070,13 @@
40 * but only use that after we've de-duped the results.
41 * But only change the URI *after* we've de-duped the results! */
42 uri = @"unity-install://$(pkginfo.package_name)/$(pkginfo.application_name)";
43- available_uris.add (uri);
44+ available_uris.add (uri);
45
46- icon_str = get_annotated_icon (icon, pkginfo.price, !pkginfo.needs_purchase);
47+ // magazines need to use large icons
48+ bool use_small_icon = pkginfo.desktop_file.has_suffix (".desktop");
49+ icon_str = get_annotated_icon (icon, pkginfo.price,
50+ !pkginfo.needs_purchase,
51+ use_small_icon);
52 }
53 else
54 {

Subscribers

People subscribed via source and target branches