Merge lp:~elementary-pantheon/granite/about-icon-name into lp:~elementary-pantheon/granite/granite

Proposed by Danielle Foré
Status: Merged
Approved by: Corentin Noël
Approved revision: 951
Merged at revision: 952
Proposed branch: lp:~elementary-pantheon/granite/about-icon-name
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 42 lines (+8/-15)
1 file modified
lib/GtkPatch/AboutDialog.vala (+8/-15)
To merge this branch: bzr merge lp:~elementary-pantheon/granite/about-icon-name
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+298046@code.launchpad.net

Commit message

AboutDialog.vala:
* Set image from icon name when available
* Don't set the pixbuf or icon_name more than once

Description of the change

s

To post a comment you must log in.
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Do not set things multiple times. Once is (always) enough!

951. By Danielle Foré

don't set pixbuf when icon name available

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/GtkPatch/AboutDialog.vala'
--- lib/GtkPatch/AboutDialog.vala 2015-12-11 16:58:25 +0000
+++ lib/GtkPatch/AboutDialog.vala 2016-06-21 18:05:38 +0000
@@ -282,7 +282,6 @@
282 // Adjust sizes282 // Adjust sizes
283 content_hbox.height_request = 160;283 content_hbox.height_request = 160;
284 content_scrolled_vbox.width_request = 288;284 content_scrolled_vbox.width_request = 288;
285 logo_image.set_size_request(128, 128);
286285
287 name_label = new Label("");286 name_label = new Label("");
288 name_label.halign = Gtk.Align.START;287 name_label.halign = Gtk.Align.START;
@@ -402,22 +401,16 @@
402 return text;401 return text;
403 }402 }
404403
405 private void update_logo_image()404 private void update_logo_image () {
406 {405 logo_image.pixel_size = 128;
407 try {406
408 logo_image.set_from_pixbuf(IconTheme.get_default ().load_icon ("application-default-icon", 128, 0));
409 } catch (Error err) {
410 stderr.printf ("Unable to load terminal icon: %s", err.message);
411 }
412 if (logo_icon_name != null && logo_icon_name != "") {407 if (logo_icon_name != null && logo_icon_name != "") {
413 try {408 logo_image.icon_name = logo_icon_name;
414 logo_image.set_from_pixbuf(IconTheme.get_default ().load_icon (logo_icon_name, 128, 0));409 } else if (logo != null) {
415 } catch (Error err) {410 logo_image.pixbuf = logo;
416 stderr.printf ("Unable to load terminal icon: %s", err.message);411 } else {
417 }412 logo_image.icon_name = "application-default-icon";
418 }413 }
419 else if (logo != null)
420 logo_image.set_from_pixbuf(logo);
421 }414 }
422415
423 private void update_license()416 private void update_license()

Subscribers

People subscribed via source and target branches