! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Xfce menu button doesn't expand/shrink
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Olivier Fourdan editbugs 2006-02-20 20:47:28 CET
The xfce menu button doesn't adjust to its label width as shown in the attached
screenshot.
Comment 1 Olivier Fourdan editbugs 2006-02-20 20:48:05 CET
Created attachment 455 
Xfce menu with different labels
Comment 2 Brian J. Tarricone (not reading bugmail) 2006-02-21 01:12:40 CET
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?
Comment 3 Jasper Huijsmans editbugs 2006-02-21 08:50:57 CET
(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.
Comment 4 Brian J. Tarricone (not reading bugmail) 2006-02-24 07:51:47 CET
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.)
Comment 5 Jasper Huijsmans editbugs 2006-02-24 15:43:46 CET
(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?

Comment 6 Jasper Huijsmans editbugs 2006-02-26 09:50:30 CET
(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.
Comment 7 Brian J. Tarricone (not reading bugmail) 2006-03-31 09:13:39 CEST
*** Bug 1627 has been marked as a duplicate of this bug. ***
Comment 8 Brian J. Tarricone (not reading bugmail) 2006-04-03 08:46:08 CEST
*** Bug 1632 has been marked as a duplicate of this bug. ***
Comment 9 Brian J. Tarricone (not reading bugmail) 2006-04-05 23:46:19 CEST
Ok, I think this bug is fixed now.
Comment 10 Jani Monoses 2006-04-07 07:05:21 CEST
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.

Bug #1483

Reported by:
Olivier Fourdan
Reported on: 2006-02-20
Last modified on: 2009-07-14
Duplicates (2):
  • 1627 desktop panel plugin hangs on changing fonts
  • 1632 adding third menu to panel causes 100% CPU time and hanging

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
3 users

Version

Attachments

Xfce menu with different labels (3.60 KB, image/png)
2006-02-20 20:48 CET , Olivier Fourdan
no flags

Additional information