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 723929 - Add a generic center box
Add a generic center box
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-02-08 22:37 UTC by William Jon McCann
Modified: 2014-02-12 13:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rename GtkActionBar to GtkCenterBox (30.54 KB, patch)
2014-02-08 22:37 UTC, William Jon McCann
none Details | Review
Add new ActionBar (20.00 KB, patch)
2014-02-08 22:37 UTC, William Jon McCann
none Details | Review
tests: add a visibility toggle to the action bar test (1.63 KB, patch)
2014-02-08 22:37 UTC, William Jon McCann
none Details | Review
Rename GtkActionBar to GtkCenterBox (30.54 KB, patch)
2014-02-11 21:00 UTC, William Jon McCann
committed Details | Review
Add new ActionBar (19.54 KB, patch)
2014-02-11 21:00 UTC, William Jon McCann
committed Details | Review
tests: add a visibility toggle to the action bar test (2.36 KB, patch)
2014-02-11 21:00 UTC, William Jon McCann
committed Details | Review

Description William Jon McCann 2014-02-08 22:37:11 UTC
This turns GtkActionBar into GtkCenterBox and creates a new GtkActionBar
that has an internal revealer.
Comment 1 William Jon McCann 2014-02-08 22:37:13 UTC
Created attachment 268534 [details] [review]
Rename GtkActionBar to GtkCenterBox
Comment 2 William Jon McCann 2014-02-08 22:37:22 UTC
Created attachment 268535 [details] [review]
Add new ActionBar
Comment 3 William Jon McCann 2014-02-08 22:37:26 UTC
Created attachment 268536 [details] [review]
tests: add a visibility toggle to the action bar test
Comment 4 Matthias Clasen 2014-02-09 00:43:36 UTC
Review of attachment 268535 [details] [review]:

::: gtk/gtkcenterbox.c
@@ -37,3 @@
  * @See_also: #GtkBox
  *
- * GtkCenterBox is similar to a horizontal #GtkBox, it allows to place

This should go into the first commit
Comment 5 Matthias Clasen 2014-02-09 00:44:39 UTC
Running testactionbar, I get

(lt-testactionbar:12741): Gtk-WARNING **: GtkButton 0x1b6c350 is mapped but visible=1 child_visible=1 parent GtkCenterBox 0x1b42250 mapped=0
Comment 6 William Jon McCann 2014-02-11 21:00:01 UTC
Created attachment 268843 [details] [review]
Rename GtkActionBar to GtkCenterBox
Comment 7 William Jon McCann 2014-02-11 21:00:04 UTC
Created attachment 268844 [details] [review]
Add new ActionBar
Comment 8 William Jon McCann 2014-02-11 21:00:07 UTC
Created attachment 268845 [details] [review]
tests: add a visibility toggle to the action bar test
Comment 9 Matthias Clasen 2014-02-12 03:24:35 UTC
Review of attachment 268843 [details] [review]:

I still hope that we can drop this and add the center widget to GtkBox, but for now this is ok. It is certainly a better name for this generic container
Comment 10 Matthias Clasen 2014-02-12 03:46:20 UTC
Review of attachment 268844 [details] [review]:

::: gtk/gtkactionbar.c
@@ +41,3 @@
+ *
+ * It allows placing children at the start or the end. In addition, it
+ * contains an internal centered box which is centered with respect to

It is not really a box, and not really internal either (after all, you;re setting it with set_center_widget).

@@ +48,3 @@
+struct _GtkActionBarPrivate
+{
+  GtkWidget *center_box;

should rename this to center_widget, to match the setter, and the fact that it is not a box.

@@ +157,3 @@
+                                      pspec->name,
+                                      value);
+}

Not that it is very likely to occur in practice, but I think you need to just return the default value here, for the revealer. Compare gtkheaderbar
Comment 11 Matthias Clasen 2014-02-12 03:46:45 UTC
Review of attachment 268845 [details] [review]:

sure
Comment 12 William Jon McCann 2014-02-12 13:47:58 UTC
Attachment 268843 [details] pushed as c86ee05 - Rename GtkActionBar to GtkCenterBox
Attachment 268844 [details] pushed as d0a654e - Add new ActionBar
Attachment 268845 [details] pushed as 70a2772 - tests: add a visibility toggle to the action bar test