The xfce menu button doesn't adjust to its label width as shown in the attached screenshot.
Created attachment 455 Xfce menu with different labels
Hmm, when I try to change the label text, the process jumps to 100% CPU and just sits there. Didn't used to do this... gdb seems to show it's bouncing sizes and XfceScaledImage is going nuts. Why do we have XfceScaledImage anyway? What's wrong with GtkImage?
(In reply to comment #2) > Hmm, when I try to change the label text, the process jumps to 100% CPU and just > sits there. Didn't used to do this... > > gdb seems to show it's bouncing sizes and XfceScaledImage is going nuts. Why do > we have XfceScaledImage anyway? What's wrong with GtkImage? Probably because gtk image doesn't scale automatically ;-) That said, I was planning to remove the use of scaled image from the panel for a number of reasons, including this one.
Ok Jasper, here's the million-dollar question... Considering button padding and all that crap, what's the proper size to set the icon based on getting the size in the size-changed signal from the panel? (I'm planning on switching to GtkImage.)
(In reply to comment #4) > Ok Jasper, here's the million-dollar question... Considering button padding and > all that crap, what's the proper size to set the icon based on getting the size > in the size-changed signal from the panel? (I'm planning on switching to GtkImage.) Yes, I remember now, this is the real reason for the existence of xfce-scaled-image. I guess the image size is either: size - (1 + focus_padding + whatever other padding gtk buttons have) or: image->allocation.width/height In the latter case the image needs to be updated on "size-allocate", which will probably cause another event, so a check is required whether the size has in fact changed. Not sure yet if this will work. Btw, for icon theme support the image should be updated on "style-set" and "screen-changed", as far as I understand now, isn't it?
(In reply to comment #4) > Ok Jasper, here's the million-dollar question... Considering button padding and > all that crap, what's the proper size to set the icon based on getting the size > in the size-changed signal from the panel? (I'm planning on switching to GtkImage.) Ok, I add two convenience funtions to libxfce4panel: xfce_create_panel_button() and xfce_create_panel_toggle_button(), which create a regular gtk (toggle) button with GTK_RELIEF_NONE and GTK_WIDGET_UNSET_FLAGS(button, GK_CAN_DEFAULT|GTK_CAN_FOCUS). This reduces the padding to 1 + style->[xy]thickness. I use it for launchers and actions buttons, and it seems to work. You need libxfce4panel 4.3.29 for it.
*** Bug 1627 has been marked as a duplicate of this bug. ***
*** Bug 1632 has been marked as a duplicate of this bug. ***
Ok, I think this bug is fixed now.
maybe this is related to what you mean in the changelog by button still doesn't scale down well: when changing system fonts the plugin does not display correctly until one goes to properties and OKs the same text again. When fonts grow the label overwrites the icon, which is clipped to a new size When fonts shrink the plugin remains as large as it was with the former fonts, and has what looks like whitespace in the label.