Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === modified file 'lib/Items/ApplicationDockItem.vala'
- --- lib/Items/ApplicationDockItem.vala 2011-12-22 19:37:38 +0000
- +++ lib/Items/ApplicationDockItem.vala 2011-12-31 08:24:22 +0000
- @@ -302,7 +302,7 @@
- var pbuf = WindowControl.get_window_icon (window);
- if (pbuf == null)
- - DrawingService.load_icon (Icon, width, height);
- + pbuf = DrawingService.load_icon (Icon, width, height);
- else
- pbuf = DrawingService.ar_scale (pbuf, width, height);
- @@ -327,6 +327,7 @@
- string icon, text;
- parse_launcher (Prefs.Launcher, out icon, out text, shortcuts, shortcut_map);
- Icon = icon;
- + ForcePixbuf = null;
- Text = text;
- start_monitor ();
- === modified file 'lib/Items/DockItem.vala'
- --- lib/Items/DockItem.vala 2011-12-22 19:37:38 +0000
- +++ lib/Items/DockItem.vala 2011-12-31 08:42:03 +0000
- @@ -159,6 +159,8 @@
- */
- public string Icon { get; set; default = ""; }
- + protected Pixbuf? ForcePixbuf { get; set; default = null; }
- +
- /**
- * The dock item's text.
- */
- @@ -274,6 +276,7 @@
- Prefs.deleted.connect (handle_deleted);
- Gtk.IconTheme.get_default ().changed.connect (reset_icon_buffer);
- Prefs.changed["Icon"].connect (reset_icon_buffer);
- + Prefs.changed["ForcePixbuf"].connect (reset_icon_buffer);
- }
- ~DockItem ()
- @@ -281,6 +284,7 @@
- Prefs.deleted.disconnect (handle_deleted);
- Gtk.IconTheme.get_default ().changed.disconnect (reset_icon_buffer);
- Prefs.changed["Icon"].disconnect (reset_icon_buffer);
- + Prefs.changed["ForcePixbuf"].disconnect (reset_icon_buffer);
- }
- /**
- @@ -319,6 +323,8 @@
- {
- if (this.surface == null || surface.Width != this.surface.Width || surface.Height != this.surface.Height) {
- this.surface = new DockSurface.with_dock_surface (surface.Width, surface.Height, surface);
- + if (ForcePixbuf != null)
- + ForcePixbuf = DrawingService.ar_scale (ForcePixbuf, surface.Width, surface.Height);
- draw_icon (this.surface);
- AverageIconColor = this.surface.average_color ();
- @@ -333,8 +339,11 @@
- */
- protected virtual void draw_icon (DockSurface surface)
- {
- - var pbuf = DrawingService.load_icon (Icon, surface.Width, surface.Height);
- - return_if_fail(pbuf != null);
- + Pixbuf? pbuf = ForcePixbuf;
- + if (pbuf == null) {
- + pbuf = DrawingService.load_icon (Icon, surface.Width, surface.Height);
- + return_if_fail(pbuf != null);
- + }
- cairo_set_source_pixbuf (surface.Context, pbuf, 0, 0);
- surface.Context.paint ();
- }
- === modified file 'lib/Items/TransientDockItem.vala'
- --- lib/Items/TransientDockItem.vala 2011-09-06 09:09:44 +0000
- +++ lib/Items/TransientDockItem.vala 2011-12-31 08:41:09 +0000
- @@ -19,6 +19,7 @@
- using Gtk;
- using Plank.Drawing;
- +using Plank.Services.Windows;
- namespace Plank.Items
- {
- @@ -32,6 +33,9 @@
- var launcher = app.get_desktop_file ();
- if (launcher == "") {
- Text = app.get_name ();
- + var windows = WindowControl.get_windows (app);
- + for (var i = 0; i < windows.size && ForcePixbuf == null; i++)
- + ForcePixbuf = WindowControl.get_window_icon (windows.get (i));
- } else {
- Prefs.Launcher = launcher;
- load_from_launcher ();
Add Comment
Please, Sign In to add comment