Commit f8269168 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added a horrible hack that sets the paned's position after the first

2004-06-01  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpsessioninfo.c (gimp_session_info_restore): added
	a horrible hack that sets the paned's position after the first
	"size-allocate" after "map". Makes position remembering work for
	the toolbox and fixes bug #142697.

	* app/widgets/gimpdockable.[ch]: added new function
	gimp_dockable_set_tab_style()

	* app/actions/dockable-commands.c (dockable_tab_style_cmd_callback)
	* app/widgets/gimpsessioninfo.c (gimp_session_info_restore):
	use gimp_dockable_set_tab_style().
parent d2df1093
2004-06-01 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpsessioninfo.c (gimp_session_info_restore): added
a horrible hack that sets the paned's position after the first
"size-allocate" after "map". Makes position remembering work for
the toolbox and fixes bug #142697.
* app/widgets/gimpdockable.[ch]: added new function
gimp_dockable_set_tab_style()
* app/actions/dockable-commands.c (dockable_tab_style_cmd_callback)
* app/widgets/gimpsessioninfo.c (gimp_session_info_restore):
use gimp_dockable_set_tab_style().
2004-06-01 Michael Natterer <mitch@gimp.org>
* app/widgets/gimptoolbox.c (toolbox_area_notify): removed
......
......@@ -256,7 +256,7 @@ dockable_tab_style_cmd_callback (GtkAction *action,
{
GtkWidget *tab_widget;
dockable->tab_style = tab_style;
gimp_dockable_set_tab_style (dockable, tab_style);
tab_widget = gimp_dockbook_get_tab_widget (dockbook, dockable);
......
......@@ -702,6 +702,37 @@ gimp_dockable_get_aux_info (GimpDockable *dockable)
return NULL;
}
void
gimp_dockable_set_tab_style (GimpDockable *dockable,
GimpTabStyle tab_style)
{
g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
if (GTK_BIN (dockable)->child &&
! GIMP_DOCKED_GET_INTERFACE (GTK_BIN (dockable)->child)->get_preview)
{
switch (tab_style)
{
case GIMP_TAB_STYLE_PREVIEW:
tab_style = GIMP_TAB_STYLE_ICON;
break;
case GIMP_TAB_STYLE_PREVIEW_NAME:
tab_style = GIMP_TAB_STYLE_ICON_BLURB;
break;
case GIMP_TAB_STYLE_PREVIEW_BLURB:
tab_style = GIMP_TAB_STYLE_ICON_BLURB;
break;
default:
break;
}
}
dockable->tab_style = tab_style;
}
GtkWidget *
gimp_dockable_get_tab_widget (GimpDockable *dockable,
GimpContext *context,
......
......@@ -73,6 +73,8 @@ void gimp_dockable_set_aux_info (GimpDockable *dockable,
GList *aux_info);
GList * gimp_dockable_get_aux_info (GimpDockable *dockable);
void gimp_dockable_set_tab_style (GimpDockable *dockable,
GimpTabStyle tab_style);
GtkWidget * gimp_dockable_get_tab_widget (GimpDockable *dockable,
GimpContext *context,
GimpTabStyle tab_style,
......
......@@ -543,6 +543,31 @@ gimp_session_info_deserialize (GScanner *scanner,
return token;
}
static void
gimp_session_info_paned_size_allocate (GtkWidget *paned,
GtkAllocation *allocation,
gpointer data)
{
g_signal_handlers_disconnect_by_func (paned,
gimp_session_info_paned_size_allocate,
data);
gtk_paned_set_position (GTK_PANED (paned), GPOINTER_TO_INT (data));
}
static void
gimp_session_info_paned_map (GtkWidget *paned,
gpointer data)
{
g_signal_handlers_disconnect_by_func (paned,
gimp_session_info_paned_map,
data);
g_signal_connect_after (paned, "size-allocate",
G_CALLBACK (gimp_session_info_paned_size_allocate),
data);
}
void
gimp_session_info_restore (GimpSessionInfo *info,
GimpDialogFactory *factory)
......@@ -620,25 +645,8 @@ gimp_session_info_restore (GimpSessionInfo *info,
if (! dockable)
continue;
if (! GIMP_DOCKED_GET_INTERFACE (GTK_BIN (dockable)->child)->get_preview)
{
switch (dockable_info->tab_style)
{
case GIMP_TAB_STYLE_PREVIEW:
dockable_info->tab_style = GIMP_TAB_STYLE_ICON;
break;
case GIMP_TAB_STYLE_PREVIEW_NAME:
dockable_info->tab_style = GIMP_TAB_STYLE_ICON_BLURB;
break;
case GIMP_TAB_STYLE_PREVIEW_BLURB:
dockable_info->tab_style = GIMP_TAB_STYLE_ICON_BLURB;
break;
default:
break;
}
}
GIMP_DOCKABLE (dockable)->tab_style = dockable_info->tab_style;
gimp_dockable_set_tab_style (GIMP_DOCKABLE (dockable),
dockable_info->tab_style);
if (dockable_info->aux_info)
session_info_set_aux_info (dockable, dockable_info->aux_info);
......@@ -666,7 +674,9 @@ gimp_session_info_restore (GimpSessionInfo *info,
GtkPaned *paned = GTK_PANED (dockbook->parent);
if (dockbook == paned->child2)
gtk_paned_set_position (paned, book_info->position);
g_signal_connect_after (paned, "map",
G_CALLBACK (gimp_session_info_paned_map),
GINT_TO_POINTER (book_info->position));
}
}
......
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