[sugar] Merging sugar-toolkit changes from tomeu repository

Tomeu Vizoso tomeu at tomeuvizoso.net
Wed Mar 26 11:09:18 EDT 2008


On Wed, Mar 26, 2008 at 1:32 PM, Marco Pesenti Gritti
<mpgritti at gmail.com> wrote:
>
> On Wed, Mar 26, 2008 at 12:09 PM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
>  > On Wed, Mar 26, 2008 at 11:52 AM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
>  >  > On Wed, Mar 26, 2008 at 12:23 AM, Marco Pesenti Gritti
>  >  >  <mpgritti at gmail.com> wrote:
>  >  >  >  2 Accell support.
>  >  >
>  >  >  First patch attached.
>  >
>  >  Sorry, one file was missing.
>
>  Here are the problems I see with the patch (I know you are aware of
>  some of these):
>
>  1 We are picking a random accel group from the window (well the first one).
>  2 We are duplicating a lot of non trivial code in each toolbar item
>  implementation.
>  3 I still don't like the idea of using translated strings as
>  accelerators. More importantly I don't think we should differ from gtk
>  in such a basic functionality.
>
>  All of these looks pretty difficult to solve.

So, trying to summarize discussion in #sugar:

1 Accel group will be pushed from the top level window downwards.
s.g.Window would push it to the toolbox, which would push it into the
toolbars and then into the toolitems. (see details below)

2 We'll share the duplicated code similarly by simply sharing some
methods without inheritance.

3 Not really part of the API, I would prefer if this decision was
taken by the translation groups, but personally don't feel as
strongly.

4 (Having our own AccelLabel) This is needed for showing diamonds
instead of "ctrl" or "alt". We'll drop it by now and later try to do
this with the upstream AccelLabel.

When setting up the UI, the window creates an accel_group and gives it
to the toolbox:
toolbox.set_data('accel_group', accel_group)

The toolbox will do the same to the toolbar and the toolbar to the toolitems.

ToolItems and Toolbars will listen for parent-set, and then set the
accelerator to that accel_group.

Marco, what about shortcuts for widgets not in the toolbar and CanvasItems?

Thanks,

Tomeu


More information about the Sugar mailing list