restructured toolbox to use a single gtk_hwrap_box with the added "forced

2000-02-07  Kelly Lynn Martin  <kelly@poverty.bloomington.in.us>

	* app/interface.c: restructured toolbox to use a single
	gtk_hwrap_box with the added "forced break" functionality to make
	the selector boxes not run in with the rest of the tool buttons.
	The toolbox should now not cut things off, although if the user
	selects a really small toolbox the buttons or selectors may be,
	um, difficult to use...

	* app/gtkwrapbox.h:
	* app/gtkwrapbox.c:
	* app/gtkvwrapbox.c (reverse_list_col_children):
	* app/gtkhwrapbox.c (reverse_list_row_children): support for
	"forced break" functionality needed for toolbox -- will forward
	patches to Tim Janik as well
This commit is contained in:
Kelly Lynn Martin
2000-02-07 10:51:08 +00:00
committed by Kelly Martin
parent 827e9ddad7
commit 77c44b21e1
12 changed files with 185 additions and 38 deletions

View File

@ -42,7 +42,8 @@ enum {
CHILD_ARG_HEXPAND,
CHILD_ARG_HFILL,
CHILD_ARG_VEXPAND,
CHILD_ARG_VFILL
CHILD_ARG_VFILL,
CHILD_ARG_FORCED_BREAK
};
@ -166,6 +167,8 @@ gtk_wrap_box_class_init (GtkWrapBoxClass *class)
GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_VEXPAND);
gtk_container_add_child_arg_type ("GtkWrapBox::vfill",
GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_VFILL);
gtk_container_add_child_arg_type ("GtkWrapBox::forcebreak",
GTK_TYPE_BOOL, GTK_ARG_READWRITE, CHILD_ARG_FORCED_BREAK);
}
static void
@ -299,6 +302,10 @@ gtk_wrap_box_set_child_arg (GtkContainer *container,
hexpand, hfill,
vexpand, GTK_VALUE_BOOL (*arg));
break;
case CHILD_ARG_FORCED_BREAK:
gtk_wrap_box_set_child_forced_break (wbox, child,
GTK_VALUE_BOOL (*arg));
break;
default:
break;
}
@ -457,6 +464,7 @@ gtk_wrap_box_pack (GtkWrapBox *wbox,
child_info->hfill = hfill ? TRUE : FALSE;
child_info->vexpand = vexpand ? TRUE : FALSE;
child_info->vfill = vfill ? TRUE : FALSE;
child_info->forced_break = FALSE;
child_info->next = NULL;
if (wbox->children)
{
@ -565,6 +573,27 @@ gtk_wrap_box_query_child_packing (GtkWrapBox *wbox,
}
}
void
gtk_wrap_box_query_child_forced_break (GtkWrapBox *wbox,
GtkWidget *child,
gboolean *forced_break)
{
GtkWrapBoxChild *child_info;
g_return_if_fail (GTK_IS_WRAP_BOX (wbox));
g_return_if_fail (GTK_IS_WIDGET (child));
for (child_info = wbox->children; child_info; child_info = child_info->next)
if (child_info->widget == child)
break;
if (child_info)
{
if (forced_break)
*forced_break = child_info->forced_break;
}
}
void
gtk_wrap_box_set_child_packing (GtkWrapBox *wbox,
GtkWidget *child,
@ -601,6 +630,32 @@ gtk_wrap_box_set_child_packing (GtkWrapBox *wbox,
}
}
void
gtk_wrap_box_set_child_forced_break (GtkWrapBox *wbox,
GtkWidget *child,
gboolean forced_break)
{
GtkWrapBoxChild *child_info;
g_return_if_fail (GTK_IS_WRAP_BOX (wbox));
g_return_if_fail (GTK_IS_WIDGET (child));
forced_break = forced_break != FALSE;
for (child_info = wbox->children; child_info; child_info = child_info->next)
if (child_info->widget == child)
break;
if (child_info &&
(child_info->forced_break != forced_break))
{
child_info->forced_break = forced_break;
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (wbox))
gtk_widget_queue_resize (child);
}
}
guint*
gtk_wrap_box_query_line_lengths (GtkWrapBox *wbox,
guint *_n_lines)