GNOME Bugzilla – Bug 354416
Panel applet doesn't resize on panel resizing
Last modified: 2008-02-26 20:45:55 UTC
Hi, with 0.4.0 the icon of the panel applet is 200x200 pixels large. This is caused by the commit that added OnSizeAllocated() to Tray.cs. + protected override void OnSizeAllocated (Gdk.Rectangle rect) + { + base.OnSizeAllocated (rect); + + int icon_size = Math.Min (rect.Height, rect.Width); + if (icon_size_last != icon_size) { + icon_size_last = icon_size; + image.Pixbuf = GuiUtils.GetIcon (GetIconName (), icon_size); + } + } In the above block rect.Height and rect.Width are both 200 although the panel is only 24 pixels heigh. It works fine in the notification area too. Bye
As far as I'm concerned, this is a bug in the panel. Abitrarily allocating 200x200 to applets is broken. How do other applets work around this?
Mixer applet uses change_size from PanelAppletClass... so probably PanelApplet.ChangeSize event or PanelApplet.OnChangeSize.
Created attachment 72283 [details] [review] icon size This patch against the gnome-2-16 branch works for me here.
Yes this looks fine except that you should remove ReloadIcon() and icon_size_last too probably
I would but there are still some "Tintin" bits in cvs that use ReloadIcon. I am unsure of their purpose so I'd leave that to the maintainer.
This is fixed in CVS (both HEAD and gnome-2-16 branch) with a slightly different patch: it sets PanelAppletFlags.ExpandMinor to get more detailed sizing allocations, and in OnChangeSize sets the icon's size request. Please give this a try and reopen if you're still seeing problems. Thanks!
Well, one gets a small icon now but it doesn't change the size when resizing the panel which it normally should and which I would assume Yanko's patch does.
Yep, his patch gets the scaling right when the panel is resized :(
Created attachment 76962 [details] [review] tomboy-panel-resize.patch Worked through a few issues and this patch appears to work against the latest CVS. Does anyone else have success with it? If so, I will go ahead and check it in.
So I don't understand this bug. Tomboy run as a panel applet resizes perfectly for me, fetching the closest sized theme icon at all sizes I try. Are you guys sure you're running tomboy after a make install, so all the image files are present?
Yes, all icons and everything is installed for me. Boyd's patch works fine for me btw... The bug I told him about earlier today with that patch is not reproducible, probably a mistake on my side.
(In reply to comment #10) > So I don't understand this bug. Tomboy run as a panel applet resizes perfectly > for me, fetching the closest sized theme icon at all sizes I try. Yes. Running as a panel applet worked fine. The problem is when you run Tomboy from the command-line and the TrayIcon appears in the Notification Area. If you resize your panel, it doesn't resize correctly. Try increasing your panel to 120px and then back down to 24px. With the patch above (there's likely an easier way to make this work), it now resizes correctly for either way you choose to run Tomboy.
The real problem is (in the Notification Area by running command-line) the code: int icon_size = Math.Min (rect.Width, rect.Height); For whatever reason, after you have Tomboy running and then adjust the panel size to be bigger (say up to 120px), rect.Width stays the same while rect.Height gets larger (probably a bug in . So, if you have Tomboy showing up in the bottom/top panel and make the panel larger, it doesn't adjust correctly. It stays small. This is the reason for having to pay attention to both the width and the height. If either one of them changes, the icon should be resized. However, resizing the icon appears to cause OnSizeAllocated () to be called again. This is why it's still important to keep track of the actual size of the icon in the "icon_size_last" variable so we don't actually cause a resize twice for a one pixel adjustment. Make any sense? If someone can think of an easier way to pull this off correctly, please say, or point me down the right direction and I can rework the patch if necessary.
Created attachment 76996 [details] [review] tomboy-panel-resize.patch: Much cleaner solution Thanks to Alex's brilliance, this patch is much cleaner and works well.
Checked-in latest patch to CVS Head.
With recent CVS when I start tomboy in notification area mode (by launching 'tomboy') it will display the scalable icon. Could this be caused by this patch?
Created attachment 81552 [details] [review] Cleaner patch that takes into account the orientation of the panel I've been getting some complaints that the icon is too close to the edge of the panel. This patch addresses the issue by using an icon 4 pixels less than the allocated area we're given. I also reworked the code so it's a bit cleaner and pays attention to whether the panel tomboy's attached is horizontally or vertically oriented.