GNOME Bugzilla – Bug 116647
GtkNotebook: tab states
Last modified: 2016-01-24 05:53:17 UTC
(See bug 72101 against the GNOME HIG for a general discussion about tab behaviour.) Some application use colors or icons to display the state of a tabbed page. It might be a worthwhile addition to Gtk+ to add the ability to do this easily. API draft: enum _GtkNotebookState { GTK_NOTEBOOK_STATE_NORMAL, GTK_NOTEBOOK_STATE_LOADING, GTK_NOTEBOOK_STATE_CHANGED, GTK_NOTEBOOK_STATE_ATTENTION, GTK_NOTEBOOK_STATE_UNSAVED }; typedef enum _GtkNotebookState GtkNotebookState; void gtk_notebook_tab_set_state(GtkNotebook *notebook, gint position, GtkNotebookState state); GtkNotebookState gtk_notebook_tab_get_state(GtkNotebook *notebook, gint position); This could draw an appropriate icon at the tab labels. The advantage of such an API is the ability to abstract the implementation and streamline applications. An alternative or an addition might be a convenience API like: gtk_notebook_tab_set_icon(GtkNotebook *notebook, gint position, GtkWidget *icon); GtkWidget *gtk_notebook_tab_get_icon(GtkNotebook *notebook, gint position); Please note that all this is fairly easily implementable in applications, too, so if you don't consider this a worthwhile addition to Gtk+, don't hesitate to close this bug. I will prepare an addition to the HIG that will recommend application authors to use a certain style when doing things like these described in this proposal. This addition could be removed from the HIG if this proposal was implemented.
Not sure this make sense; strikes me as rather specialized and it's not clear to me that every app will want exactly the same set of states. I'll leave it open for the moment, however. Maybe some simple API for notebook tab icons would be useful? Even there simply packing a hbox in is more general.
interesting idea. looking at this from gaim's standpoint, "GTK_NOTEBOOK_STATE_CHANGED" sounds more or less like the color change we color gray, for status changes and the like, "GTK_NOTEBOOK_STATE_LOADING" would probly work for typing notification (green), and "GTK_NOTEBOOK_STATE_ATTENTION" for the (red) unseen messages we use. referencing the colors not so much as critical, as to help visualize it how it would apply, mostly as an alternative use of this to what looks like a fairly editor/browser centric proposal.
*** Bug 362483 has been marked as a duplicate of this bug. ***
Is really bug 362483 a dupe of this? It seems that it has nothing to do with GtkNotebook..
Don't think we'll add something like this to GtkNotebook at this point