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.
This commit is contained in:

committed by
Michael Natterer

parent
663b44c988
commit
fcdb536372
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
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>
|
2006-08-31 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/core/gimpgradient.[ch] (gimp_gradient_has_fg_bg_segments):
|
* 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_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);
|
seg, &lseg, &rseg);
|
||||||
|
|
||||||
if (lseg)
|
if (lseg)
|
||||||
@ -958,7 +959,7 @@ static void
|
|||||||
view_set_hint (GimpGradientEditor *editor,
|
view_set_hint (GimpGradientEditor *editor,
|
||||||
gint x)
|
gint x)
|
||||||
{
|
{
|
||||||
GimpDataEditor *data_editor;
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
|
||||||
gdouble xpos;
|
gdouble xpos;
|
||||||
GimpRGB rgb;
|
GimpRGB rgb;
|
||||||
GimpHSV hsv;
|
GimpHSV hsv;
|
||||||
@ -967,12 +968,10 @@ view_set_hint (GimpGradientEditor *editor,
|
|||||||
gchar *str3;
|
gchar *str3;
|
||||||
gchar *str4;
|
gchar *str4;
|
||||||
|
|
||||||
data_editor = GIMP_DATA_EDITOR (editor);
|
|
||||||
|
|
||||||
xpos = control_calc_g_pos (editor, x);
|
xpos = control_calc_g_pos (editor, x);
|
||||||
|
|
||||||
gimp_gradient_get_color_at (GIMP_GRADIENT (data_editor->data),
|
gimp_gradient_get_color_at (GIMP_GRADIENT (data_editor->data),
|
||||||
editor->context, NULL,
|
data_editor->context, NULL,
|
||||||
xpos, FALSE, &rgb);
|
xpos, FALSE, &rgb);
|
||||||
|
|
||||||
gimp_rgb_to_hsv (&rgb, &hsv);
|
gimp_rgb_to_hsv (&rgb, &hsv);
|
||||||
@ -999,7 +998,6 @@ view_set_foreground (GimpGradientEditor *editor,
|
|||||||
gint x)
|
gint x)
|
||||||
{
|
{
|
||||||
GimpGradient *gradient;
|
GimpGradient *gradient;
|
||||||
GimpContext *user_context;
|
|
||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
gdouble xpos;
|
gdouble xpos;
|
||||||
gchar *str2;
|
gchar *str2;
|
||||||
@ -1007,14 +1005,13 @@ view_set_foreground (GimpGradientEditor *editor,
|
|||||||
|
|
||||||
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
|
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);
|
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);
|
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)"),
|
str2 = g_strdup_printf (_("RGB (%d, %d, %d)"),
|
||||||
(gint) (color.r * 255.0),
|
(gint) (color.r * 255.0),
|
||||||
@ -1035,7 +1032,6 @@ view_set_background (GimpGradientEditor *editor,
|
|||||||
gint x)
|
gint x)
|
||||||
{
|
{
|
||||||
GimpGradient *gradient;
|
GimpGradient *gradient;
|
||||||
GimpContext *user_context;
|
|
||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
gdouble xpos;
|
gdouble xpos;
|
||||||
gchar *str2;
|
gchar *str2;
|
||||||
@ -1043,14 +1039,13 @@ view_set_background (GimpGradientEditor *editor,
|
|||||||
|
|
||||||
gradient = GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data);
|
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);
|
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);
|
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)"),
|
str2 = g_strdup_printf (_("RGB (%d, %d, %d)"),
|
||||||
(gint) (color.r * 255.0),
|
(gint) (color.r * 255.0),
|
||||||
|
@ -52,8 +52,6 @@ struct _GimpGradientEditor
|
|||||||
{
|
{
|
||||||
GimpDataEditor parent_instance;
|
GimpDataEditor parent_instance;
|
||||||
|
|
||||||
GimpContext *context;
|
|
||||||
|
|
||||||
GtkWidget *hint_label1;
|
GtkWidget *hint_label1;
|
||||||
GtkWidget *hint_label2;
|
GtkWidget *hint_label2;
|
||||||
GtkWidget *hint_label3;
|
GtkWidget *hint_label3;
|
||||||
|
@ -722,16 +722,12 @@ palette_editor_entry_clicked (GimpPaletteView *view,
|
|||||||
{
|
{
|
||||||
if (entry)
|
if (entry)
|
||||||
{
|
{
|
||||||
Gimp *gimp;
|
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor);
|
||||||
GimpContext *user_context;
|
|
||||||
|
|
||||||
gimp = GIMP_DATA_EDITOR (editor)->data_factory->gimp;
|
|
||||||
user_context = gimp_get_user_context (gimp);
|
|
||||||
|
|
||||||
if (state & GDK_CONTROL_MASK)
|
if (state & GDK_CONTROL_MASK)
|
||||||
gimp_context_set_background (user_context, &entry->color);
|
gimp_context_set_background (data_editor->context, &entry->color);
|
||||||
else
|
else
|
||||||
gimp_context_set_foreground (user_context, &entry->color);
|
gimp_context_set_foreground (data_editor->context, &entry->color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user