PolkitLockButton size issues

Milan Bouchet-Valat nalimilan at club.fr
Sun Sep 20 07:55:49 PDT 2009


Hi!

I'm experiencing problems with the sizing of the new PolkitLockButton,
that are both Polkit-GTK's fault, and linked to how GTK+ more generally
works.

The issue basically comes from the fact that the new button is quite
wide, compared to its predecessor(s) that we used to label "Unlock".
this is fine, because it's much more explicit for the user. The problem
is, it now takes much more horizontal space than standard buttons. This
means that when packed into a GtkButtonBox, it forces all buttons to be
as wide as itself. Thus, we get funny-looking dialogs, which can get
really wide.

Imagine that translated into French, the button reads "Cliquez pour
effectuer des modifications"; pack it into a button box with three
children, and you get a dialog that can be as large as the screen,
without any reason. In the gnome-system-tools, we only have two buttons,
plus the PolkitLockButton, and I'm concerned about this with some
languages, where we could exceed the screen's size, especially on
netbooks.

One solution would be to get rid of the GtkButtonBox in favor of a
custom GtkHBox, that does not set homogeneous sizes. But that means you
have to implement callbacks for buttons yourself, instead of using the
very convenient gtk_dialog_add_button (). I've considered it, but
eventually come to the conclusion that it would be stupid.

So I think that we should improve GTK+ and the PolkitLockButton to
support this. The GtkButtonBox should allow widgets not to follow the
homogeneous size policy, since that feature is only useful to get
consistent *GtkButtons* in the box. The lock button has a very different
appearance, it does not need this. So I'm wondering what you think about
that idea, which can be implemented by checking the class of the widget,
or by using some property (trickier). If you don't already have a
proposal for this, and you agree with mine, I can mail the
gtk-devel-list and see what we could do.


Another slightly unrelated problem is that the lock button should not
resize itself when its text changes. That's a minor bug that can be
fixed in PolicyKit-GTK itself. It has very bad consequences on our
dialogs, since they get wider when you have unlocked the button.


Hope we can fix those problems without too complex designs...

Cheers




More information about the polkit-devel mailing list