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 721665 - Provide a better way to display contextual actions
Provide a better way to display contextual actions
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-01-07 00:07 UTC by William Jon McCann
Modified: 2014-01-07 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GtkActionBar (39.07 KB, patch)
2014-01-07 00:07 UTC, William Jon McCann
committed Details | Review
tests: use actionbar in headerbar test (2.74 KB, patch)
2014-01-07 00:07 UTC, William Jon McCann
committed Details | Review
widget-factory: add actionbar (1.61 KB, patch)
2014-01-07 00:07 UTC, William Jon McCann
committed Details | Review
a test (4.04 KB, patch)
2014-01-07 04:04 UTC, Matthias Clasen
none Details | Review
Fix order of pack-end widgets (1.39 KB, patch)
2014-01-07 04:35 UTC, Matthias Clasen
committed Details | Review
Add an action bar test (5.07 KB, patch)
2014-01-07 04:35 UTC, Matthias Clasen
committed Details | Review

Description William Jon McCann 2014-01-07 00:07:43 UTC
At the moment we don't have a great way to display contextual actions
in a direct way. Of course, menus are still a nice way to display such things
but they aren't directly accessible.

We often use GtkToolbar with the inline style class.

But toolbars are annoying for a number of reasons. They are a pain to pack with
widgets due to the "items". They have odd overflow behaviors. They are used
in so many different ways that they are hard to style without breaking someone else.

So, recently we've been abusing GtkHeaderBar for this. We don't want to dilute
the use of headbar because we'll fall into the same difficulty we have with 
theming toolbars. It is better to only use headers in the heading position.

Here is a patch to add a simple bar with a centered child.

It will be useful to implement action bars as seen in:
https://raw.github.com/gnome-design-team/gnome-mockups/master/cheese/png/windowed-shooting.png

and 

http://afaikblog.files.wordpress.com/2013/12/list2.png
Comment 1 William Jon McCann 2014-01-07 00:07:45 UTC
Created attachment 265485 [details] [review]
Add GtkActionBar

A widget intended to offer contextual actions for a given view.
It allows packing children into the start or end as well as offering
a single centered child box.
Comment 2 William Jon McCann 2014-01-07 00:07:48 UTC
Created attachment 265486 [details] [review]
tests: use actionbar in headerbar test

This is a great example of where headerbar should not be used.
Comment 3 William Jon McCann 2014-01-07 00:07:51 UTC
Created attachment 265487 [details] [review]
widget-factory: add actionbar
Comment 4 Matthias Clasen 2014-01-07 04:04:31 UTC
Created attachment 265505 [details] [review]
a test
Comment 5 Matthias Clasen 2014-01-07 04:10:29 UTC
Here's a testcase I've written which reveals a flaw in the positioning of pack-end widgets. I've fixed it for GtkHeaderBar - GtkActionBar should get the same fix.

No other comments, really. Looks like a fine, simple container to have. The documentation should probably have a reference to GtkHeaderBar, and the header bar docs one to GtkActionBar.
Comment 6 Matthias Clasen 2014-01-07 04:35:02 UTC
Created attachment 265507 [details] [review]
Fix order of pack-end widgets
Comment 7 Matthias Clasen 2014-01-07 04:35:12 UTC
Created attachment 265508 [details] [review]
Add an action bar test
Comment 8 William Jon McCann 2014-01-07 13:47:36 UTC
Attachment 265485 [details] pushed as e72aca0 - Add GtkActionBar
Attachment 265486 [details] pushed as 0a95515 - tests: use actionbar in headerbar test
Attachment 265487 [details] pushed as 51d462e - widget-factory: add actionbar
Attachment 265507 [details] pushed as b39f094 - Fix order of pack-end widgets
Attachment 265508 [details] pushed as 07f9b3f - Add an action bar test