Commit 6370d6cb authored by Cosimo Cecchi's avatar Cosimo Cecchi

boxgadget: add APIs to insert gadgets next to siblings

parent 6401e240
......@@ -690,6 +690,40 @@ expand_func_from_flags (gboolean hexpand,
: (vexpand ? only_vertical : (ComputeExpandFunc) gtk_false);
}
void
gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
GtkAlign align)
{
/* Insert at the end if no sibling specified */
int pos = -1;
if (sibling)
gtk_box_gadget_find_object (gadget, G_OBJECT (sibling), &pos);
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, hexpand, vexpand, align);
}
void
gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
GtkAlign align)
{
/* Insert at the beginning if no sibling specified */
int pos = 0;
if (sibling && gtk_box_gadget_find_object (gadget, G_OBJECT (sibling), &pos))
pos++;
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, hexpand, vexpand, align);
}
void
gtk_box_gadget_insert_gadget (GtkBoxGadget *gadget,
int pos,
......
......@@ -72,6 +72,19 @@ void gtk_box_gadget_insert_gadget (GtkBoxGadget
gboolean hexpand,
gboolean vexpand,
GtkAlign align);
void gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
GtkAlign align);
void gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
GtkAlign align);
void gtk_box_gadget_remove_gadget (GtkBoxGadget *gadget,
GtkCssGadget *cssgadget);
void gtk_box_gadget_reverse_children (GtkBoxGadget *gadget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment