Merge lp:~donadigo/appcenter/screenshots-pixbuf into lp:~elementary-apps/appcenter/appcenter

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Danielle Foré
Approved revision: 229
Merged at revision: 231
Proposed branch: lp:~donadigo/appcenter/screenshots-pixbuf
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 49 lines (+11/-6)
1 file modified
src/Views/AppInfoView.vala (+11/-6)
To merge this branch: bzr merge lp:~donadigo/appcenter/screenshots-pixbuf
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+298817@code.launchpad.net

Commit message

* Use pixbuf instead FileIcon for screenshots.
* Add separator between header_grid and main content.

Description of the change

This branch changes the screenshots handling from GLib.FileIcon to Gdk.Pixbuf and scales them down to 800x600px with keeping the aspect ratio. In addition I added a separator after header_grid to easily distinguish view elements.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

This works for me. Definitely makes the screeshots a lot better.

Can you remove that 6px row spacing on the grid that has the sep in it? I agree the sep helps break those boxes up, but it's weird to have that chunk of white between it and the scrollbox.

I also think that we should change the stack so that the preview image expects to take up that 800x600 space instead of the 512. I think we should still seek to reduce text movement here so that we're not interrupting reading when the screenshot loads.

229. By Adam Bieńkowski

Use Gdk.Pixbuf for screenshot handling

Revision history for this message
Adam Bieńkowski (donadigo) wrote :

Updated.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Views/AppInfoView.vala'
2--- src/Views/AppInfoView.vala 2016-06-28 22:48:28 +0000
3+++ src/Views/AppInfoView.vala 2016-07-01 12:04:06 +0000
4@@ -111,7 +111,6 @@
5
6 construct {
7 column_spacing = 12;
8- row_spacing = 6;
9
10 app_icon = new Gtk.Image ();
11 app_icon.margin_top = 12;
12@@ -119,7 +118,8 @@
13 app_icon.pixel_size = 128;
14
15 app_screenshot = new Gtk.Image ();
16- app_screenshot.pixel_size = 512;
17+ app_screenshot.width_request = 800;
18+ app_screenshot.height_request = 600;
19 app_screenshot.icon_name = "image-x-generic";
20 app_screenshot.halign = Gtk.Align.CENTER;
21
22@@ -234,7 +234,8 @@
23 header_grid.attach (app_summary, 1, 1, 3, 1);
24
25 attach (header_grid, 0, 0, 1, 1);
26- attach (scrolled, 0, 1, 1, 1);
27+ attach (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), 0, 1, 1, 1);
28+ attach (scrolled, 0, 2, 1, 1);
29 }
30
31 private async void load_extensions () {
32@@ -365,10 +366,14 @@
33 }
34 }
35
36- var icon = new FileIcon (fileimage);
37 Idle.add (() => {
38- app_screenshot.gicon = icon;
39- screenshot_stack.visible_child = app_screenshot;
40+ try {
41+ app_screenshot.pixbuf = new Gdk.Pixbuf.from_file_at_scale (fileimage.get_path (), 800, 600, true);
42+ screenshot_stack.visible_child = app_screenshot;
43+ } catch (Error e) {
44+ critical (e.message);
45+ }
46+
47 return GLib.Source.REMOVE;
48 });
49 }

Subscribers

People subscribed via source and target branches