Commit Graph

10 Commits

Author SHA1 Message Date
Matthias Clasen
2148708917 box gadget: Redo expand flag handling
We only keep one align flag per child, so it seems odd to
keep separate h/v expand flags. Just keep one expand flag
and interpret it according to orientation. Allow setting
the expand flag for child widgets too, though, so we can
make widget expand without interfering with the recursive
widget expand flag.

Update all callers.

Use the new possibility of expanding child widgets to make
the label of check and radio buttons expand. This fixes
unexpected behavior of these widgets in RTL in some places.

https://bugzilla.gnome.org/show_bug.cgi?id=765742
2016-04-28 21:59:34 -04:00
Matthias Clasen
2919e344ca box gadget: allow reversing alignments
In RTL, we want to interpret GTK_ALIGN_START and _END
in the opposite way. Since we don't give gadgets a text
direction, just allow setting an align_reverse flag
to the box gadget.
2016-04-28 21:59:34 -04:00
Matthias Clasen
c581259e06 box gadget: Add a way to allocate in reverse
This is needed to preserve expected allocation behavior
in rtl mode.
2016-03-03 21:28:51 -05:00
Cosimo Cecchi
6370d6cb27 boxgadget: add APIs to insert gadgets next to siblings 2016-02-29 10:45:13 -08:00
Cosimo Cecchi
06776d3d2f boxgadget: add API to set expand/align flags for gadget child 2016-02-29 10:45:13 -08:00
Benjamin Otte
245d217e06 boxgadget: Add ability to draw children in reverse
This is necessary for GtkNotebook so that the stack is always drawn
before the header.
And that is necessary so that the active tab can use negative
margins to overdraw the border of the stack to create a gap and
simulate old GTK2-style visuals for notebooks.
2016-02-27 03:59:20 +01:00
Matthias Clasen
ebff86d6f6 box gadget: Make it possible to draw focus
There are widgets which use a box gadget and take focus,
like GtkCheckButton.
2016-02-20 10:54:48 -05:00
Matthias Clasen
5265db5dd6 box gadget: Add a function to reverse children
This can be used to handle text direction changes.
2016-01-18 00:03:39 -05:00
Matthias Clasen
87171469b7 box gadget: Implement cross-axis alignment
So far, the box gadget is always allocating all children the
full size in the cross axis. This behavior corresponds to the
align-items: stretch behavior in
https://www.w3.org/TR/css-flexbox-1/#align-items-property
This commit implements the other modes described there.

While widgets have halign/valign properties that we can use for
this, the API for inserting gadgets has to change to take an
extra align parameter. All callers have been updated to pass
GTK_ALIGN_FILL, since that corresponds to the previous behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=760668
2016-01-15 09:43:12 -05:00
Benjamin Otte
acc534ebfa boxgadget: Add
Adds a GtkBoxGadget that is a Gadget that behaves like a GtkBox.

Use this gadget to implement the notebook base gadget.
2016-01-11 17:05:23 +01:00