[sugar] frame redesign

Marco Pesenti Gritti mpgritti
Mon Mar 3 08:39:26 EST 2008


On Sat, Mar 1, 2008 at 5:32 PM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
>
>  >  0ad5327f664e49ce7e32fee4deb307165c5e7732
>  >
>  >  +        if new_level == ShellModel.ZOOM_MESH:
>  >  +            self._mesh_button.props.active = True
>  >  +        elif new_level == ShellModel.ZOOM_FRIENDS:
>  >  +            self._groups_button.props.active = True
>  >  +        elif new_level == ShellModel.ZOOM_HOME:
>  >  +            self._home_button.props.active = True
>  >  +        elif new_level == ShellModel.ZOOM_ACTIVITY:
>  >  +            self._activity_button.props.active = True
>  >
>  >  I think we should start using the new style gobject properties in new code.
>
>  You mean 'self._activity_button.active = True' should work? It doesn't
>  work here with 2.14.0.

Hmmm we should take a closer look at this then, i.e. see what is
supposed to work and if it actually does.

>  >  There will be conflicts with the Tray vs Toolbar thing in the previous one.
>  >
>  >  af16fc5b4c2b15bee68656867355883146f07030
>  >  d61258768b33d8bb646c6bdf159ad46bc9059f19
>  >
>  >  What problems do you have there? I'll just note that sometimes it's easier
>  >  to use toggle buttons then radio, not sure if this is the case.
>
>  The problem is that shell_model.props.zoom_level is saying
>  ShellModel.ZOOM_ACTIVITY when it is really ShellModel.ZOOM_HOME, so
>  the radio button is wrong at start time.
>
>  I don't like much how the model stores the zoom level and the view has
>  a setter that does something else when changing levels. Perhaps we
>  should set and get from the model, and the view could listen for a
>  signal and take screenshots, etc.


The problem is that part of the zoom logic is handled by the window
manager, part by sugar. I don't remember the details but I know I was
not very happy with that logic and that it was buggy in some cases.


>  +        # TODO: setting box_width and hippo.PACK_EXPAND looks like a
>  hack to me.
>  +        # Why hippo cannot respect the request size of these controls?
>  +
>          zoom_toolbar = ZoomToolbar(self._shell)
>  -        panel.append(hippo.CanvasWidget(widget=zoom_toolbar),
>  hippo.PACK_EXPAND)
>  +        panel.append(hippo.CanvasWidget(widget=zoom_toolbar,
>  +                box_width=4*style.GRID_CELL_SIZE))
>          zoom_toolbar.show()
>
>  +        activities_tray = ActivitiesTray(self._shell)
>
> +        panel.append(hippo.CanvasWidget(widget=activities_tray),
>  +                hippo.PACK_EXPAND)
>  +        activities_tray.show()
>
>  If I don't set box_width and hippo.PACK_EXPAND, both the toolbar and
>  the tray appear with their minimum sizes (the toolbar shows a drop
>  down arrow and the tray shoes the two arrows). Why is hippo just
>  respecting the minimum size for the widgets and not using all the
>  available space?

Because of this and your note about pack_end below, I think it's
probably easier to just get rid of hippo in the frame than debugging
it, since that's on the plan anyway.

>  Thanks a lot for the review. I'm about to commit the home view work,
>  can you give it a look as well?

I will.

Marco



More information about the Sugar-devel mailing list