From bff0e2a1022faa467d06c646546a24292006620a Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 12 Nov 2003 14:36:50 +0000 Subject: [PATCH] changed COLOR_HISTORY_SIZE to 12 to reduce the minimum size of the color 2003-11-12 Sven Neumann * app/gui/color-history.[ch]: changed COLOR_HISTORY_SIZE to 12 to reduce the minimum size of the color selector dialog. * app/gui/color-notebook.c (color_notebook_new): changed the dialog setup to not depend on COLOR_HISTORY_SIZE being 16. --- ChangeLog | 10 +++++++++- app/dialogs/color-dialog.c | 12 +++++++----- app/gui/color-history.c | 4 ---- app/gui/color-history.h | 2 +- app/gui/color-notebook.c | 12 +++++++----- app/widgets/gimpcolordialog.c | 12 +++++++----- 6 files changed, 31 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49fd5c807e..de5711cf90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-11-12 Sven Neumann + + * app/gui/color-history.[ch]: changed COLOR_HISTORY_SIZE to 12 to + reduce the minimum size of the color selector dialog. + + * app/gui/color-notebook.c (color_notebook_new): changed the + dialog setup to not depend on COLOR_HISTORY_SIZE being 16. + 2003-11-12 Michael Natterer * app/display/gimpdisplayshell.c @@ -37,7 +45,7 @@ 2003-11-12 Sven Neumann * app/gui/color-notebook.c (color_notebook_new): added a default - role used for color selectors not handled by the GimpDialogFactory. + role used for color selectors not handled by GimpDialogFactory. Fixes bug #126783. 2003-11-12 Michael Natterer diff --git a/app/dialogs/color-dialog.c b/app/dialogs/color-dialog.c index f3a0341783..157bf81552 100644 --- a/app/dialogs/color-dialog.c +++ b/app/dialogs/color-dialog.c @@ -175,7 +175,7 @@ color_notebook_new (GimpViewable *viewable, cnp); /* The color history */ - table = gtk_table_new (2, 9, TRUE); + table = gtk_table_new (2, 1 + COLOR_HISTORY_SIZE / 2, TRUE); gtk_table_set_row_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4); @@ -202,16 +202,18 @@ color_notebook_new (GimpViewable *viewable, for (i = 0; i < COLOR_HISTORY_SIZE; i++) { GimpRGB history_color; + gint row, column; color_history_get (i, &history_color); button = gtk_button_new (); gtk_widget_set_size_request (button, COLOR_AREA_SIZE, COLOR_AREA_SIZE); + + column = i % (COLOR_HISTORY_SIZE / 2); + row = i / (COLOR_HISTORY_SIZE / 2); + gtk_table_attach_defaults (GTK_TABLE (table), button, - (i > 7 ? i - 8 : i) + 1, - (i > 7 ? i - 8 : i) + 2, - i > 7 ? 1 : 0, - i > 7 ? 2 : 1); + column + 1, column + 2, row, row + 1); cnp->history[i] = gimp_color_area_new (&history_color, GIMP_COLOR_AREA_SMALL_CHECKS, diff --git a/app/gui/color-history.c b/app/gui/color-history.c index 52a242da1a..23fd96c0f1 100644 --- a/app/gui/color-history.c +++ b/app/gui/color-history.c @@ -32,9 +32,6 @@ #include "color-history.h" -#define COLOR_HISTORY_SIZE 16 - - static void color_history_init (void); @@ -152,7 +149,6 @@ color_history_add (const GimpRGB *rgb) goto doit; } - } } } diff --git a/app/gui/color-history.h b/app/gui/color-history.h index 59a1db7116..759082d771 100644 --- a/app/gui/color-history.h +++ b/app/gui/color-history.h @@ -22,7 +22,7 @@ #ifndef __COLOR_HISTORY_H__ #define __COLOR_HISTORY_H__ -#define COLOR_HISTORY_SIZE 16 +#define COLOR_HISTORY_SIZE 12 gint color_history_add (const GimpRGB *rgb); diff --git a/app/gui/color-notebook.c b/app/gui/color-notebook.c index f3a0341783..157bf81552 100644 --- a/app/gui/color-notebook.c +++ b/app/gui/color-notebook.c @@ -175,7 +175,7 @@ color_notebook_new (GimpViewable *viewable, cnp); /* The color history */ - table = gtk_table_new (2, 9, TRUE); + table = gtk_table_new (2, 1 + COLOR_HISTORY_SIZE / 2, TRUE); gtk_table_set_row_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4); @@ -202,16 +202,18 @@ color_notebook_new (GimpViewable *viewable, for (i = 0; i < COLOR_HISTORY_SIZE; i++) { GimpRGB history_color; + gint row, column; color_history_get (i, &history_color); button = gtk_button_new (); gtk_widget_set_size_request (button, COLOR_AREA_SIZE, COLOR_AREA_SIZE); + + column = i % (COLOR_HISTORY_SIZE / 2); + row = i / (COLOR_HISTORY_SIZE / 2); + gtk_table_attach_defaults (GTK_TABLE (table), button, - (i > 7 ? i - 8 : i) + 1, - (i > 7 ? i - 8 : i) + 2, - i > 7 ? 1 : 0, - i > 7 ? 2 : 1); + column + 1, column + 2, row, row + 1); cnp->history[i] = gimp_color_area_new (&history_color, GIMP_COLOR_AREA_SMALL_CHECKS, diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c index f3a0341783..157bf81552 100644 --- a/app/widgets/gimpcolordialog.c +++ b/app/widgets/gimpcolordialog.c @@ -175,7 +175,7 @@ color_notebook_new (GimpViewable *viewable, cnp); /* The color history */ - table = gtk_table_new (2, 9, TRUE); + table = gtk_table_new (2, 1 + COLOR_HISTORY_SIZE / 2, TRUE); gtk_table_set_row_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4); @@ -202,16 +202,18 @@ color_notebook_new (GimpViewable *viewable, for (i = 0; i < COLOR_HISTORY_SIZE; i++) { GimpRGB history_color; + gint row, column; color_history_get (i, &history_color); button = gtk_button_new (); gtk_widget_set_size_request (button, COLOR_AREA_SIZE, COLOR_AREA_SIZE); + + column = i % (COLOR_HISTORY_SIZE / 2); + row = i / (COLOR_HISTORY_SIZE / 2); + gtk_table_attach_defaults (GTK_TABLE (table), button, - (i > 7 ? i - 8 : i) + 1, - (i > 7 ? i - 8 : i) + 2, - i > 7 ? 1 : 0, - i > 7 ? 2 : 1); + column + 1, column + 2, row, row + 1); cnp->history[i] = gimp_color_area_new (&history_color, GIMP_COLOR_AREA_SMALL_CHECKS,