Bill Skaggs <weskaggs@primate.ucdavis.edu>

* app/widgets/gimpcolorframe.[ch]: add a color area, to make
	sample points dialog show a swatch of color for each point.
This commit is contained in:
William Skaggs 2005-06-01 20:10:39 +00:00
parent 41b549a7b0
commit b2465d29f7
3 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-06-01 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/widgets/gimpcolorframe.[ch]: add a color area, to make
sample points dialog show a swatch of color for each point.
2005-06-01 Simon Budig <simon@gimp.org>
* app/vectors/gimpvectors.c: cosmetic change: Make the stroke IDs

View File

@ -83,7 +83,9 @@ static void
gimp_color_frame_init (GimpColorFrame *frame)
{
GtkWidget *vbox;
GtkWidget *color_area;
gint i;
GimpRGB init_color = {0, 0, 0, 1};
frame->sample_valid = FALSE;
frame->sample_type = GIMP_RGB_IMAGE;
@ -102,6 +104,14 @@ gimp_color_frame_init (GimpColorFrame *frame)
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
color_area = gimp_color_area_new (&frame->color,
GIMP_COLOR_AREA_SMALL_CHECKS, 0);
gtk_widget_set_size_request (color_area, 30, 20);
gimp_color_area_set_color (GIMP_COLOR_AREA (color_area), &init_color);
gtk_box_pack_start (GTK_BOX (vbox), color_area, FALSE, FALSE, 0);
gtk_widget_show (color_area);
frame->color_area = color_area;
for (i = 0; i < GIMP_COLOR_FRAME_ROWS; i++)
{
GtkWidget *hbox;
@ -245,6 +255,9 @@ gimp_color_frame_update (GimpColorFrame *frame)
gimp_rgba_get_uchar (&frame->color, &r, &g, &b, &a);
gimp_color_area_set_color (GIMP_COLOR_AREA (frame->color_area),
&frame->color);
switch (frame->frame_mode)
{
case GIMP_COLOR_FRAME_MODE_PIXEL:

View File

@ -50,6 +50,7 @@ struct _GimpColorFrame
GtkWidget *menu;
GtkWidget *name_labels[GIMP_COLOR_FRAME_ROWS];
GtkWidget *value_labels[GIMP_COLOR_FRAME_ROWS];
GtkWidget *color_area;
};
struct _GimpColorFrameClass