Merge lp:~artem-anufrij/webby-browser/webby-browser into lp:webby-browser

Proposed by Artem Anufrij
Status: Merged
Approved by: Erasmo Marín
Approved revision: 12
Merged at revision: 10
Proposed branch: lp:~artem-anufrij/webby-browser/webby-browser
Merge into: lp:webby-browser
Diff against target: 100 lines (+34/-10)
3 files modified
CMakeLists.txt (+6/-5)
src/ApplicationsView.vala (+27/-4)
src/Webby.vala (+1/-1)
To merge this branch: bzr merge lp:~artem-anufrij/webby-browser/webby-browser
Reviewer Review Type Date Requested Status
Erasmo Marín Pending
Review via email: mp+253865@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Artem Anufrij (artem-anufrij) wrote :
Revision history for this message
Erasmo Marín (erasmo-marin) wrote :

Thanks, it looks good. The only thing you need to fix is line 74, can you put the "}" with the "else" in the same line? that's all.

11. By Artem Anufrij

code style

12. By Artem Anufrij

code style

Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

done :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-02-26 20:16:44 +0000
+++ CMakeLists.txt 2015-03-23 21:20:10 +0000
@@ -86,7 +86,7 @@
86#86#
8787
88find_package(PkgConfig)88find_package(PkgConfig)
89pkg_check_modules(DEPS REQUIRED gobject-2.0 glib-2.0 gio-2.0 gtk+-3.0>=3.12 gthread-2.0 granite gee-0.8 webkit2gtk-3.0 libsoup-2.4)89pkg_check_modules(DEPS REQUIRED gobject-2.0 glib-2.0 gio-2.0 gtk+-3.0>=3.12 gthread-2.0 granite gee-0.8 webkit2gtk-3.0 libsoup-2.4 gdk-pixbuf-2.0)
9090
91add_definitions(${DEPS_CFLAGS})91add_definitions(${DEPS_CFLAGS})
9292
@@ -99,15 +99,16 @@
9999
100set(PKG_DEPS gtk+-3.0100set(PKG_DEPS gtk+-3.0
101 granite101 granite
102 gio-2.0 102 gio-2.0
103 gee-0.8103 gee-0.8
104 posix104 posix
105 webkit2gtk-3.0105 webkit2gtk-3.0
106 libsoup-2.4)106 libsoup-2.4
107 gdk-pixbuf-2.0)
107108
108109
109set(SRC_FILES110set(SRC_FILES
110 src/ApplicationsView.vala 111 src/ApplicationsView.vala
111 src/AppWindow.vala112 src/AppWindow.vala
112 src/Assistant.vala113 src/Assistant.vala
113 src/DesktopFile.vala114 src/DesktopFile.vala
@@ -130,7 +131,7 @@
130 --thread131 --thread
131 -g132 -g
132 --debug133 --debug
133 --target-glib=2.32 134 --target-glib=2.32
134 )135 )
135136
136add_definitions(${CFLAGS}-lm -Wall -Winit-self -Wwrite-strings -Wunreachable-code -Wstrict-prototypes)137add_definitions(${CFLAGS}-lm -Wall -Winit-self -Wwrite-strings -Wunreachable-code -Wstrict-prototypes)
137138
=== modified file 'src/ApplicationsView.vala'
--- src/ApplicationsView.vala 2015-02-26 20:16:44 +0000
+++ src/ApplicationsView.vala 2015-03-23 21:20:10 +0000
@@ -10,7 +10,7 @@
10 GLib.Object (orientation: Gtk.Orientation.VERTICAL);10 GLib.Object (orientation: Gtk.Orientation.VERTICAL);
11 var scrolled = new Gtk.ScrolledWindow (null, null);11 var scrolled = new Gtk.ScrolledWindow (null, null);
12 scrolled.hscrollbar_policy = Gtk.PolicyType.NEVER;12 scrolled.hscrollbar_policy = Gtk.PolicyType.NEVER;
13 13
14 icon_view = new Gtk.FlowBox();14 icon_view = new Gtk.FlowBox();
15 icon_view.valign = Gtk.Align.START;15 icon_view.valign = Gtk.Align.START;
16 icon_view.vexpand = false;16 icon_view.vexpand = false;
@@ -68,9 +68,32 @@
68 vexpand = false;68 vexpand = false;
6969
70 label = new Gtk.Label (label_str);70 label = new Gtk.Label (label_str);
71 image = new Gtk.Image();71
72 image.icon_name = icon;72 if (File.new_for_path (icon).query_exists ()) {
73 image.pixel_size = 64;73 var pix = new Gdk.Pixbuf.from_file (icon);
74
75 int new_height = 64;
76 int new_width = 64;
77 int margin_vertical = 0;
78 int margin_horizontal = 0;
79
80 if (pix.height > pix.width) {
81 new_width = new_width * pix.width / pix.height;
82 margin_horizontal = (new_height - new_width) / 2;
83 } else if (pix.height < pix.width) {
84 new_height = new_height * pix.height / pix.width;
85 margin_vertical = (new_width - new_height) / 2;
86 }
87 image = new Gtk.Image.from_pixbuf (pix.scale_simple (new_width, new_height, Gdk.InterpType.BILINEAR));
88 image.margin_top = margin_vertical;
89 image.margin_bottom = margin_vertical;
90 image.margin_right = margin_horizontal;
91 image.margin_left = margin_horizontal;
92 } else {
93 image = new Gtk.Image ();
94 image.icon_name = icon;
95 image.pixel_size = 64;
96 }
7497
75 this.margin = 5;98 this.margin = 5;
76 this.margin_start = 20;99 this.margin_start = 20;
77100
=== modified file 'src/Webby.vala'
--- src/Webby.vala 2015-02-26 01:32:45 +0000
+++ src/Webby.vala 2015-03-23 21:20:10 +0000
@@ -13,4 +13,4 @@
1313
14 Gtk.main ();14 Gtk.main ();
15 return 0;15 return 0;
16} 16}

Subscribers

People subscribed via source and target branches

to all changes: