← Back to team overview

elementary-dev-community team mailing list archive

Re: Dynamic Notebook

 

On 08.05.2012 22:13, Tom Beckmann wrote:
> For me, friday would be best.
> My version of the dynamic notebook should be at least at the same
> level as the one in midori I think. So we'd just have to agree on its
> API if we'd decide to use it.
So Tom and I had a little productive chat there. I'll summarize my
proposed changes from Midori's perspective, with notes on use cases. The
other aspect is maintenance of the API, which is one reason for having a
Tab object.


Current implementation for reference:
http://bazaar.launchpad.net/~tombeckmann/granite/granite-dynamic-notebook-gkt-based/revision/232
https://code.launchpad.net/~tombeckmann/pantheon-terminal/terminal-dynamic-notebook


bool show_tabs → needed for fullscreen
bool show_close
Gtk.Widget append_tab (Tab tab)
Tab get_tab_by_index (int index)
Tab get_tab_by_widget (Gtk.Widget widget)
class Tab:
string? label → shouldn't display at all if empty, to allow icon-only tabs
GLib.Icon icon → interface supports GLib.ThemedIcon, GLib.FileIcon,
Gdk.Pixbuf, Folks.Avatar
bool active → spinner shows instead of icon
Gtk.Widget page
Pango.EllipsizeMode → Midori has smart ellipsis based on title and URL
of a website

Remove append_page
Remove toggle_working (cf. active above), toggle_app_tab (cf. empty
label above)
Remove 'public notebook' to allow replacing implementation freely in the
future, eg. custom labels, tabs-on-top etc.
show_icon - is it needed? if it is, make it apply on all tabs. otherwise
remove it

Behavior: Tab packing should reflect correct close button position
Other details such as click behavior are not crucial right now, as long
as API stays independent of the implementation.


For reference, excerpts from the discussion on IRC:

2059 @kalikiana> for example you can't cleanly, if at all, handle clicks
outside of tab labels
and you can't scroll the tab labels
you can scroll tab labels without affecting the page you see?
that said, as long as you abstract the api, this can be changed any time
2101 tom95> for the area outside the labels I'm not sure, havent tested it
2110 @kalikiana> one thought I have api-wise is a tab label widget. so
that you can replace
the Gtk.Image after creating a tab, instead of the notebook creating it
2112 tom95> we could always add a function to set the pixbuf for the tab
at index
2112 @kalikiana> so I'm looking at append_page, and it takes a string
which means no
pixbuf, no stock the most flexible actually would be GLib.Icon
2117 tom95> for my clutter version I wrote a tab class too, I just
thought it wouldn't be necessary here
but I guess you're right, especially for implementing the widget in
different ways
2124 @kalikiana> you see, this is where imho it gets ugly as you add 100
functions for individual feature :-]
btw we'd also want to remove the notebook property
any Gtk.Image can show it, and you can implement anything as a GLib.Icon
Icon really means Image here
there's logic for smart ellipsis in Midori. I'd like to bring that up as
a feature of the notebook
http://git.gnome.org/browse/gnome-contacts/tree/src/memory-icon.vala
nevermind, poixbuf IS a gicon
the thing is, if you add separate calls, you'll have "which gets
priority if you have more"
the biggest flaw of GLib.Icon is, GLib doesn't list all existing types
in the docs :-] (since it's too low in the stack)
but imho it is very nice api-wise. libfolks uses it, too: avatars are icons
so you could have avatars as tab icons for free

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References