[sugar] frame redesign

Tomeu Vizoso tomeu
Sat Mar 1 11:32:45 EST 2008


On Sat, Mar 1, 2008 at 2:48 AM, Marco Pesenti Gritti <mpgritti at gmail.com> wrote:
>
> On Fri, Feb 29, 2008 at 4:59 AM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
>
>  d7336f7358eba894616f47e32d8061bad6a3e4f0
>
>  Talked with Eben. The zoom buttons should actually stay in a toolbar. The
>  activity icons should be in a separate Tray, on the right of the zoom toolbar.
>  That way if activities scroll, the zoom buttons stays in screen.

Ok.

>  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.

>  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.

>  f0689cc5bde7235ce73be14414a2648070215959
>
>         activitiestray.py               \
>  +       activitiestray2.py              \
>
>  I suppose the 2 is temporary. Any reason to do this? The rename will mess up
>  the history. Hmm, I guess I'm confused by this one, You are modifying both
>  versions of the tray and I'm not sure which one we are going to use...

Sorry about the confusion. activitiestray2.py is the old activities
tray in the bottom frame. I kept it for a while because I needed a way
of launching activities.

+        # 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?

>  3677745a10fbc7481fa1da02bd7b4c63e28d0deb
>
>  +        if home_activity.props.launching:
>  +            palette = Palette(_('Starting...'))
>  +            palette.props.invoker = FrameWidgetInvoker(self)
>  +            palette.set_group_id('frame')
>  +            self.set_palette(palette)
>  +
>  +            #self._start_pulsing()
>  +            home_activity.connect('notify::launching',
>  self._launching_changed_cb)
>  +        else:
>  +            self._setup_palette()
>
>  Maybe it would be cleaner to have the launching case inside _setup_palette too?

Agreed.

>  1c2ce9f1c374e85b3174a6a8868cb6fad15cb715
>
>  -        self.props.icon_name = name
>  +        self.get_icon().props.icon_name = name
>
>  Can we fix the toolkit and make this:
>
>  self.icon.props.icon_name = name

Done

>  (should get even more convenient if we start using the new style gobject props).
>
>  +        view = deviceview.create(device)
>  +        self.pack_end(view, expand=False, fill=False, padding=0)
>
>  I'd rather pack_end the container then each widget, if that works as well.

We would have to set xalign = hippo.ALIGNMENT_END in the CanvasBox
inside the FrameWindow, but that's not accessible from outside.

If/when we remove hippo from the frame, then we'll be able to pack_end
as you say.

>  +        """
>          activities_tray = activitiestray2.ActivitiesTray(self._shell)
>          panel.append(hippo.CanvasWidget(widget=activities_tray),
>  hippo.PACK_EXPAND)
>  +        """
>
>  Please remove this.

Done

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

Thanks,

Tomeu



More information about the Sugar-devel mailing list