Re: Sharing the places sidebar between Nautilus and GTK+

On Tue, 06 Sep 2011 17:44:01 -0500
Federico Mena Quintero <federico gnome org> wrote:

> Hi, everyone,
> There is a patch in [1], by Jon McCann, to make the shortcuts bar in
> GtkFileChooser be pretty much the same as the one in Nautilus.
> Rather than patch the wobbly edifice that is gtkfilechooserdefault.c,
> this sounds like the perfect time to actually pull out the shortcuts
> bar as a public class of its own, that is shared by both the file
> chooser and Nautilus.
> My plan is this:
> 1. Copy nautilus-places-sidebar.[ch] into the GTK+ sources.

To be honest, I think we can do better than this. The user experience
offered by the current places sidebar is far from ideal IMHO. In
Nautilus 3.x 
  * the sidebar has no mount/eject progress indicators,
  * the eject buttons do not look/feel clickable, i.e., they don't
    change their appearance on hover events, 
  * and the categories are a bit messed up (e.g. I have a few disks in
    "Computer", other in "Devices"; mounted archives pop up in
    "Network") and so on.

Of course, some of these missing features are due to cell renderer
limitations, e.g. last time I tried, I couldn't get hover-in/hover-out
events for individual cells to work good enough to implement a
fully-working button renderer. But still, the places sidebar has more
potential and the current implement feels somewhat half-baked.

For Thunar, I'm currently working on a widget to replace the
GtkTreeView in the sidebar:

This sidebar consists of four classes (ThunarShortcutsModel
and ThunarShortcut for modeling the data, the custom widgets
ThunarShortcutsView and ThunarShortcutRow for representing the view
with its rows). You can already check out the current state here:

I realize that, aside from the code still being somewhat rough and
imcomplete, this is nothing we'd want to stuff into GTK+. In
particular, faking the look of a tree view with custom widgets may seem
like a hack to most people (even though standard GTK+ drawing routines
are used). On the other hand it is fun to use and shows how the places
sidebar *could* work IMHO:

  * progress indicators for async operations, 
  * real mount/eject/cancel buttons ('cuz spinners alone are not
  * individual row/button highlighting on hover,
  * keyboard navigation works (even switching between rows and
    buttons is possible), 
  * a GtkTreeModel is used to model the data,
  * all file information is resolved asynchronously, and
  * categories are less cluttered and messed up (every location pops up
    only once; archives and devices appear in "Devices",
    personal folders and bookmarks appear in "Places", remote locations
    and the "Network" button show up in "Network").

I guess what I'm trying to say is... if you merge something like the
places sidebar into GTK+ (as part of the public API), don't just take
the existing sidebar as it is; please improve it to make really useful.
I'd be happy to drop our sidebar if there's a good one in GTK+ (and if
there's anything I can do to help with that, let me know).

  - Jannis

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]