Martin Nordholts wrote: > I have attached a new patch > That was a lie, here is the patch. - Martin
Index: app/widgets/gimpdock.c =================================================================== --- app/widgets/gimpdock.c (revision 27881) +++ app/widgets/gimpdock.c (working copy) @@ -76,6 +76,9 @@ struct _GimpDockPriv GList *dockbooks; gint ID; /* for themeing */ + + GtkWidget *north_separator; + GtkWidget *south_separator; }; @@ -102,6 +105,8 @@ static void gimp_dock_real_book_add GimpDockbook *dockbook); static void gimp_dock_real_book_removed (GimpDock *dock, GimpDockbook *dockbook); +static void gimp_dock_show_separators (GimpDock *dock, + gboolean show); G_DEFINE_TYPE (GimpDock, gimp_dock, GIMP_TYPE_WINDOW) @@ -110,6 +115,8 @@ G_DEFINE_TYPE (GimpDock, gimp_dock, GIMP static guint dock_signals[LAST_SIGNAL] = { 0 }; +static GList *dock_instances = NULL; + static void gimp_dock_class_init (GimpDockClass *klass) @@ -185,7 +192,6 @@ static void gimp_dock_init (GimpDock *dock) { static gint dock_ID = 1; - GtkWidget *separator; gchar *name; dock->priv = G_TYPE_INSTANCE_GET_PRIVATE (dock, @@ -212,9 +218,9 @@ gimp_dock_init (GimpDock *dock) gtk_container_add (GTK_CONTAINER (dock->priv->main_vbox), dock->priv->vbox); gtk_widget_show (dock->priv->vbox); - separator = gimp_dock_separator_new (dock, GTK_ANCHOR_NORTH); - gtk_box_pack_start (GTK_BOX (dock->priv->vbox), separator, FALSE, FALSE, 0); - gtk_widget_show (separator); + dock->priv->north_separator = gimp_dock_separator_new (dock, GTK_ANCHOR_NORTH); + gtk_box_pack_start (GTK_BOX (dock->priv->vbox), dock->priv->north_separator, FALSE, FALSE, 0); + gimp_dock_separator_set_show_label (GIMP_DOCK_SEPARATOR (dock->priv->north_separator), TRUE); } static GObject * @@ -236,6 +242,8 @@ gimp_dock_constructor (GType config = GIMP_GUI_CONFIG (dock->priv->context->gimp->config); gimp_window_set_hint (GTK_WINDOW (dock), config->dock_window_hint); + + dock_instances = g_list_prepend (dock_instances, dock); return object; } @@ -293,6 +301,8 @@ gimp_dock_destroy (GtkObject *object) { GimpDock *dock = GIMP_DOCK (object); + dock_instances = g_list_remove (dock_instances, dock); + while (dock->priv->dockbooks) gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->priv->dockbooks->data)); @@ -401,6 +411,21 @@ gimp_dock_real_book_removed (GimpDock gtk_widget_destroy (GTK_WIDGET (dock)); } +static void +gimp_dock_show_separators (GimpDock *dock, + gboolean show) +{ + if (dock->priv->north_separator) + g_object_set (dock->priv->north_separator, + "visible", show, + NULL); + + if (dock->priv->south_separator) + g_object_set (dock->priv->south_separator, + "visible", show, + NULL); +} + /* public functions */ @@ -534,14 +559,12 @@ gimp_dock_add_book (GimpDock *dock, if (old_length == 0) { - GtkWidget *separator; - gtk_box_pack_start (GTK_BOX (dock->priv->vbox), GTK_WIDGET (dockbook), TRUE, TRUE, 0); - separator = gimp_dock_separator_new (dock, GTK_ANCHOR_SOUTH); - gtk_box_pack_end (GTK_BOX (dock->priv->vbox), separator, FALSE, FALSE, 0); - gtk_widget_show (separator); + dock->priv->south_separator = gimp_dock_separator_new (dock, GTK_ANCHOR_SOUTH); + gtk_box_pack_end (GTK_BOX (dock->priv->vbox), dock->priv->south_separator, FALSE,FALSE, 0); + gimp_dock_separator_set_show_label (GIMP_DOCK_SEPARATOR (dock->priv->south_separator), TRUE); } else { @@ -624,15 +647,13 @@ gimp_dock_remove_book (GimpDock *doc if (old_length == 1) { - GtkWidget *separator; GList *children; children = gtk_container_get_children (GTK_CONTAINER (dock->priv->vbox)); - separator = g_list_nth_data (children, 2); - - gtk_container_remove (GTK_CONTAINER (dock->priv->vbox), separator); + gtk_container_remove (GTK_CONTAINER (dock->priv->vbox), dock->priv->south_separator); gtk_container_remove (GTK_CONTAINER (dock->priv->vbox), GTK_WIDGET (dockbook)); + dock->priv->south_separator = NULL; g_list_free (children); } @@ -669,3 +690,19 @@ gimp_dock_remove_book (GimpDock *doc g_object_unref (dockbook); } + +void +gimp_dock_class_show_separators (GimpDockClass *klass, + gboolean show) +{ + GList *list; + + g_return_if_fail (GIMP_IS_DOCK_CLASS (klass)); + + for (list = dock_instances; list != NULL; list = list->next) + { + GimpDock *dock = GIMP_DOCK (list->data); + + gimp_dock_show_separators (dock, show); + } +} Index: app/widgets/gimpdock.h =================================================================== --- app/widgets/gimpdock.h (revision 27882) +++ app/widgets/gimpdock.h (working copy) @@ -63,32 +63,36 @@ struct _GimpDockClass }; -GType gimp_dock_get_type (void) G_GNUC_CONST; +GType gimp_dock_get_type (void) G_GNUC_CONST; -void gimp_dock_setup (GimpDock *dock, - const GimpDock *template); -void gimp_dock_set_aux_info (GimpDock *dock, - GList *aux_info); -GList * gimp_dock_get_aux_info (GimpDock *dock); -GimpContext * gimp_dock_get_context (GimpDock *dock); -GimpDialogFactory * gimp_dock_get_dialog_factory (GimpDock *dock); -GList * gimp_dock_get_dockbooks (GimpDock *dock); -GtkWidget * gimp_dock_get_main_vbox (GimpDock *dock); -GtkWidget * gimp_dock_get_vbox (GimpDock *dock); -gint gimp_dock_get_id (GimpDock *dock); - -void gimp_dock_add (GimpDock *dock, - GimpDockable *dockable, - gint book, - gint index); -void gimp_dock_remove (GimpDock *dock, - GimpDockable *dockable); - -void gimp_dock_add_book (GimpDock *dock, - GimpDockbook *dockbook, - gint index); -void gimp_dock_remove_book (GimpDock *dock, - GimpDockbook *dockbook); +void gimp_dock_setup (GimpDock *dock, + const GimpDock *template); +void gimp_dock_set_aux_info (GimpDock *dock, + GList *aux_info); +GList * gimp_dock_get_aux_info (GimpDock *dock); +GimpContext * gimp_dock_get_context (GimpDock *dock); +GimpDialogFactory * gimp_dock_get_dialog_factory (GimpDock *dock); +GList * gimp_dock_get_dockbooks (GimpDock *dock); +GtkWidget * gimp_dock_get_main_vbox (GimpDock *dock); +GtkWidget * gimp_dock_get_vbox (GimpDock *dock); +gint gimp_dock_get_id (GimpDock *dock); + +void gimp_dock_add (GimpDock *dock, + GimpDockable *dockable, + gint book, + gint index); +void gimp_dock_remove (GimpDock *dock, + GimpDockable *dockable); + +void gimp_dock_add_book (GimpDock *dock, + GimpDockbook *dockbook, + gint index); +void gimp_dock_remove_book (GimpDock *dock, + GimpDockbook *dockbook); + + +void gimp_dock_class_show_separators (GimpDockClass *klass, + gboolean show); #endif /* __GIMP_DOCK_H__ */ Index: app/widgets/gimpdockbook.c =================================================================== --- app/widgets/gimpdockbook.c (revision 27881) +++ app/widgets/gimpdockbook.c (working copy) @@ -610,6 +610,7 @@ gimp_dockbook_tab_drag_begin (GtkWidget { GtkWidget *window; GtkWidget *view; + GimpDockClass *dock_class = GIMP_DOCK_GET_CLASS (dockable->dockbook->dock); GtkRequisition requisition; window = gtk_window_new (GTK_WINDOW_POPUP); @@ -639,6 +640,8 @@ gimp_dockbook_tab_drag_begin (GtkWidget * it's the dockable that's being dragged around */ gtk_widget_set_sensitive (GTK_WIDGET (dockable), FALSE); + + gimp_dock_class_show_separators (dock_class, TRUE); } static void @@ -646,7 +649,8 @@ gimp_dockbook_tab_drag_end (GtkWidget GdkDragContext *context, GimpDockable *dockable) { - GtkWidget *drag_widget = g_object_get_data (G_OBJECT (dockable), + GimpDockClass *dock_class = GIMP_DOCK_GET_CLASS (dockable->dockbook->dock); + GtkWidget *drag_widget = g_object_get_data (G_OBJECT (dockable), "gimp-dock-drag-widget"); /* finding the drag_widget means the drop was not successful, so @@ -661,6 +665,8 @@ gimp_dockbook_tab_drag_end (GtkWidget dockable->drag_x = GIMP_DOCKABLE_DRAG_OFFSET; dockable->drag_y = GIMP_DOCKABLE_DRAG_OFFSET; gtk_widget_set_sensitive (GTK_WIDGET (dockable), TRUE); + + gimp_dock_class_show_separators (dock_class, FALSE); } Index: app/widgets/gimptoolbox.c =================================================================== --- app/widgets/gimptoolbox.c (revision 27881) +++ app/widgets/gimptoolbox.c (working copy) @@ -651,7 +651,6 @@ toolbox_separator_expand (GimpToolbox *t gtk_box_set_child_packing (GTK_BOX (gimp_dock_get_vbox (dock)), separator, TRUE, TRUE, 0, GTK_PACK_START); - gimp_dock_separator_set_show_label (GIMP_DOCK_SEPARATOR (separator), TRUE); } static void @@ -667,7 +666,6 @@ toolbox_separator_collapse (GimpToolbox gtk_box_set_child_packing (GTK_BOX (gimp_dock_get_vbox (dock)), separator, FALSE, FALSE, 0, GTK_PACK_START); - gimp_dock_separator_set_show_label (GIMP_DOCK_SEPARATOR (separator), FALSE); } static void Index: themes/Default/gtkrc =================================================================== --- themes/Default/gtkrc (revision 27879) +++ themes/Default/gtkrc (working copy) @@ -39,7 +39,7 @@ style "gimp-default-style" GtkPaned::handle-size = 6 GimpDock::default-height = 300 GimpDock::font-scale = 0.8333 - GimpDockSeparator::height = 6 + GimpDockSeparator::height = 40 GimpMenuDock::minimal-width = 200 GimpMenuDock::menu-preview-size = button GimpToolbox::tool-icon-size = button
_______________________________________________ Gimp-developer mailing list Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer