Commit d32a009b authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

set the label style italic. Moved separator code into utility functions.

2005-09-12  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimptoolbox.c: set the label style italic. Moved
	separator code into utility functions.
parent 99d9597f
2005-09-12 Sven Neumann <sven@gimp.org>
* app/widgets/gimptoolbox.c: set the label style italic. Moved
separator code into utility functions.
2005-09-11 Michael Natterer <mitch@gimp.org>
* app/widgets/gimptoolbox.c (gimp_toolbox_book_added)
......
......@@ -80,6 +80,8 @@ static void gimp_toolbox_book_removed (GimpDock *dock,
GimpDockbook *dockbook);
static void gimp_toolbox_set_geometry (GimpToolbox *toolbox);
static void toolbox_separator_expand (GimpToolbox *toolbox);
static void toolbox_separator_collapse (GimpToolbox *toolbox);
static void toolbox_create_tools (GimpToolbox *toolbox,
GimpContext *context);
static GtkWidget * toolbox_create_color_area (GimpToolbox *toolbox,
......@@ -495,22 +497,7 @@ gimp_toolbox_book_added (GimpDock *dock,
{
if (g_list_length (dock->dockbooks) == 1)
{
GList *children;
GtkWidget *separator;
GtkWidget *frame;
gimp_toolbox_set_geometry (GIMP_TOOLBOX (dock));
children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
separator = children->data;
g_list_free (children);
gtk_box_set_child_packing (GTK_BOX (dock->vbox), separator,
FALSE, FALSE, 0, GTK_PACK_START);
frame = GTK_BIN (separator)->child;
if (GTK_BIN (frame)->child)
gtk_container_remove (GTK_CONTAINER (frame), GTK_BIN (frame)->child);
toolbox_separator_collapse (GIMP_TOOLBOX (dock));
}
}
......@@ -518,28 +505,10 @@ static void
gimp_toolbox_book_removed (GimpDock *dock,
GimpDockbook *dockbook)
{
if (dock->dockbooks == NULL &&
if (g_list_length (dock->dockbooks) == 0 &&
! (GTK_OBJECT_FLAGS (dock) & GTK_IN_DESTRUCTION))
{
GList *children;
GtkWidget *separator;
GtkWidget *frame;
GtkWidget *label;
gimp_toolbox_set_geometry (GIMP_TOOLBOX (dock));
children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
separator = children->data;
g_list_free (children);
gtk_box_set_child_packing (GTK_BOX (dock->vbox), separator,
TRUE, TRUE, 0, GTK_PACK_START);
label = gtk_label_new (_("You can drop dockable dialogs here."));
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
frame = GTK_BIN (separator)->child;
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_widget_show (label);
toolbox_separator_expand (GIMP_TOOLBOX (dock));
}
}
......@@ -733,6 +702,56 @@ gimp_toolbox_button_accel_changed (GtkAccelGroup *accel_group,
}
}
static void
toolbox_separator_expand (GimpToolbox *toolbox)
{
GimpDock *dock = GIMP_DOCK (toolbox);
GList *children;
GtkWidget *separator;
GtkWidget *frame;
GtkWidget *label;
gimp_toolbox_set_geometry (toolbox);
children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
separator = children->data;
g_list_free (children);
gtk_box_set_child_packing (GTK_BOX (dock->vbox), separator,
TRUE, TRUE, 0, GTK_PACK_START);
label = gtk_label_new (_("You can drop dockable dialogs here."));
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gimp_label_set_attributes (GTK_LABEL (label),
PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
-1);
frame = GTK_BIN (separator)->child;
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_widget_show (label);
}
static void
toolbox_separator_collapse (GimpToolbox *toolbox)
{
GimpDock *dock = GIMP_DOCK (toolbox);
GList *children;
GtkWidget *separator;
GtkWidget *frame;
gimp_toolbox_set_geometry (GIMP_TOOLBOX (dock));
children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
separator = children->data;
g_list_free (children);
gtk_box_set_child_packing (GTK_BOX (dock->vbox), separator,
FALSE, FALSE, 0, GTK_PACK_START);
frame = GTK_BIN (separator)->child;
if (GTK_BIN (frame)->child)
gtk_container_remove (GTK_CONTAINER (frame), GTK_BIN (frame)->child);
}
static void
toolbox_create_tools (GimpToolbox *toolbox,
GimpContext *context)
......
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