Commit fcdb5363 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed GimpContext member I added before deciding it needs to be added to

2006-08-31  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpgradienteditor.[ch] (struct GimpGradientEditor):
	removed GimpContext member I added before deciding it needs to be
	added to GimpDataEditor.

	Use GimpDataEditor's context instead of the bogus one. Also use
	the data editor's context instead of the user context wherever it
	was used.

	* app/widgets/gimppaletteeditor.c: use GimpDataEditor's context
	instead of the user context here too.
parent 663b44c9
2006-08-31 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpgradienteditor.[ch] (struct GimpGradientEditor):
removed GimpContext member I added before deciding it needs to be
added to GimpDataEditor.
Use GimpDataEditor's context instead of the bogus one. Also use
the data editor's context instead of the user context wherever it
was used.
* app/widgets/gimppaletteeditor.c: use GimpDataEditor's context
instead of the user context here too.
2006-08-31 Michael Natterer <mitch@gimp.org>
* app/core/gimpgradient.[ch] (gimp_gradient_has_fg_bg_segments):
......
......@@ -686,7 +686,8 @@ gradient_editor_drop_color (GtkWidget *widget,
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_split_midpoint (gradient, editor->context,
gimp_gradient_segment_split_midpoint (gradient,
GIMP_DATA_EDITOR (editor)->context,
seg, &lseg, &rseg);
if (lseg)
......@@ -958,7 +959,7 @@ static void
view_set_hint (GimpGradientEditor *editor,
gint x)
{
GimpDataEditor *data_editor;
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
gdouble xpos;
GimpRGB rgb;
GimpHSV hsv;
......@@ -967,12 +968,10 @@ view_set_hint (GimpGradientEditor *editor,
gchar *str3;
gchar *str4;
data_editor = GIMP_DATA_EDITOR (editor);
xpos = control_calc_g_pos (editor, x);
gimp_gradient_get_color_at (GIMP_GRADIENT (data_editor->data),
editor->context, NULL,
data_editor->context, NULL,
xpos, FALSE, &rgb);
gimp_rgb_to_hsv (&rgb, &hsv);
......@@ -999,7 +998,6 @@ view_set_foreground (GimpGradientEditor *editor,
gint x)
{
GimpGradient *gradient;
GimpContext *user_context;
GimpRGB color;
gdouble xpos;
gchar *str2;
......@@ -1007,14 +1005,13 @@ view_set_foreground (GimpGradientEditor *editor,
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
user_context = gimp_get_user_context (GIMP_DATA_EDITOR (editor)->data_factory->gimp);
xpos = control_calc_g_pos (editor, x);
gimp_gradient_get_color_at (gradient, editor->context,
gimp_gradient_get_color_at (gradient,
GIMP_DATA_EDITOR (editor)->context,
NULL, xpos, FALSE, &color);
gimp_context_set_foreground (user_context, &color);
gimp_context_set_foreground (GIMP_DATA_EDITOR (editor)->context, &color);
str2 = g_strdup_printf (_("RGB (%d, %d, %d)"),
(gint) (color.r * 255.0),
......@@ -1035,7 +1032,6 @@ view_set_background (GimpGradientEditor *editor,
gint x)
{
GimpGradient *gradient;
GimpContext *user_context;
GimpRGB color;
gdouble xpos;
gchar *str2;
......@@ -1043,14 +1039,13 @@ view_set_background (GimpGradientEditor *editor,
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
user_context = gimp_get_user_context (GIMP_DATA_EDITOR (editor)->data_factory->gimp);
xpos = control_calc_g_pos (editor, x);
gimp_gradient_get_color_at (gradient, editor->context,
gimp_gradient_get_color_at (gradient,
GIMP_DATA_EDITOR (editor)->context,
NULL, xpos, FALSE, &color);
gimp_context_set_background (user_context, &color);
gimp_context_set_background (GIMP_DATA_EDITOR (editor)->context, &color);
str2 = g_strdup_printf (_("RGB (%d, %d, %d)"),
(gint) (color.r * 255.0),
......
......@@ -52,8 +52,6 @@ struct _GimpGradientEditor
{
GimpDataEditor parent_instance;
GimpContext *context;
GtkWidget *hint_label1;
GtkWidget *hint_label2;
GtkWidget *hint_label3;
......
......@@ -722,16 +722,12 @@ palette_editor_entry_clicked (GimpPaletteView *view,
{
if (entry)
{
Gimp *gimp;
GimpContext *user_context;
gimp = GIMP_DATA_EDITOR (editor)->data_factory->gimp;
user_context = gimp_get_user_context (gimp);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
if (state & GDK_CONTROL_MASK)
gimp_context_set_background (user_context, &entry->color);
gimp_context_set_background (data_editor->context, &entry->color);
else
gimp_context_set_foreground (user_context, &entry->color);
gimp_context_set_foreground (data_editor->context, &entry->color);
}
}
......
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