summaryrefslogtreecommitdiff
path: root/gtk/gtkboxgadget.c
Commit message (Collapse)AuthorAgeFilesLines
* box gadget: Redo expand flag handlingMatthias Clasen2016-05-051-65/+41
| | | | | | | | | | | | | | | | | 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
* box gadget: allow reversing alignmentsMatthias Clasen2016-05-051-4/+30
| | | | | | | 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.
* box gadget: Add a way to allocate in reverseMatthias Clasen2016-03-031-6/+30
| | | | | This is needed to preserve expected allocation behavior in rtl mode.
* boxgadget: add APIs to insert gadgets next to siblingsCosimo Cecchi2016-02-291-0/+34
|
* boxgadget: add API to set expand/align flags for gadget childCosimo Cecchi2016-02-291-8/+78
|
* boxgadget: Add ability to draw children in reverseBenjamin Otte2016-02-271-3/+15
| | | | | | | | 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.
* box gadget: Make it possible to draw focusMatthias Clasen2016-02-201-9/+16
| | | | | There are widgets which use a box gadget and take focus, like GtkCheckButton.
* box gadget: Fix allocation without baselineMatthias Clasen2016-02-071-21/+0
| | | | | | | | | | | When we don't get a baseline passed in, we want to basically center the children inside the allocation. There was an attempt in the code to do 'internal baseline alignment', but it had the side effect of moving the contents to the top when we don't get a baseline passed in. Remove it for now, this needs some more infrastructure to do properly. https://bugzilla.gnome.org/show_bug.cgi?id=761363
* box gadget: Improve assertion messageMatthias Clasen2016-01-261-1/+5
| | | | | | Include the owner of the gadget in the assertion message, to improve the chances of tracking down whats actually going wrong here.
* box gadget: Don't allow shifting too farMatthias Clasen2016-01-221-1/+1
| | | | | | | We don't want to let baseline adjustment shift the child out of the original allocation. This is purely a sanity measure - in practice, the baseline should always be bigger than the child_baseline.
* box gadget: Fix baseline calculationMatthias Clasen2016-01-221-4/+4
| | | | | | Careful comparison with GtkBox revealed that the box gadget code was confusing up and down, and thus shifted baselines vertically.
* box gadget: Fix baseline allocation for widgetsMatthias Clasen2016-01-221-78/+108
| | | | | | | | | | | We were adjusting the allocation to line up baselines before calling gtk_widget_size_allocate_with_baseline, but that function is doing this alignment internally anyway and expects to be given a 'fill' allocation. Move the allocation adjustment code down into gtk_box_gadget_allocate_child where it only affects child gadgets, not child widgets.
* box gadget: Fix height-for-width handlingMatthias Clasen2016-01-221-4/+6
| | | | | | | | | | When measuring children while distributing a given height, we must measure them for the given width that goes with the height. Otherwise, things will go wrong if some of the children do actual width-for-height. This was showing up as misaligned images in anaconda. https://bugzilla.gnome.org/show_bug.cgi?id=760967
* box gadget: Add a function to reverse childrenMatthias Clasen2016-01-181-0/+20
| | | | This can be used to handle text direction changes.
* box gadget: Deal with optional argumentsMatthias Clasen2016-01-171-2/+4
| | | | | The baseline arguments to the preferred size callback can be NULL. Don't crash if they are.
* box gadget: Implement cross-axis alignmentMatthias Clasen2016-01-151-7/+120
| | | | | | | | | | | | | | | 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
* boxgadget: Don't use g_assertTimm Bäder2016-01-141-1/+1
| | | | Use g_return_if_fail instead so nothing abort()s.
* box gadget: Add some documentationMatthias Clasen2016-01-121-3/+9
|
* boxgadget: Handle css nodesBenjamin Otte2016-01-111-2/+23
| | | | | Automatically insert the cssnode into the box gadget's node's children at the right place and remove it again when done.
* boxgadget: AddBenjamin Otte2016-01-111-0/+511
Adds a GtkBoxGadget that is a Gadget that behaves like a GtkBox. Use this gadget to implement the notebook base gadget.