Commit 02427845 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

set the active color from GimpColormapEditor::selected so you can pick

2003-03-04  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcolormapeditor.[ch]: set the active color from
	GimpColormapEditor::selected so you can pick colors from an
	indexed palette again.
parent 58341593
2003-03-04 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcolormapeditor.[ch]: set the active color from
GimpColormapEditor::selected so you can pick colors from an
indexed palette again.
2003-03-04 Michael Natterer <mitch@gimp.org>
 
* app/file/file-save.[ch]: added new function file_save_as() which
......@@ -41,7 +41,9 @@
#endif
#include "display/display-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpmarshal.h"
......@@ -51,6 +53,7 @@
#include "gimpdnd.h"
#include "gimpitemfactory.h"
#include "gimpmenufactory.h"
#include "gimptoolbox-color-area.h"
#include "gui/color-notebook.h"
......@@ -82,6 +85,7 @@ static void gimp_colormap_editor_unmap (GtkWidget *widget);
static void gimp_colormap_editor_set_image (GimpImageEditor *editor,
GimpImage *gimage);
static void gimp_colormap_editor_real_selected (GimpColormapEditor *editor);
static void gimp_colormap_editor_draw (GimpColormapEditor *editor);
static void gimp_colormap_editor_draw_cell (GimpColormapEditor *editor,
gint col);
......@@ -186,7 +190,7 @@ gimp_colormap_editor_class_init (GimpColormapEditorClass* klass)
image_editor_class->set_image = gimp_colormap_editor_set_image;
klass->selected = NULL;
klass->selected = gimp_colormap_editor_real_selected;
}
static void
......@@ -407,6 +411,36 @@ gimp_colormap_editor_col_index (GimpColormapEditor *editor)
/* private functions */
static void
gimp_colormap_editor_real_selected (GimpColormapEditor *editor)
{
GimpContext *user_context;
GimpImage *gimage;
GimpRGB color;
gint index;
gimage = GIMP_IMAGE_EDITOR (editor)->gimage;
if (!gimage)
return;
user_context = gimp_get_user_context (gimage->gimp);
index = editor->col_index;
gimp_rgba_set_uchar (&color,
gimage->cmap[index * 3 + 0],
gimage->cmap[index * 3 + 1],
gimage->cmap[index * 3 + 2],
OPAQUE_OPACITY);
if (active_color == FOREGROUND)
gimp_context_set_foreground (user_context, &color);
else if (active_color == BACKGROUND)
gimp_context_set_background (user_context, &color);
}
#define MIN_CELL_SIZE 4
static void
......
......@@ -57,7 +57,7 @@ struct _GimpColormapEditorClass
{
GimpImageEditorClass parent_class;
void (* selected) (GimpColormapEditor *gcd);
void (* selected) (GimpColormapEditor *editor);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment