diff options
author | Alexander Larsson <alexl@redhat.com> | 2013-01-28 14:02:16 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2013-01-29 09:37:36 +0100 |
commit | a32e31ebd1b23481476b0e8678b532c9cc27d33a (patch) | |
tree | 46f23441ec8277b79efc51a16cd47f8979724f4f | |
parent | 0d77204128c07971270b636c2bcaa7f971d8f703 (diff) |
Fix squished icon in properties during wizard
The thumbnail is stretched, so center the cd icon in a properly
sized pixbuf.
https://bugzilla.gnome.org/show_bug.cgi?id=688328
-rw-r--r-- | src/machine.vala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/machine.vala b/src/machine.vala index ac54435..18686c1 100644 --- a/src/machine.vala +++ b/src/machine.vala @@ -636,8 +636,14 @@ private class Boxes.MachineActor: Boxes.UI { Gdk.Pixbuf pixbuf = null; if (previous_ui_state == UIState.WIZARD) { var theme = Gtk.IconTheme.get_for_screen (App.app.window.get_screen ()); + pixbuf = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8, + Machine.SCREENSHOT_WIDTH, Machine.SCREENSHOT_HEIGHT); + pixbuf.fill (0x00000000); // Transparent try { - pixbuf = theme.load_icon ("media-optical", Machine.SCREENSHOT_HEIGHT, 0); + var icon = theme.load_icon ("media-optical", Machine.SCREENSHOT_HEIGHT, 0); + // Center icon in pixbuf + icon.copy_area (0, 0, Machine.SCREENSHOT_HEIGHT, Machine.SCREENSHOT_HEIGHT, pixbuf, + (Machine.SCREENSHOT_WIDTH - Machine.SCREENSHOT_HEIGHT) / 2, 0); } catch (GLib.Error err) { warning (err.message); } |