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().
This commit is contained in:

committed by
Michael Natterer

parent
d2df109399
commit
f826916828
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
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>
|
2004-06-01 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/widgets/gimptoolbox.c (toolbox_area_notify): removed
|
* app/widgets/gimptoolbox.c (toolbox_area_notify): removed
|
||||||
|
@ -256,7 +256,7 @@ dockable_tab_style_cmd_callback (GtkAction *action,
|
|||||||
{
|
{
|
||||||
GtkWidget *tab_widget;
|
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);
|
tab_widget = gimp_dockbook_get_tab_widget (dockbook, dockable);
|
||||||
|
|
||||||
|
@ -702,6 +702,37 @@ gimp_dockable_get_aux_info (GimpDockable *dockable)
|
|||||||
return NULL;
|
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 *
|
GtkWidget *
|
||||||
gimp_dockable_get_tab_widget (GimpDockable *dockable,
|
gimp_dockable_get_tab_widget (GimpDockable *dockable,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
|
@ -73,6 +73,8 @@ void gimp_dockable_set_aux_info (GimpDockable *dockable,
|
|||||||
GList *aux_info);
|
GList *aux_info);
|
||||||
GList * gimp_dockable_get_aux_info (GimpDockable *dockable);
|
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,
|
GtkWidget * gimp_dockable_get_tab_widget (GimpDockable *dockable,
|
||||||
GimpContext *context,
|
GimpContext *context,
|
||||||
GimpTabStyle tab_style,
|
GimpTabStyle tab_style,
|
||||||
|
@ -543,6 +543,31 @@ gimp_session_info_deserialize (GScanner *scanner,
|
|||||||
return token;
|
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
|
void
|
||||||
gimp_session_info_restore (GimpSessionInfo *info,
|
gimp_session_info_restore (GimpSessionInfo *info,
|
||||||
GimpDialogFactory *factory)
|
GimpDialogFactory *factory)
|
||||||
@ -620,25 +645,8 @@ gimp_session_info_restore (GimpSessionInfo *info,
|
|||||||
if (! dockable)
|
if (! dockable)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (! GIMP_DOCKED_GET_INTERFACE (GTK_BIN (dockable)->child)->get_preview)
|
gimp_dockable_set_tab_style (GIMP_DOCKABLE (dockable),
|
||||||
{
|
dockable_info->tab_style);
|
||||||
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;
|
|
||||||
|
|
||||||
if (dockable_info->aux_info)
|
if (dockable_info->aux_info)
|
||||||
session_info_set_aux_info (dockable, 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);
|
GtkPaned *paned = GTK_PANED (dockbook->parent);
|
||||||
|
|
||||||
if (dockbook == paned->child2)
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user