[Sugar-devel] [DESIGN] Width of the TitleEntry widget

James Cameron quozl at laptop.org
Fri Mar 12 03:35:43 EST 2010


On Fri, Mar 12, 2010 at 04:44:59AM +0530, Sayamindu Dasgupta wrote:
> I noticed that in some locales in Sugar 0.84, the "Stop" button
> disappear because the translation of the items in "Share with" are
> long.

The same symptom has also happened as a result of font size changes, and
X display resolution changes.  ;-(  It is not only the "Share with"
translations.

> I noticed that the TitleEntry widget takes up 1/3 of the screen width,
> and the problem goes away for all the problematic locales if the width
> is set to 1/4 instead.

I don't think this is the right way to fix the problem.  It will work
for only as long as the fonts don't change again.

It also has the unpleasant side-effect of reducing the size of the
TitleEntry.

I've analysed the code in this section, in both 0.84 and HEAD, and I
think the problem is one of geometry negotiation between the Stop button
and the SeparatorToolItem.  The amount of space left for the Stop button
after negotiation seems to be only a few pixels short of what the button
actually needs, which makes me thing the calculation is incorrect.

The Toolbar is laid out with the following widgets:

- the title,
- the separator, which expands in order to right-justify the rest,
- the share combobox,
- the keep button,
- the stop button.

The ideal situation is that the separator begins with a zero size, the
title size is negotiated up to a minimum size, and the separator
negotiates up until the remaining widgets on the toolbar are about to
fail to fit.

Have you tried doing a set_size_request() for the ToolButtons instead?

Or perhaps the ToolButton, being a Sugar local widget, is not
negotiating size in the correct fashion.  It knows the size of the icon,
so it should be able to ask for the size it needs.

It may be useful to add debugging code to dump the size-allocate and
size-request signals of the Stop button container.

Can you show how to force the problem to occur?

(I also considered the arrow methods of the gtk.Toolbar as a sort of
brute force size renegotiator, but I think that's a last resort.)

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Sugar-devel mailing list