GNOME Bugzilla – Bug 581774
sidebar
Last modified: 2009-05-15 21:05:37 UTC
This adds a the start of a sidebar, as sort of discussed in the spec. It's pretty obviously inspired by BigBoard... Depends on bug 581769 and bug 581771. Current state: - It exists, it has struts to keep your windows out of the way - Expandable/collapsable, like BigBoard, except with sexier animations :) - Current widgets: expand/collapse toggle, clock, app launcher. These are all just proof-of-concept. The app launcher just reuses the actors from appDisplay.js (which requires putting them onto a black background that clashes with the rest of the sidebar, because otherwise you can't read the white text, etc). We need to abstract out some code there... - In collapsed view, widgets default to showing a rotated title, as in BigBoard, and the expanded view pops out on hover. (You can see this with the app launcher widget.) However, alternatively, a widget can provide a separate collapsed view; the clock demonstrates this, by drawing an analog clock in collapsed view (which is not really that readable, but whatever). And really, I want the app launcher to display mini icons in the collapsed view, but I left it the way it is now to demonstrate/test pop-out. Also, probably we want things to be able to both have a separate collapsed view *and* do pop-out. (Eg, the clock could pop out a full date/time display, or maybe even the calendar.) - The current set of widgets is hardcoded in a variable in sidebar.js, but everything is set up for the idea of arbitrary widgets: const default_widgets = [ "imports.ui.widget.ClockWidget", "imports.ui.widget.AppsWidget" ]; Sidebar.addWidget() takes a string, verifies that it has the right form and refers to a constructor function for a class that inherits from imports.ui.widget.Widget, and then invokes that constructor to create the widget, puts it in a WidgetBox, and adds it to the sidebar. WidgetBox enforces the correct size and clipping on the widget, and all calls into methods provided by the widget are wrapped in try/catch blocks to protect the sidebar against bugs in widget code. Obviously none of this is actually secure against malicious code, but it should do an ok job with merely bad code. - Hides itself when going into the overlay, shows again on exit. The spec suggests that it's actually supposed to *turn into* the overlay's sidebar, though that may not really make sense graphically. Also, it probably ought to animate that transition... Also, there's supposed to be a hide/show sidebar item in the user menu, but there isn't yet. I guess next up is figuring how much the overall design should change, what additional/different functionality is needed, and making more widgets...
Created attachment 134211 [details] [review] Add an initial implementation of the sidebar This still needs design love, and none of the current widgets should be considered finalized, but it shows the basic ideas.
Not sure if I'm just tired, or it's a really nice patch, but I have no comments on it. :-) Looks clean, code is well documented, behaves nicely, should be a good starting point for more design work. (One observed bug with the clock redraw that Dan said he already has fixed) Not completely sure if the sidebar things should be called 'widget' - is a little confusing in the GNOME context - though it seems to be winning the generic name (facebook, dashboard, wordpress, etc.) compared to gadget (google, vista, maybe a few others.) We can always rename later.
committed. i'm thinking we're going to want to change the default mode from expanded to collapsed...