Wednesday, February 20, 2008

Invisible icons

What is the best way to create an invisible applet/icon on the awn bar?

I've been playing around with a couple of approaches to see what gives the best results. There are three basic approaches I've been trying.

  1. Set the icon to a 1x1 transparent pixbuf. It works but you still have the awn-effects related padding around it taking up several more horizontal pixels.
  2. Use awn_draw_set_window_size() and set the dimensions to 0x0. If you do this you also need to combine with method 1. This seems to convince awn-effects to remove the buffer pixels... so the overall results are better. It seems to end up using 1 pixel.
  3. Just calling gtk_widget_hide() on the applet object itself seems to have similar results to 2. There is still a visible movement in the bar when the applet is completely removed, even when it is hidden.
Which method to use? I'm using all 3 when hiding the standalone-launcher applets. Though either 2 or 3 alone seems to give very similar results, using the two methods together appears to reduce the chance of a visual artifact appearing if it is removed (a brief appearance of the infamous white line). Please note this is extremely hard to confirm as it tends to be somewhat difficult to test.

If you don't feel like messing around with the awn-effects stuff my suggestion is that method 3 appears to work relatively well by itself.

I would still like to have the ability to hide an applet icon in such a way as to have no visible movement in the bar when the applet is removed. If anyone has thoughts on how to do this please leave a comment. thanks.

No comments: