mirror of https://github.com/GNOME/gimp.git
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:
parent
41b549a7b0
commit
b2465d29f7
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue