After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 307044 - Sidebar widget
Sidebar widget
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
2.6.x
Other Linux
: Normal enhancement
: Medium API
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-06-09 17:35 UTC by Bastien Nocera
Modified: 2013-10-06 06:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk-sidebar.h (1.68 KB, text/plain)
2005-06-24 14:32 UTC, Bastien Nocera
  Details
gtk-sidebar.h (1.94 KB, text/plain)
2005-06-30 15:49 UTC, Bastien Nocera
  Details
gtk-sidebar-draft.patch (20.12 KB, patch)
2006-02-10 16:45 UTC, Bastien Nocera
needs-work Details | Review

Description Bastien Nocera 2005-06-09 17:35:29 UTC
Totem, nautilus and evince (at least) are using a sidebar.
It would be nice to have a GTK+ sidebar widget.
Comment 1 Federico Mena Quintero 2005-06-15 01:18:09 UTC
Do you have an API proposal?
Comment 2 Bastien Nocera 2005-06-15 07:45:58 UTC
I'll check what Nautilus and Evince are using, and propose something.
Comment 3 Bastien Nocera 2005-06-24 14:32:54 UTC
Created attachment 48278 [details]
gtk-sidebar.h

Here's a possible API for the sidebar widget. I think it would easily replace
the current sidebars in Evince, nautilus (and the least needy of them, Totem).
Comment 4 Bastien Nocera 2005-06-24 14:40:21 UTC
The only API that doesn't really have a match in nautilus would be the
nautilus_side_pane_set_panel_image() function. I'm not too sure what it's
supposed to do (add an icon for the menu item?). Alex?
Comment 5 Marco Pesenti Gritti 2005-06-24 14:49:04 UTC
I seem to remember Galeon/Epiphany has some special needs, for the case when the
sidebar content is provided by the mozilla backend. I dont remember the details,
and I'm not sure if extending this widget would be enough... Though I'm sure
chpe and crispin can provide input on this.
Comment 6 Crispin Flowerday (not receiving bugmail) 2005-06-24 15:05:57 UTC
The only special need Galeon/Epiphany have is that the sidebar pages can be
removed by the user (we show a little rubbish bin icon next to the sidebar close
button). This emits a signal, allowing the application to remove the page. Only
some of the pages are user-removable. For pages that aren't user-removable, the
rubbish bin icon is insensitive. This could be optimised in to not be visible if
none if the pages can be removed.

The Galeon sidebar impl is in:

http://cvs.gnome.org/viewcvs/galeon/utils/galeon-sidebar.h?view=markup
Comment 7 Federico Mena Quintero 2005-06-24 16:20:01 UTC
Just because I'm a lazy bastard to look it up myself, could you please attach a
screenshot or mockup of how this is supposed to look, more or less?

Also, you specify char *page_title.  I assume that some things will want to have
an icon as well.  GtkNotebook lets you set a "label widget" rather than a
string; that widget can of course be anything.
Comment 8 Alexander Larsson 2005-06-27 07:46:56 UTC
nautilus_side_pane_set_panel_image() is used to add an icon to the tab bar which
works as a shortcut to the page. Its main use is to add a note icon when there
is a note for the currently displayed location.
Comment 9 Bastien Nocera 2005-06-30 15:48:01 UTC
For both of Galeon and Nautilus, it looks like the APIs are only to get a button
next to the close button. Updated header below.

The API looks a bit too full to me. Do we want to identify the pages by their
main widget, or using a page_id, or both?
Comment 10 Bastien Nocera 2005-06-30 15:49:03 UTC
Created attachment 48459 [details]
gtk-sidebar.h

Updated API with the possibility to add an arbitrary widget next to the close
button which seems to fit both Galeon and Nautilus' requirements.
Comment 11 Tommi Komulainen 2005-06-30 15:57:58 UTC
If the implementation is intended to have a dropdown list, the API should
probably be closer to GtkEntryCompletion - to use GtkTreeModel and thus enable
one to include icons in the dropdown.
Comment 12 Bastien Nocera 2005-06-30 16:54:20 UTC
I don't think we need to use that kind of API.

I still need to change the API to use an arbitrary widget for the drop-down menu
item, but we do not need the whole lot of features that using a GtkTreeModel
would give us.

The API should probably resemble that of GtkNotebook with a lot trimmed.
Comment 13 Bastien Nocera 2006-02-10 16:45:27 UTC
Created attachment 59083 [details] [review]
gtk-sidebar-draft.patch
Comment 14 Bastien Nocera 2006-02-10 17:53:51 UTC
This is the first draft of the sidebar. The button isn't implemented at all, some functions aren't implemented either, and there's something funny about the append page in which it will get a different page shown than the one it should be.

The API is closer to what we would need though. Comments from the other users of sidebars?
Comment 15 Christian Dywan 2008-10-20 15:05:38 UTC
From a quick overlook of the API, I'm missing the ability to use stock identifiers and, more importantly, any icons. My use case is a panel with a text and an icon for each page.

And why are you using page_id in the form of a string? Following in the foot steps of GtkNotebook with page numbers would seem intuitive to me, and that's what I did in code for a sidepanel that I implemented.

A demo program would be nice..
Comment 16 Carlos Garcia Campos 2009-10-08 13:55:44 UTC
There are more and more applications using a sidebar, so I would like to revive this bug. There's still one thing I don't like about the current implementations, the drop-down menu makes the sidebar options hard to discover. In evince, for instance, we use the sidebar for several document features (thumbnails, index, attachments, layers), since the sidebar shows only the active page, it's imposible to know what other features it contains, unless you explicitly look at the drop-down menu. 
See bug #510686 where I posted some attachments with possible solutions. What do you guys think? any other idea?
Comment 17 Allan Day 2010-04-14 11:54:18 UTC
(In reply to comment #16)
> There are more and more applications using a sidebar, so I would like to revive
> this bug.

Agreed. This is something that we talked about at the Usability Hackfest in London.

> There's still one thing I don't like about the current
> implementations, the drop-down menu makes the sidebar options hard to discover.

I agree with this too - it's a big problem with the sidebar that is used in Nautilus. Anything that isn't Places rarely gets used (if ever).
Comment 18 André Klapper 2012-05-06 21:18:02 UTC
Comment on attachment 59083 [details] [review]
gtk-sidebar-draft.patch

Patch uses API deprecated in 2.24 and removed in 3.x, e.g. GTK_WIDGET_NO_WINDOW => marking as "needs-work"