gimp r24840 - in branches/weskaggs: . app/widgets etc
- From: weskaggs svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r24840 - in branches/weskaggs: . app/widgets etc
- Date: Sat, 9 Feb 2008 16:46:09 +0000 (GMT)
Author: weskaggs
Date: Sat Feb 9 16:46:09 2008
New Revision: 24840
URL: http://svn.gnome.org/viewvc/gimp?rev=24840&view=rev
Log:
Bill Skaggs <weskaggs primate ucdavis edu>
Initial implementation of two-column docks. Needs
some fixes and a lot of cleanup. Docks are made
to contain a GtkHPaned instead of just a VBox.
* app/widgets/gimpviewrenderer.c
* app/widgets/gimptoolbox.[ch]
* app/widgets/gimpsessioninfo.h
* app/widgeapp/widgets/gimpsessioninfo-dock.c
* app/widgets/gimpsessioninfo-dock.c
* app/widgets/gimpdock.[ch]
* app/widgets/gimpdockseparator.[ch]
* app/widgets/gimpdockbook.[ch]
* app/widgets/gimpviewrenderer.c
* app/widgets/gimpviewrendererimage.c: Kludged workaround
for missing context whose cause I couldn't figure out;
needs fixing.
* etc/sessionrc: New default setup with all important
dockables in a single dock.
Modified:
branches/weskaggs/ChangeLog
branches/weskaggs/app/widgets/gimpdock.c
branches/weskaggs/app/widgets/gimpdock.h
branches/weskaggs/app/widgets/gimpdockbook.c
branches/weskaggs/app/widgets/gimpdockbook.h
branches/weskaggs/app/widgets/gimpdockseparator.c
branches/weskaggs/app/widgets/gimpdockseparator.h
branches/weskaggs/app/widgets/gimpsessioninfo-book.c
branches/weskaggs/app/widgets/gimpsessioninfo-book.h
branches/weskaggs/app/widgets/gimpsessioninfo-dock.c
branches/weskaggs/app/widgets/gimpsessioninfo.h
branches/weskaggs/app/widgets/gimptoolbox.c
branches/weskaggs/app/widgets/gimptoolbox.h
branches/weskaggs/app/widgets/gimpviewrenderer.c
branches/weskaggs/app/widgets/gimpviewrendererimage.c
branches/weskaggs/etc/sessionrc
Modified: branches/weskaggs/app/widgets/gimpdock.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdock.c (original)
+++ branches/weskaggs/app/widgets/gimpdock.c Sat Feb 9 16:46:09 2008
@@ -168,12 +168,17 @@
dock->context = NULL;
dock->dialog_factory = NULL;
dock->dockbooks = NULL;
+ dock->dockbooks2 = NULL;
gtk_window_set_role (GTK_WINDOW (dock), "gimp-dock");
gtk_window_set_resizable (GTK_WINDOW (dock), TRUE);
+ dock->paned = gtk_hpaned_new ();
+ gtk_container_add (GTK_CONTAINER (dock), dock->paned);
+ gtk_widget_show (dock->paned);
+
dock->main_vbox = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (dock), dock->main_vbox);
+ gtk_paned_add1 (GTK_PANED (dock->paned), dock->main_vbox);
gtk_widget_show (dock->main_vbox);
dock->vbox = gtk_vbox_new (FALSE, 0);
@@ -260,6 +265,9 @@
while (dock->dockbooks)
gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->dockbooks->data));
+ while (dock->dockbooks2)
+ gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->dockbooks2->data));
+
if (dock->context)
{
g_object_unref (dock->context);
@@ -276,9 +284,12 @@
GimpDock *dock = GIMP_DOCK (widget);
gboolean retval = FALSE;
GList *list;
- gint n;
+ gint n = 0;
+
+ for (list = dock->dockbooks; list; list = list->next)
+ n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
- for (list = dock->dockbooks, n = 0; list; list = list->next)
+ for (list = dock->dockbooks2; list; list = list->next)
n += gtk_notebook_get_n_pages (GTK_NOTEBOOK (list->data));
if (n > 1)
@@ -378,7 +389,7 @@
gimp_dock_real_book_removed (GimpDock *dock,
GimpDockbook *dockbook)
{
- if (dock->dockbooks == NULL)
+ if (dock->dockbooks == NULL && dock->dockbooks2 == NULL )
gtk_widget_destroy (GTK_WIDGET (dock));
}
@@ -435,6 +446,23 @@
}
void
+gimp_dock_add2 (GimpDock *dock,
+ GimpDockable *dockable,
+ gint section,
+ gint position)
+{
+ GimpDockbook *dockbook;
+
+ g_return_if_fail (GIMP_IS_DOCK (dock));
+ g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
+ g_return_if_fail (dockable->dockbook == NULL);
+
+ dockbook = GIMP_DOCKBOOK (dock->dockbooks2->data);
+
+ gimp_dockbook_add (dockbook, dockable, position);
+}
+
+void
gimp_dock_remove (GimpDock *dock,
GimpDockable *dockable)
{
@@ -463,6 +491,7 @@
index = old_length;
dockbook->dock = dock;
+ dockbook->pane = 1;
dock->dockbooks = g_list_insert (dock->dockbooks, dockbook, index);
if (old_length == 0)
@@ -535,6 +564,97 @@
g_signal_emit (dock, dock_signals[BOOK_ADDED], 0, dockbook);
}
+/* add a book to the right pane */
+void
+gimp_dock_add2_book (GimpDock *dock,
+ GimpDockbook *dockbook,
+ gint index)
+{
+ gint old_length;
+
+ g_return_if_fail (GIMP_IS_DOCK (dock));
+ g_return_if_fail (GIMP_IS_DOCKBOOK (dockbook));
+ g_return_if_fail (dockbook->dock == NULL);
+
+ old_length = g_list_length (dock->dockbooks2);
+
+ if (index >= old_length || index < 0)
+ index = old_length;
+
+ dockbook->dock = dock;
+ dockbook->pane = 2;
+ dock->dockbooks2 = g_list_insert (dock->dockbooks2, dockbook, index);
+
+ if (old_length == 0)
+ {
+ GtkWidget *separator;
+
+ gtk_box_pack_start (GTK_BOX (dock->vbox2), GTK_WIDGET (dockbook),
+ TRUE, TRUE, 0);
+
+ separator = gimp_dock_separator_new (dock);
+ gtk_box_pack_end (GTK_BOX (dock->vbox2), separator, FALSE, FALSE, 0);
+ gtk_widget_show (separator);
+ }
+ else
+ {
+ GtkWidget *old_book;
+ GtkWidget *parent;
+ GtkWidget *paned;
+
+ if (index == 0)
+ old_book = g_list_nth_data (dock->dockbooks2, index + 1);
+ else
+ old_book = g_list_nth_data (dock->dockbooks2, index - 1);
+
+ parent = old_book->parent;
+
+ if ((old_length > 1) && (index > 0))
+ {
+ GtkWidget *grandparent;
+
+ grandparent = parent->parent;
+
+ old_book = parent;
+ parent = grandparent;
+ }
+
+ g_object_ref (old_book);
+
+ gtk_container_remove (GTK_CONTAINER (parent), old_book);
+
+ paned = gtk_vpaned_new ();
+
+ if (GTK_IS_VPANED (parent))
+ gtk_paned_pack1 (GTK_PANED (parent), paned, TRUE, FALSE);
+ else
+ gtk_box_pack_start (GTK_BOX (parent), paned, TRUE, TRUE, 0);
+
+ gtk_widget_show (paned);
+
+ if (index == 0)
+ {
+ gtk_paned_pack1 (GTK_PANED (paned), GTK_WIDGET (dockbook),
+ TRUE, FALSE);
+ gtk_paned_pack2 (GTK_PANED (paned), old_book,
+ TRUE, FALSE);
+ }
+ else
+ {
+ gtk_paned_pack1 (GTK_PANED (paned), old_book,
+ TRUE, FALSE);
+ gtk_paned_pack2 (GTK_PANED (paned), GTK_WIDGET (dockbook),
+ TRUE, FALSE);
+ }
+
+ g_object_unref (old_book);
+ }
+
+ gtk_widget_show (GTK_WIDGET (dockbook));
+
+ g_signal_emit (dock, dock_signals[BOOK_ADDED], 0, dockbook);
+}
+
void
gimp_dock_remove_book (GimpDock *dock,
GimpDockbook *dockbook)
@@ -550,52 +670,108 @@
old_length = g_list_length (dock->dockbooks);
index = g_list_index (dock->dockbooks, dockbook);
- dockbook->dock = NULL;
- dock->dockbooks = g_list_remove (dock->dockbooks, dockbook);
+ if (index == -1) /* book is in the right pane */
+ {
+ old_length = g_list_length (dock->dockbooks2);
+ index = g_list_index (dock->dockbooks2, dockbook);
+
+ dockbook->dock = NULL;
+ dock->dockbooks2 = g_list_remove (dock->dockbooks2, dockbook);
- g_object_ref (dockbook);
+ g_object_ref (dockbook);
- if (old_length == 1)
- {
- GtkWidget *separator;
- GList *children;
+ if (old_length == 1)
+ {
+ GtkWidget *separator;
+ GList *children;
+
+ children = gtk_container_get_children (GTK_CONTAINER (dock->vbox2));
+
+ separator = g_list_nth_data (children, 2);
+
+ gtk_container_remove (GTK_CONTAINER (dock->vbox2), separator);
+ gtk_container_remove (GTK_CONTAINER (dock->vbox2), GTK_WIDGET (dockbook));
+
+ g_list_free (children);
+ }
+ else
+ {
+ GtkWidget *other_book;
+ GtkWidget *parent;
+ GtkWidget *grandparent;
+
+ parent = GTK_WIDGET (dockbook)->parent;
+ grandparent = parent->parent;
+
+ if (index == 0)
+ other_book = GTK_PANED (parent)->child2;
+ else
+ other_book = GTK_PANED (parent)->child1;
+
+ g_object_ref (other_book);
- children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
+ gtk_container_remove (GTK_CONTAINER (parent), other_book);
+ gtk_container_remove (GTK_CONTAINER (parent), GTK_WIDGET (dockbook));
- separator = g_list_nth_data (children, 2);
+ gtk_container_remove (GTK_CONTAINER (grandparent), parent);
- gtk_container_remove (GTK_CONTAINER (dock->vbox), separator);
- gtk_container_remove (GTK_CONTAINER (dock->vbox), GTK_WIDGET (dockbook));
+ if (GTK_IS_VPANED (grandparent))
+ gtk_paned_pack1 (GTK_PANED (grandparent), other_book, TRUE, FALSE);
+ else
+ gtk_box_pack_start (GTK_BOX (dock->vbox2), other_book, TRUE, TRUE, 0);
- g_list_free (children);
+ g_object_unref (other_book);
+ }
}
else
{
- GtkWidget *other_book;
- GtkWidget *parent;
- GtkWidget *grandparent;
+ dockbook->dock = NULL;
+ dock->dockbooks = g_list_remove (dock->dockbooks, dockbook);
- parent = GTK_WIDGET (dockbook)->parent;
- grandparent = parent->parent;
+ g_object_ref (dockbook);
- if (index == 0)
- other_book = GTK_PANED (parent)->child2;
- else
- other_book = GTK_PANED (parent)->child1;
+ if (old_length == 1)
+ {
+ GtkWidget *separator;
+ GList *children;
- g_object_ref (other_book);
+ children = gtk_container_get_children (GTK_CONTAINER (dock->vbox));
- gtk_container_remove (GTK_CONTAINER (parent), other_book);
- gtk_container_remove (GTK_CONTAINER (parent), GTK_WIDGET (dockbook));
+ separator = g_list_nth_data (children, 2);
- gtk_container_remove (GTK_CONTAINER (grandparent), parent);
+ gtk_container_remove (GTK_CONTAINER (dock->vbox), separator);
+ gtk_container_remove (GTK_CONTAINER (dock->vbox), GTK_WIDGET (dockbook));
- if (GTK_IS_VPANED (grandparent))
- gtk_paned_pack1 (GTK_PANED (grandparent), other_book, TRUE, FALSE);
+ g_list_free (children);
+ }
else
- gtk_box_pack_start (GTK_BOX (dock->vbox), other_book, TRUE, TRUE, 0);
+ {
+ GtkWidget *other_book;
+ GtkWidget *parent;
+ GtkWidget *grandparent;
- g_object_unref (other_book);
+ parent = GTK_WIDGET (dockbook)->parent;
+ grandparent = parent->parent;
+
+ if (index == 0)
+ other_book = GTK_PANED (parent)->child2;
+ else
+ other_book = GTK_PANED (parent)->child1;
+
+ g_object_ref (other_book);
+
+ gtk_container_remove (GTK_CONTAINER (parent), other_book);
+ gtk_container_remove (GTK_CONTAINER (parent), GTK_WIDGET (dockbook));
+
+ gtk_container_remove (GTK_CONTAINER (grandparent), parent);
+
+ if (GTK_IS_VPANED (grandparent))
+ gtk_paned_pack1 (GTK_PANED (grandparent), other_book, TRUE, FALSE);
+ else
+ gtk_box_pack_start (GTK_BOX (dock->vbox), other_book, TRUE, TRUE, 0);
+
+ g_object_unref (other_book);
+ }
}
g_signal_emit (dock, dock_signals[BOOK_REMOVED], 0, dockbook);
Modified: branches/weskaggs/app/widgets/gimpdock.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpdock.h (original)
+++ branches/weskaggs/app/widgets/gimpdock.h Sat Feb 9 16:46:09 2008
@@ -43,10 +43,13 @@
GimpDialogFactory *dialog_factory;
GimpContext *context;
+ GtkWidget *paned;
GtkWidget *main_vbox;
GtkWidget *vbox;
+ GtkWidget *vbox2;
GList *dockbooks;
+ GList *dockbooks2;
};
struct _GimpDockClass
@@ -80,12 +83,19 @@
GimpDockable *dockable,
gint book,
gint index);
+void gimp_dock_add2 (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_add2_book (GimpDock *dock,
+ GimpDockbook *dockbook,
+ gint index);
void gimp_dock_remove_book (GimpDock *dock,
GimpDockbook *dockbook);
Modified: branches/weskaggs/app/widgets/gimpdockbook.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockbook.c (original)
+++ branches/weskaggs/app/widgets/gimpdockbook.c Sat Feb 9 16:46:09 2008
@@ -188,6 +188,7 @@
{
dockbook->dock = NULL;
dockbook->ui_manager = NULL;
+ dockbook->pane = 0;
gtk_notebook_popup_enable (GTK_NOTEBOOK (dockbook));
gtk_notebook_set_scrollable (GTK_NOTEBOOK (dockbook), TRUE);
Modified: branches/weskaggs/app/widgets/gimpdockbook.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockbook.h (original)
+++ branches/weskaggs/app/widgets/gimpdockbook.h Sat Feb 9 16:46:09 2008
@@ -45,6 +45,8 @@
guint tab_hover_timeout;
GimpDockable *tab_hover_dockable;
+
+ gint pane;
};
struct _GimpDockbookClass
Modified: branches/weskaggs/app/widgets/gimpdockseparator.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockseparator.c (original)
+++ branches/weskaggs/app/widgets/gimpdockseparator.c Sat Feb 9 16:46:09 2008
@@ -95,6 +95,8 @@
separator->dock = NULL;
separator->label = NULL;
+ separator->pane = 1;
+
separator->frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (separator->frame), GTK_SHADOW_OUT);
gtk_container_add (GTK_CONTAINER (separator), separator->frame);
@@ -236,7 +238,12 @@
gimp_dockbook_remove (dockable->dockbook, dockable);
dockbook = gimp_dockbook_new (dock->dialog_factory->menu_factory);
- gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), index);
+
+ if (separator->pane == 2)
+ gimp_dock_add2_book (dock, GIMP_DOCKBOOK (dockbook), index);
+ else
+ gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), index);
+
gimp_dockbook_add (GIMP_DOCKBOOK (dockbook), dockable, -1);
Modified: branches/weskaggs/app/widgets/gimpdockseparator.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpdockseparator.h (original)
+++ branches/weskaggs/app/widgets/gimpdockseparator.h Sat Feb 9 16:46:09 2008
@@ -44,6 +44,8 @@
GtkWidget *frame;
GtkWidget *label;
+
+ gint pane;
};
struct _GimpDockSeparatorClass
Modified: branches/weskaggs/app/widgets/gimpsessioninfo-book.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpsessioninfo-book.c (original)
+++ branches/weskaggs/app/widgets/gimpsessioninfo-book.c Sat Feb 9 16:46:09 2008
@@ -38,6 +38,7 @@
enum
{
SESSION_INFO_BOOK_POSITION,
+ SESSION_INFO_BOOK_PANE,
SESSION_INFO_BOOK_CURRENT_PAGE,
SESSION_INFO_BOOK_DOCKABLE
};
@@ -98,6 +99,10 @@
gimp_config_writer_printf (writer, "%d", current_page);
gimp_config_writer_close (writer);
+ gimp_config_writer_open (writer, "pane");
+ gimp_config_writer_printf (writer, "%d", dockbook->pane);
+ gimp_config_writer_close (writer);
+
children = gtk_container_get_children (GTK_CONTAINER (dockbook));
for (pages = children; pages; pages = g_list_next (pages))
@@ -121,6 +126,8 @@
g_scanner_scope_add_symbol (scanner, scope, "position",
GINT_TO_POINTER (SESSION_INFO_BOOK_POSITION));
+ g_scanner_scope_add_symbol (scanner, scope, "pane",
+ GINT_TO_POINTER (SESSION_INFO_BOOK_PANE));
g_scanner_scope_add_symbol (scanner, scope, "current-page",
GINT_TO_POINTER (SESSION_INFO_BOOK_CURRENT_PAGE));
g_scanner_scope_add_symbol (scanner, scope, "dockable",
@@ -128,6 +135,9 @@
book = gimp_session_info_book_new ();
+ /* FIXME */
+ book->pane = 1;
+
token = G_TOKEN_LEFT_PAREN;
while (g_scanner_peek_next_token (scanner) == token)
@@ -149,6 +159,12 @@
goto error;
break;
+ case SESSION_INFO_BOOK_PANE:
+ token = G_TOKEN_INT;
+ if (! gimp_scanner_parse_int (scanner, &book->pane))
+ goto error;
+ break;
+
case SESSION_INFO_BOOK_CURRENT_PAGE:
token = G_TOKEN_INT;
if (! gimp_scanner_parse_int (scanner, &book->current_page))
@@ -186,6 +202,7 @@
info->books = g_list_append (info->books, book);
g_scanner_scope_remove_symbol (scanner, scope, "position");
+ g_scanner_scope_remove_symbol (scanner, scope, "pane");
g_scanner_scope_remove_symbol (scanner, scope, "current-page");
g_scanner_scope_remove_symbol (scanner, scope, "dockable");
@@ -209,7 +226,11 @@
dockbook = gimp_dockbook_new (dock->dialog_factory->menu_factory);
- gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), -1);
+ if (info->pane == 1)
+ gimp_dock_add_book (dock, GIMP_DOCKBOOK (dockbook), -1);
+ else
+ gimp_dock_add2_book (dock, GIMP_DOCKBOOK (dockbook), -1);
+
info->widget = dockbook;
Modified: branches/weskaggs/app/widgets/gimpsessioninfo-book.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpsessioninfo-book.h (original)
+++ branches/weskaggs/app/widgets/gimpsessioninfo-book.h Sat Feb 9 16:46:09 2008
@@ -28,6 +28,8 @@
gint position;
gint current_page;
+ gint pane;
+
GtkWidget *widget;
/* list of GimpSessionInfoDockable */
Modified: branches/weskaggs/app/widgets/gimpsessioninfo-dock.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpsessioninfo-dock.c (original)
+++ branches/weskaggs/app/widgets/gimpsessioninfo-dock.c Sat Feb 9 16:46:09 2008
@@ -29,6 +29,7 @@
#include "gimpdialogfactory.h"
#include "gimpdock.h"
+#include "gimptoolbox.h"
#include "gimpsessioninfo.h"
#include "gimpsessioninfo-aux.h"
#include "gimpsessioninfo-book.h"
@@ -37,7 +38,8 @@
enum
{
- SESSION_INFO_BOOK
+ SESSION_INFO_BOOK,
+ SESSION_INFO_GUTTER_POSITION
};
@@ -54,9 +56,21 @@
gimp_config_writer_open (writer, "dock");
+ if (GIMP_IS_TOOLBOX (dock))
+ {
+ gint pos = gtk_paned_get_position (GTK_PANED (dock->paned));
+
+ gimp_config_writer_open (writer, "gutter-position");
+ gimp_config_writer_printf (writer, "%d", pos);
+ gimp_config_writer_close (writer);
+ }
+
for (books = dock->dockbooks; books; books = g_list_next (books))
gimp_session_info_book_serialize (writer, books->data);
+ for (books = dock->dockbooks2; books; books = g_list_next (books))
+ gimp_session_info_book_serialize (writer, books->data);
+
gimp_config_writer_close (writer);
}
@@ -72,6 +86,8 @@
g_scanner_scope_add_symbol (scanner, scope, "book",
GINT_TO_POINTER (SESSION_INFO_BOOK));
+ g_scanner_scope_add_symbol (scanner, scope, "gutter-position",
+ GINT_TO_POINTER (SESSION_INFO_GUTTER_POSITION));
token = G_TOKEN_LEFT_PAREN;
@@ -100,6 +116,12 @@
break;
+ case SESSION_INFO_GUTTER_POSITION:
+ token = G_TOKEN_INT;
+ /* FIXME: check for errors */
+ gimp_scanner_parse_int (scanner, &info->gutter_position);
+ break;
+
default:
return token;
}
@@ -116,6 +138,7 @@
}
g_scanner_scope_remove_symbol (scanner, scope, "book");
+ g_scanner_scope_remove_symbol (scanner, scope, "gutter-position");
return token;
}
@@ -162,6 +185,9 @@
if (dock && info->aux_info)
gimp_session_info_aux_set_list (GTK_WIDGET (dock), info->aux_info);
+ if (GIMP_IS_TOOLBOX (dock) && info->gutter_position > 0)
+ gtk_paned_set_position (GTK_PANED (dock->paned), info->gutter_position);
+
for (books = info->books; books; books = g_list_next (books))
gimp_session_info_book_restore (books->data, dock);
Modified: branches/weskaggs/app/widgets/gimpsessioninfo.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpsessioninfo.h (original)
+++ branches/weskaggs/app/widgets/gimpsessioninfo.h Sat Feb 9 16:46:09 2008
@@ -30,6 +30,9 @@
gint width;
gint height;
+ /* only applies to docks */
+ gint gutter_position;
+
/* only valid while restoring and saving the session */
gboolean open;
gint screen;
Modified: branches/weskaggs/app/widgets/gimptoolbox.c
==============================================================================
--- branches/weskaggs/app/widgets/gimptoolbox.c (original)
+++ branches/weskaggs/app/widgets/gimptoolbox.c Sat Feb 9 16:46:09 2008
@@ -121,7 +121,7 @@
gpointer data);
-G_DEFINE_TYPE (GimpToolbox, gimp_toolbox, GIMP_TYPE_IMAGE_DOCK)
+G_DEFINE_TYPE (GimpToolbox, gimp_toolbox, GIMP_TYPE_MENU_DOCK)
#define parent_class gimp_toolbox_parent_class
@@ -163,6 +163,18 @@
static void
gimp_toolbox_init (GimpToolbox *toolbox)
{
+ GimpDock *dock = GIMP_DOCK (toolbox);
+ GtkWidget *separator;
+
+ dock->vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_paned_add2 (GTK_PANED (dock->paned), dock->vbox2);
+ gtk_widget_show (dock->vbox2);
+
+ separator = gimp_dock_separator_new (dock);
+ gtk_box_pack_start (GTK_BOX (dock->vbox2), separator, FALSE, FALSE, 0);
+ gtk_widget_show (separator);
+ GIMP_DOCK_SEPARATOR (separator)->pane = 2;
+
gtk_window_set_role (GTK_WINDOW (toolbox), "gimp-toolbox");
gimp_help_connect (GTK_WIDGET (toolbox), gimp_standard_help_func,
@@ -348,6 +360,7 @@
if (tool_button)
{
GtkRequisition button_requisition;
+ GtkAllocation *alloc2;
GList *list;
gint n_tools;
gint tool_rows;
@@ -365,7 +378,9 @@
n_tools++;
}
- tool_columns = MAX (1, (allocation->width / button_requisition.width));
+ alloc2 = &GIMP_DOCK (toolbox)->vbox->allocation;
+
+ tool_columns = MAX (1, (alloc2->width / button_requisition.width));
tool_rows = n_tools / tool_columns;
if (n_tools % tool_columns)
Modified: branches/weskaggs/app/widgets/gimptoolbox.h
==============================================================================
--- branches/weskaggs/app/widgets/gimptoolbox.h (original)
+++ branches/weskaggs/app/widgets/gimptoolbox.h Sat Feb 9 16:46:09 2008
@@ -20,7 +20,7 @@
#define __GIMP_TOOLBOX_H__
-#include "gimpimagedock.h"
+#include "gimpmenudock.h"
#define GIMP_TYPE_TOOLBOX (gimp_toolbox_get_type ())
@@ -35,7 +35,7 @@
struct _GimpToolbox
{
- GimpImageDock parent_instance;
+ GimpMenuDock parent_instance;
GtkWidget *menu_bar;
GtkWidget *tool_wbox;
@@ -52,7 +52,7 @@
struct _GimpToolboxClass
{
- GimpImageDockClass parent_class;
+ GimpMenuDockClass parent_class;
};
Modified: branches/weskaggs/app/widgets/gimpviewrenderer.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpviewrenderer.c (original)
+++ branches/weskaggs/app/widgets/gimpviewrenderer.c Sat Feb 9 16:46:09 2008
@@ -588,7 +588,7 @@
g_return_if_fail (expose_area != NULL);
if (G_UNLIKELY (renderer->context == NULL))
- g_warning ("%s: renderer->context is NULL", G_STRFUNC);
+ g_print ("gimp_view_renderer_draw: renderer->context is NULL\n");
if (! GTK_WIDGET_DRAWABLE (widget))
return;
Modified: branches/weskaggs/app/widgets/gimpviewrendererimage.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpviewrendererimage.c (original)
+++ branches/weskaggs/app/widgets/gimpviewrendererimage.c Sat Feb 9 16:46:09 2008
@@ -29,6 +29,7 @@
#include "base/temp-buf.h"
+#include "core/gimp.h"
#include "core/gimpimage.h"
#include "gimpviewrendererimage.h"
@@ -66,6 +67,10 @@
GimpImage *image = GIMP_IMAGE (renderer->viewable);
const gchar *stock_id;
+ /* XXXX FIXME FIXME XXXX */
+ if (! renderer->context)
+ renderer->context = gimp_get_user_context (image->gimp);
+
/* The conditions checked here are mostly a hack to hide the fact that
* we are creating the channel preview from the image preview and turning
* off visibility of a channel has the side-effect of painting the channel
Modified: branches/weskaggs/etc/sessionrc
==============================================================================
--- branches/weskaggs/etc/sessionrc (original)
+++ branches/weskaggs/etc/sessionrc Sat Feb 9 16:46:09 2008
@@ -1,35 +1,35 @@
# GIMP sessionrc
#
# This file takes session-specific info (that is info, you want to keep
-# between two GIMP sessions). You are not supposed to edit it manually, but
-# of course you can do. The sessionrc will be entirely rewritten every time
-# you quit GIMP. If this file isn't found, defaults are used.
+# between two GIMP sessions). You are not supposed to edit it manually, but
+# of course you can do. The sessionrc will be entirely rewritten every time
+# you quit GIMP. If this file isn't found, defaults are used.
(session-info "toolbox" "dock"
(position 48 48)
- (size 204 720)
- (open-on-exit)
- (dock
- (book
- (dockable "gimp-tool-options"))))
-(session-info "dock" "dock"
- (position 300 48)
- (size 240 720)
+ (size 444 720)
(open-on-exit)
(aux-info
- (show-image-menu "true")
+ (show-image-menu "false")
(follow-active-image "true"))
(dock
+ (gutter-position 204)
+ (book
+ (pane 1)
+ (dockable "gimp-tool-options"
+ (tab-style icon)))
(book
+ (pane 2)
(dockable "gimp-layer-list"
- (tab-style icon))
+ (tab-style icon))
(dockable "gimp-channel-list"
- (tab-style icon))
+ (tab-style icon))
(dockable "gimp-vectors-list"
- (tab-style icon))
+ (tab-style icon))
(dockable "gimp-undo-history"
- (tab-style icon)))
+ (tab-style icon)))
(book
+ (pane 2)
(position 360)
(dockable "gimp-color-editor"
(tab-style preview))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]