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

Proposed by Michal Hruby
Status: Merged
Approved by: Paweł Stołowski
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 (community) Approve
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

Add a comment

Revision history for this message
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
=== modified file 'src/daemon.vala'
--- src/daemon.vala 2012-09-25 10:24:12 +0000
+++ src/daemon.vala 2012-09-27 08:41:22 +0000
@@ -925,7 +925,8 @@
925 return GLib.Path.get_basename (name);925 return GLib.Path.get_basename (name);
926 }926 }
927927
928 private string get_annotated_icon (Icon app_icon, string price, bool paid)928 private string get_annotated_icon (Icon app_icon, string price, bool paid,
929 bool use_small_icon = true)
929 {930 {
930 var annotated_icon = new AnnotatedIcon (app_icon);931 var annotated_icon = new AnnotatedIcon (app_icon);
931 annotated_icon.category = CategoryType.APPLICATION;932 annotated_icon.category = CategoryType.APPLICATION;
@@ -940,6 +941,10 @@
940 {941 {
941 annotated_icon.ribbon = _("Free");942 annotated_icon.ribbon = _("Free");
942 }943 }
944 if (use_small_icon || app_icon.to_string () == GENERIC_APP_ICON)
945 {
946 annotated_icon.size_hint = IconSizeHint.SMALL;
947 }
943 948
944 return annotated_icon.to_string ();949 return annotated_icon.to_string ();
945 }950 }
@@ -965,7 +970,12 @@
965 var pinfo = purchase_info.find (app.application_name, app.package_name);970 var pinfo = purchase_info.find (app.application_name, app.package_name);
966 if (pinfo != null)971 if (pinfo != null)
967 {972 {
968 var annotated_icon = get_annotated_icon (app_icon, pinfo.formatted_price, pinfo.paid);973 // magazines need to use large icons
974 bool use_small_icon = app.desktop_file.has_suffix (".desktop");
975 var annotated_icon = get_annotated_icon (app_icon,
976 pinfo.formatted_price,
977 pinfo.paid,
978 use_small_icon);
969 icon_obj = annotated_icon.to_string ();979 icon_obj = annotated_icon.to_string ();
970 }980 }
971 else981 else
@@ -1060,9 +1070,13 @@
1060 * but only use that after we've de-duped the results.1070 * but only use that after we've de-duped the results.
1061 * But only change the URI *after* we've de-duped the results! */1071 * But only change the URI *after* we've de-duped the results! */
1062 uri = @"unity-install://$(pkginfo.package_name)/$(pkginfo.application_name)";1072 uri = @"unity-install://$(pkginfo.package_name)/$(pkginfo.application_name)";
1063 available_uris.add (uri); 1073 available_uris.add (uri);
10641074
1065 icon_str = get_annotated_icon (icon, pkginfo.price, !pkginfo.needs_purchase);1075 // magazines need to use large icons
1076 bool use_small_icon = pkginfo.desktop_file.has_suffix (".desktop");
1077 icon_str = get_annotated_icon (icon, pkginfo.price,
1078 !pkginfo.needs_purchase,
1079 use_small_icon);
1066 }1080 }
1067 else1081 else
1068 {1082 {

Subscribers

People subscribed via source and target branches