app/dialogs/channel-options-dialog.c app/dialogs/palette-import-dialog.c
2008-06-29 Michael Natterer <mitch@gimp.org> * app/dialogs/channel-options-dialog.c * app/dialogs/palette-import-dialog.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpnavigationeditor.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorizetool.c * app/tools/gimphuesaturationtool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/widgets/gimpbrusheditor.c * app/widgets/gimpbrushfactoryview.c * app/widgets/gimpbrushselect.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcontainertreeview-dnd.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphistogrambox.c * app/widgets/gimppaletteeditor.c * app/widgets/gimpscalebutton.c: replace adjustment->value by gtk_adjustment_get_value (adjustment). svn path=/trunk/; revision=26019
This commit is contained in:

committed by
Michael Natterer

parent
b829a478ba
commit
6aa62a907b
23
ChangeLog
23
ChangeLog
@ -1,3 +1,26 @@
|
|||||||
|
2008-06-29 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/dialogs/channel-options-dialog.c
|
||||||
|
* app/dialogs/palette-import-dialog.c
|
||||||
|
* app/display/gimpdisplayshell-callbacks.c
|
||||||
|
* app/display/gimpnavigationeditor.c
|
||||||
|
* app/tools/gimpbrightnesscontrasttool.c
|
||||||
|
* app/tools/gimpcolorbalancetool.c
|
||||||
|
* app/tools/gimpcolorizetool.c
|
||||||
|
* app/tools/gimphuesaturationtool.c
|
||||||
|
* app/tools/gimplevelstool.c
|
||||||
|
* app/tools/gimpposterizetool.c
|
||||||
|
* app/widgets/gimpbrusheditor.c
|
||||||
|
* app/widgets/gimpbrushfactoryview.c
|
||||||
|
* app/widgets/gimpbrushselect.c
|
||||||
|
* app/widgets/gimpcolormapeditor.c
|
||||||
|
* app/widgets/gimpcontainertreeview-dnd.c
|
||||||
|
* app/widgets/gimpgradienteditor.c
|
||||||
|
* app/widgets/gimphistogrambox.c
|
||||||
|
* app/widgets/gimppaletteeditor.c
|
||||||
|
* app/widgets/gimpscalebutton.c: replace adjustment->value by
|
||||||
|
gtk_adjustment_get_value (adjustment).
|
||||||
|
|
||||||
2008-06-29 Michael Natterer <mitch@gimp.org>
|
2008-06-29 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* plug-ins/color-rotate/color-rotate-callbacks.c
|
* plug-ins/color-rotate/color-rotate-callbacks.c
|
||||||
|
@ -191,7 +191,7 @@ channel_options_opacity_update (GtkAdjustment *adjustment,
|
|||||||
GimpRGB color;
|
GimpRGB color;
|
||||||
|
|
||||||
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
|
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
|
||||||
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
|
gimp_rgb_set_alpha (&color, gtk_adjustment_get_value (adjustment) / 100.0);
|
||||||
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
|
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -726,7 +726,8 @@ palette_import_columns_changed (GtkAdjustment *adj,
|
|||||||
ImportDialog *dialog)
|
ImportDialog *dialog)
|
||||||
{
|
{
|
||||||
if (dialog->palette)
|
if (dialog->palette)
|
||||||
gimp_palette_set_columns (dialog->palette, ROUND (adj->value));
|
gimp_palette_set_columns (dialog->palette,
|
||||||
|
ROUND (gtk_adjustment_get_value (adj)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* functions & callbacks to keep the import dialog uptodate ****************/
|
/* functions & callbacks to keep the import dialog uptodate ****************/
|
||||||
@ -772,9 +773,9 @@ palette_import_make_palette (ImportDialog *dialog)
|
|||||||
if (! palette_name || ! strlen (palette_name))
|
if (! palette_name || ! strlen (palette_name))
|
||||||
palette_name = _("Untitled");
|
palette_name = _("Untitled");
|
||||||
|
|
||||||
n_colors = ROUND (dialog->num_colors->value);
|
n_colors = ROUND (gtk_adjustment_get_value (dialog->num_colors));
|
||||||
n_columns = ROUND (dialog->columns->value);
|
n_columns = ROUND (gtk_adjustment_get_value (dialog->columns));
|
||||||
threshold = ROUND (dialog->threshold->value);
|
threshold = ROUND (gtk_adjustment_get_value (dialog->threshold));
|
||||||
|
|
||||||
switch (dialog->import_type)
|
switch (dialog->import_type)
|
||||||
{
|
{
|
||||||
|
@ -987,10 +987,11 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = adj->value + ((direction == GDK_SCROLL_UP ||
|
value = (gtk_adjustment_get_value (adj) +
|
||||||
|
((direction == GDK_SCROLL_UP ||
|
||||||
direction == GDK_SCROLL_LEFT) ?
|
direction == GDK_SCROLL_LEFT) ?
|
||||||
-adj->page_increment / 2 :
|
-adj->page_increment / 2 :
|
||||||
adj->page_increment / 2);
|
adj->page_increment / 2));
|
||||||
value = CLAMP (value, adj->lower, adj->upper - adj->page_size);
|
value = CLAMP (value, adj->lower, adj->upper - adj->page_size);
|
||||||
|
|
||||||
gtk_adjustment_set_value (adj, value);
|
gtk_adjustment_set_value (adj, value);
|
||||||
@ -1651,14 +1652,20 @@ static void
|
|||||||
gimp_display_shell_vscrollbar_update (GtkAdjustment *adjustment,
|
gimp_display_shell_vscrollbar_update (GtkAdjustment *adjustment,
|
||||||
GimpDisplayShell *shell)
|
GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
gimp_display_shell_scroll (shell, 0, (adjustment->value - shell->offset_y));
|
gimp_display_shell_scroll (shell,
|
||||||
|
0,
|
||||||
|
gtk_adjustment_get_value (adjustment) -
|
||||||
|
shell->offset_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_display_shell_hscrollbar_update (GtkAdjustment *adjustment,
|
gimp_display_shell_hscrollbar_update (GtkAdjustment *adjustment,
|
||||||
GimpDisplayShell *shell)
|
GimpDisplayShell *shell)
|
||||||
{
|
{
|
||||||
gimp_display_shell_scroll (shell, (adjustment->value - shell->offset_x), 0);
|
gimp_display_shell_scroll (shell,
|
||||||
|
gtk_adjustment_get_value (adjustment) -
|
||||||
|
shell->offset_x,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkModifierType
|
static GdkModifierType
|
||||||
|
@ -541,7 +541,7 @@ gimp_navigation_editor_scroll (GimpNavigationView *view,
|
|||||||
|
|
||||||
g_assert (adj != NULL);
|
g_assert (adj != NULL);
|
||||||
|
|
||||||
value = adj->value;
|
value = gtk_adjustment_get_value (adj);
|
||||||
|
|
||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
@ -566,7 +566,8 @@ static void
|
|||||||
gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
|
gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
|
||||||
GimpNavigationEditor *editor)
|
GimpNavigationEditor *editor)
|
||||||
{
|
{
|
||||||
gimp_display_shell_scale (editor->shell, GIMP_ZOOM_TO, pow (2.0, adj->value));
|
gimp_display_shell_scale (editor->shell, GIMP_ZOOM_TO,
|
||||||
|
pow (2.0, gtk_adjustment_get_value (adj)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -386,7 +386,9 @@ brightness_contrast_brightness_changed (GtkAdjustment *adjustment,
|
|||||||
GimpBrightnessContrastTool *bc_tool)
|
GimpBrightnessContrastTool *bc_tool)
|
||||||
{
|
{
|
||||||
GimpBrightnessContrastConfig *config = bc_tool->config;
|
GimpBrightnessContrastConfig *config = bc_tool->config;
|
||||||
gdouble value = adjustment->value / 127.0;
|
gdouble value;
|
||||||
|
|
||||||
|
value = gtk_adjustment_get_value (adjustment) / 127.0;
|
||||||
|
|
||||||
if (config->brightness != value)
|
if (config->brightness != value)
|
||||||
{
|
{
|
||||||
@ -401,7 +403,9 @@ brightness_contrast_contrast_changed (GtkAdjustment *adjustment,
|
|||||||
GimpBrightnessContrastTool *bc_tool)
|
GimpBrightnessContrastTool *bc_tool)
|
||||||
{
|
{
|
||||||
GimpBrightnessContrastConfig *config = bc_tool->config;
|
GimpBrightnessContrastConfig *config = bc_tool->config;
|
||||||
gdouble value = adjustment->value / 127.0;
|
gdouble value;
|
||||||
|
|
||||||
|
value = gtk_adjustment_get_value (adjustment) / 127.0;
|
||||||
|
|
||||||
if (config->contrast != value)
|
if (config->contrast != value)
|
||||||
{
|
{
|
||||||
|
@ -424,12 +424,11 @@ static void
|
|||||||
color_balance_preserve_toggled (GtkWidget *widget,
|
color_balance_preserve_toggled (GtkWidget *widget,
|
||||||
GimpColorBalanceTool *cb_tool)
|
GimpColorBalanceTool *cb_tool)
|
||||||
{
|
{
|
||||||
GimpColorBalanceConfig *config = cb_tool->config;
|
gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
|
||||||
gboolean active = GTK_TOGGLE_BUTTON (widget)->active;
|
|
||||||
|
|
||||||
if (config->preserve_luminosity != active)
|
if (cb_tool->config->preserve_luminosity != active)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (cb_tool->config,
|
||||||
"preserve-luminosity", active,
|
"preserve-luminosity", active,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -439,12 +438,11 @@ static void
|
|||||||
color_balance_cr_changed (GtkAdjustment *adjustment,
|
color_balance_cr_changed (GtkAdjustment *adjustment,
|
||||||
GimpColorBalanceTool *cb_tool)
|
GimpColorBalanceTool *cb_tool)
|
||||||
{
|
{
|
||||||
GimpColorBalanceConfig *config = cb_tool->config;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
gdouble value = adjustment->value / 100.0;
|
|
||||||
|
|
||||||
if (config->cyan_red[config->range] != value)
|
if (cb_tool->config->cyan_red[cb_tool->config->range] != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (cb_tool->config,
|
||||||
"cyan-red", value,
|
"cyan-red", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -454,12 +452,11 @@ static void
|
|||||||
color_balance_mg_changed (GtkAdjustment *adjustment,
|
color_balance_mg_changed (GtkAdjustment *adjustment,
|
||||||
GimpColorBalanceTool *cb_tool)
|
GimpColorBalanceTool *cb_tool)
|
||||||
{
|
{
|
||||||
GimpColorBalanceConfig *config = cb_tool->config;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
gdouble value = adjustment->value / 100.0;
|
|
||||||
|
|
||||||
if (config->magenta_green[config->range] != value)
|
if (cb_tool->config->magenta_green[cb_tool->config->range] != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (cb_tool->config,
|
||||||
"magenta-green", value,
|
"magenta-green", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -469,12 +466,11 @@ static void
|
|||||||
color_balance_yb_changed (GtkAdjustment *adjustment,
|
color_balance_yb_changed (GtkAdjustment *adjustment,
|
||||||
GimpColorBalanceTool *cb_tool)
|
GimpColorBalanceTool *cb_tool)
|
||||||
{
|
{
|
||||||
GimpColorBalanceConfig *config = cb_tool->config;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
gdouble value = adjustment->value / 100.0;
|
|
||||||
|
|
||||||
if (config->yellow_blue[config->range] != value)
|
if (cb_tool->config->yellow_blue[cb_tool->config->range] != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (cb_tool->config,
|
||||||
"yellow-blue", value,
|
"yellow-blue", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ static void
|
|||||||
colorize_hue_changed (GtkAdjustment *adjustment,
|
colorize_hue_changed (GtkAdjustment *adjustment,
|
||||||
GimpColorizeTool *col_tool)
|
GimpColorizeTool *col_tool)
|
||||||
{
|
{
|
||||||
gdouble value = adjustment->value / 360.0;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 360.0;
|
||||||
|
|
||||||
if (col_tool->config->hue != value)
|
if (col_tool->config->hue != value)
|
||||||
{
|
{
|
||||||
@ -326,7 +326,7 @@ static void
|
|||||||
colorize_saturation_changed (GtkAdjustment *adjustment,
|
colorize_saturation_changed (GtkAdjustment *adjustment,
|
||||||
GimpColorizeTool *col_tool)
|
GimpColorizeTool *col_tool)
|
||||||
{
|
{
|
||||||
gdouble value = adjustment->value / 100.0;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
|
|
||||||
if (col_tool->config->saturation != value)
|
if (col_tool->config->saturation != value)
|
||||||
{
|
{
|
||||||
@ -340,7 +340,7 @@ static void
|
|||||||
colorize_lightness_changed (GtkAdjustment *adjustment,
|
colorize_lightness_changed (GtkAdjustment *adjustment,
|
||||||
GimpColorizeTool *col_tool)
|
GimpColorizeTool *col_tool)
|
||||||
{
|
{
|
||||||
gdouble value = adjustment->value / 100.0;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
|
|
||||||
if (col_tool->config->lightness != value)
|
if (col_tool->config->lightness != value)
|
||||||
{
|
{
|
||||||
|
@ -568,12 +568,11 @@ static void
|
|||||||
hue_saturation_hue_changed (GtkAdjustment *adjustment,
|
hue_saturation_hue_changed (GtkAdjustment *adjustment,
|
||||||
GimpHueSaturationTool *hs_tool)
|
GimpHueSaturationTool *hs_tool)
|
||||||
{
|
{
|
||||||
GimpHueSaturationConfig *config = hs_tool->config;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 180.0;
|
||||||
gdouble value = adjustment->value / 180.0;
|
|
||||||
|
|
||||||
if (config->hue[config->range] != value)
|
if (hs_tool->config->hue[hs_tool->config->range] != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (hs_tool->config,
|
||||||
"hue", value,
|
"hue", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -583,12 +582,11 @@ static void
|
|||||||
hue_saturation_lightness_changed (GtkAdjustment *adjustment,
|
hue_saturation_lightness_changed (GtkAdjustment *adjustment,
|
||||||
GimpHueSaturationTool *hs_tool)
|
GimpHueSaturationTool *hs_tool)
|
||||||
{
|
{
|
||||||
GimpHueSaturationConfig *config = hs_tool->config;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
gdouble value = adjustment->value / 100.0;
|
|
||||||
|
|
||||||
if (config->lightness[config->range] != value)
|
if (hs_tool->config->lightness[hs_tool->config->range] != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (hs_tool->config,
|
||||||
"lightness", value,
|
"lightness", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -598,12 +596,11 @@ static void
|
|||||||
hue_saturation_saturation_changed (GtkAdjustment *adjustment,
|
hue_saturation_saturation_changed (GtkAdjustment *adjustment,
|
||||||
GimpHueSaturationTool *hs_tool)
|
GimpHueSaturationTool *hs_tool)
|
||||||
{
|
{
|
||||||
GimpHueSaturationConfig *config = hs_tool->config;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
gdouble value = adjustment->value / 100.0;
|
|
||||||
|
|
||||||
if (config->saturation[config->range] != value)
|
if (hs_tool->config->saturation[hs_tool->config->range] != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (hs_tool->config,
|
||||||
"saturation", value,
|
"saturation", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
@ -613,12 +610,11 @@ static void
|
|||||||
hue_saturation_overlap_changed (GtkAdjustment *adjustment,
|
hue_saturation_overlap_changed (GtkAdjustment *adjustment,
|
||||||
GimpHueSaturationTool *hs_tool)
|
GimpHueSaturationTool *hs_tool)
|
||||||
{
|
{
|
||||||
GimpHueSaturationConfig *config = hs_tool->config;
|
gdouble value = gtk_adjustment_get_value (adjustment) / 100.0;
|
||||||
gdouble value = adjustment->value / 100.0;
|
|
||||||
|
|
||||||
if (config->overlap != value)
|
if (hs_tool->config->overlap != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (hs_tool->config,
|
||||||
"overlap", value,
|
"overlap", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
@ -797,10 +797,10 @@ gimp_levels_tool_config_notify (GObject *object,
|
|||||||
gtk_adjustment_set_value (tool->high_input,
|
gtk_adjustment_set_value (tool->high_input,
|
||||||
config->high_input[config->channel] * 255.0);
|
config->high_input[config->channel] * 255.0);
|
||||||
|
|
||||||
tool->low_input->upper = tool->high_input->value;
|
tool->low_input->upper = gtk_adjustment_get_value (tool->high_input);
|
||||||
tool->high_input->lower = tool->low_input->value;
|
tool->high_input->lower = gtk_adjustment_get_value (tool->low_input);
|
||||||
tool->gamma_linear->lower = tool->low_input->value;
|
tool->gamma_linear->lower = gtk_adjustment_get_value (tool->low_input);
|
||||||
tool->gamma_linear->upper = tool->high_input->value;
|
tool->gamma_linear->upper = gtk_adjustment_get_value (tool->high_input);
|
||||||
gtk_adjustment_changed (tool->low_input);
|
gtk_adjustment_changed (tool->low_input);
|
||||||
gtk_adjustment_changed (tool->high_input);
|
gtk_adjustment_changed (tool->high_input);
|
||||||
gtk_adjustment_changed (tool->gamma_linear);
|
gtk_adjustment_changed (tool->gamma_linear);
|
||||||
@ -938,10 +938,12 @@ levels_stretch_callback (GtkWidget *widget,
|
|||||||
static void
|
static void
|
||||||
levels_linear_gamma_update (GimpLevelsTool *tool)
|
levels_linear_gamma_update (GimpLevelsTool *tool)
|
||||||
{
|
{
|
||||||
|
gdouble low_input = gtk_adjustment_get_value (tool->low_input);
|
||||||
|
gdouble high_input = gtk_adjustment_get_value (tool->high_input);
|
||||||
gdouble delta, mid, tmp, value;
|
gdouble delta, mid, tmp, value;
|
||||||
|
|
||||||
delta = (tool->high_input->value - tool->low_input->value) / 2.0;
|
delta = (high_input - low_input) / 2.0;
|
||||||
mid = tool->low_input->value + delta;
|
mid = low_input + delta;
|
||||||
tmp = log10 (1.0 / tool->config->gamma[tool->config->channel]);
|
tmp = log10 (1.0 / tool->config->gamma[tool->config->channel]);
|
||||||
value = mid + delta * tmp;
|
value = mid + delta * tmp;
|
||||||
|
|
||||||
@ -952,14 +954,16 @@ static void
|
|||||||
levels_linear_gamma_changed (GtkAdjustment *adjustment,
|
levels_linear_gamma_changed (GtkAdjustment *adjustment,
|
||||||
GimpLevelsTool *tool)
|
GimpLevelsTool *tool)
|
||||||
{
|
{
|
||||||
|
gdouble low_input = gtk_adjustment_get_value (tool->low_input);
|
||||||
|
gdouble high_input = gtk_adjustment_get_value (tool->high_input);
|
||||||
gdouble delta, mid, tmp, value;
|
gdouble delta, mid, tmp, value;
|
||||||
|
|
||||||
delta = (tool->high_input->value - tool->low_input->value) / 2.0;
|
delta = (high_input - low_input) / 2.0;
|
||||||
|
|
||||||
if (delta >= 0.5)
|
if (delta >= 0.5)
|
||||||
{
|
{
|
||||||
mid = tool->low_input->value + delta;
|
mid = low_input + delta;
|
||||||
tmp = (adjustment->value - mid) / delta;
|
tmp = (gtk_adjustment_get_value (adjustment) - mid) / delta;
|
||||||
value = 1.0 / pow (10, tmp);
|
value = 1.0 / pow (10, tmp);
|
||||||
|
|
||||||
/* round the gamma value to the nearest 1/100th */
|
/* round the gamma value to the nearest 1/100th */
|
||||||
@ -974,7 +978,7 @@ levels_low_input_changed (GtkAdjustment *adjustment,
|
|||||||
GimpLevelsTool *tool)
|
GimpLevelsTool *tool)
|
||||||
{
|
{
|
||||||
GimpLevelsConfig *config = tool->config;
|
GimpLevelsConfig *config = tool->config;
|
||||||
gint value = ROUND (adjustment->value);
|
gint value = ROUND (gtk_adjustment_get_value (adjustment));
|
||||||
|
|
||||||
tool->high_input->lower = value;
|
tool->high_input->lower = value;
|
||||||
tool->gamma_linear->lower = value;
|
tool->gamma_linear->lower = value;
|
||||||
@ -996,11 +1000,12 @@ levels_gamma_changed (GtkAdjustment *adjustment,
|
|||||||
GimpLevelsTool *tool)
|
GimpLevelsTool *tool)
|
||||||
{
|
{
|
||||||
GimpLevelsConfig *config = tool->config;
|
GimpLevelsConfig *config = tool->config;
|
||||||
|
gdouble value = gtk_adjustment_get_value (adjustment);
|
||||||
|
|
||||||
if (config->gamma[config->channel] != adjustment->value)
|
if (config->gamma[config->channel] != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (config,
|
||||||
"gamma", adjustment->value,
|
"gamma", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1012,7 +1017,7 @@ levels_high_input_changed (GtkAdjustment *adjustment,
|
|||||||
GimpLevelsTool *tool)
|
GimpLevelsTool *tool)
|
||||||
{
|
{
|
||||||
GimpLevelsConfig *config = tool->config;
|
GimpLevelsConfig *config = tool->config;
|
||||||
gint value = ROUND (adjustment->value);
|
gint value = ROUND (gtk_adjustment_get_value (adjustment));
|
||||||
|
|
||||||
tool->low_input->upper = value;
|
tool->low_input->upper = value;
|
||||||
tool->gamma_linear->upper = value;
|
tool->gamma_linear->upper = value;
|
||||||
@ -1034,7 +1039,7 @@ levels_low_output_changed (GtkAdjustment *adjustment,
|
|||||||
GimpLevelsTool *tool)
|
GimpLevelsTool *tool)
|
||||||
{
|
{
|
||||||
GimpLevelsConfig *config = tool->config;
|
GimpLevelsConfig *config = tool->config;
|
||||||
gint value = ROUND (adjustment->value);
|
gint value = ROUND (gtk_adjustment_get_value (adjustment));
|
||||||
|
|
||||||
if (config->low_output[config->channel] != value / 255.0)
|
if (config->low_output[config->channel] != value / 255.0)
|
||||||
{
|
{
|
||||||
@ -1049,7 +1054,7 @@ levels_high_output_changed (GtkAdjustment *adjustment,
|
|||||||
GimpLevelsTool *tool)
|
GimpLevelsTool *tool)
|
||||||
{
|
{
|
||||||
GimpLevelsConfig *config = tool->config;
|
GimpLevelsConfig *config = tool->config;
|
||||||
gint value = ROUND (adjustment->value);
|
gint value = ROUND (gtk_adjustment_get_value (adjustment));
|
||||||
|
|
||||||
if (config->high_output[config->channel] != value / 255.0)
|
if (config->high_output[config->channel] != value / 255.0)
|
||||||
{
|
{
|
||||||
|
@ -260,12 +260,11 @@ static void
|
|||||||
gimp_posterize_tool_levels_changed (GtkAdjustment *adjustment,
|
gimp_posterize_tool_levels_changed (GtkAdjustment *adjustment,
|
||||||
GimpPosterizeTool *posterize_tool)
|
GimpPosterizeTool *posterize_tool)
|
||||||
{
|
{
|
||||||
GimpPosterizeConfig *config = posterize_tool->config;
|
gint value = ROUND (gtk_adjustment_get_value (adjustment));
|
||||||
gint value = ROUND (adjustment->value);
|
|
||||||
|
|
||||||
if (config->levels != value)
|
if (posterize_tool->config->levels != value)
|
||||||
{
|
{
|
||||||
g_object_set (config,
|
g_object_set (posterize_tool->config,
|
||||||
"levels", value,
|
"levels", value,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
@ -347,12 +347,12 @@ gimp_brush_editor_update_brush (GtkAdjustment *adjustment,
|
|||||||
|
|
||||||
brush = GIMP_BRUSH_GENERATED (GIMP_DATA_EDITOR (editor)->data);
|
brush = GIMP_BRUSH_GENERATED (GIMP_DATA_EDITOR (editor)->data);
|
||||||
|
|
||||||
radius = editor->radius_data->value;
|
radius = gtk_adjustment_get_value (editor->radius_data);
|
||||||
spikes = ROUND (editor->spikes_data->value);
|
spikes = ROUND (gtk_adjustment_get_value (editor->spikes_data));
|
||||||
hardness = editor->hardness_data->value;
|
hardness = gtk_adjustment_get_value (editor->hardness_data);
|
||||||
ratio = editor->aspect_ratio_data->value;
|
ratio = gtk_adjustment_get_value (editor->aspect_ratio_data);
|
||||||
angle = editor->angle_data->value;
|
angle = gtk_adjustment_get_value (editor->angle_data);
|
||||||
spacing = editor->spacing_data->value;
|
spacing = gtk_adjustment_get_value (editor->spacing_data);
|
||||||
|
|
||||||
if (radius != gimp_brush_generated_get_radius (brush) ||
|
if (radius != gimp_brush_generated_get_radius (brush) ||
|
||||||
spikes != gimp_brush_generated_get_spikes (brush) ||
|
spikes != gimp_brush_generated_get_spikes (brush) ||
|
||||||
|
@ -242,7 +242,7 @@ gimp_brush_factory_view_spacing_update (GtkAdjustment *adjustment,
|
|||||||
gimp_brush_factory_view_spacing_changed,
|
gimp_brush_factory_view_spacing_changed,
|
||||||
view);
|
view);
|
||||||
|
|
||||||
gimp_brush_set_spacing (brush, adjustment->value);
|
gimp_brush_set_spacing (brush, gtk_adjustment_get_value (adjustment));
|
||||||
|
|
||||||
g_signal_handlers_unblock_by_func (brush,
|
g_signal_handlers_unblock_by_func (brush,
|
||||||
gimp_brush_factory_view_spacing_changed,
|
gimp_brush_factory_view_spacing_changed,
|
||||||
|
@ -332,7 +332,7 @@ gimp_brush_select_opacity_update (GtkAdjustment *adjustment,
|
|||||||
GimpBrushSelect *select)
|
GimpBrushSelect *select)
|
||||||
{
|
{
|
||||||
gimp_context_set_opacity (GIMP_PDB_DIALOG (select)->context,
|
gimp_context_set_opacity (GIMP_PDB_DIALOG (select)->context,
|
||||||
adjustment->value / 100.0);
|
gtk_adjustment_get_value (adjustment) / 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -353,9 +353,11 @@ static void
|
|||||||
gimp_brush_select_spacing_update (GtkAdjustment *adjustment,
|
gimp_brush_select_spacing_update (GtkAdjustment *adjustment,
|
||||||
GimpBrushSelect *select)
|
GimpBrushSelect *select)
|
||||||
{
|
{
|
||||||
if (select->spacing != adjustment->value)
|
gdouble value = gtk_adjustment_get_value (adjustment);
|
||||||
|
|
||||||
|
if (select->spacing != value)
|
||||||
{
|
{
|
||||||
select->spacing = adjustment->value;
|
select->spacing = value;
|
||||||
|
|
||||||
gimp_pdb_dialog_run_callback (GIMP_PDB_DIALOG (select), FALSE);
|
gimp_pdb_dialog_run_callback (GIMP_PDB_DIALOG (select), FALSE);
|
||||||
}
|
}
|
||||||
|
@ -829,7 +829,9 @@ gimp_colormap_adjustment_changed (GtkAdjustment *adjustment,
|
|||||||
|
|
||||||
if (HAVE_COLORMAP (image))
|
if (HAVE_COLORMAP (image))
|
||||||
{
|
{
|
||||||
gimp_colormap_editor_set_index (editor, adjustment->value + 0.5, NULL);
|
gint index = ROUND (gtk_adjustment_get_value (adjustment));
|
||||||
|
|
||||||
|
gimp_colormap_editor_set_index (editor, index, NULL);
|
||||||
|
|
||||||
gimp_colormap_editor_update_entries (editor);
|
gimp_colormap_editor_update_entries (editor);
|
||||||
}
|
}
|
||||||
|
@ -185,9 +185,9 @@ gimp_container_tree_view_scroll_timeout (gpointer data)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (tree_view->scroll_dir == GDK_SCROLL_UP)
|
if (tree_view->scroll_dir == GDK_SCROLL_UP)
|
||||||
new_value = adj->value - SCROLL_STEP;
|
new_value = gtk_adjustment_get_value (adj) - SCROLL_STEP;
|
||||||
else
|
else
|
||||||
new_value = adj->value + SCROLL_STEP;
|
new_value = gtk_adjustment_get_value (adj) + SCROLL_STEP;
|
||||||
|
|
||||||
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
||||||
|
|
||||||
|
@ -586,7 +586,7 @@ gimp_gradient_editor_zoom (GimpGradientEditor *editor,
|
|||||||
|
|
||||||
adjustment = GTK_ADJUSTMENT (editor->scroll_data);
|
adjustment = GTK_ADJUSTMENT (editor->scroll_data);
|
||||||
|
|
||||||
old_value = adjustment->value;
|
old_value = gtk_adjustment_get_value (adjustment);
|
||||||
old_page_size = adjustment->page_size;
|
old_page_size = adjustment->page_size;
|
||||||
|
|
||||||
switch (zoom_type)
|
switch (zoom_type)
|
||||||
@ -776,8 +776,9 @@ gradient_editor_scrollbar_update (GtkAdjustment *adjustment,
|
|||||||
editor->zoom_factor);
|
editor->zoom_factor);
|
||||||
|
|
||||||
str2 = g_strdup_printf (_("Displaying [%0.4f, %0.4f]"),
|
str2 = g_strdup_printf (_("Displaying [%0.4f, %0.4f]"),
|
||||||
adjustment->value,
|
gtk_adjustment_get_value (adjustment),
|
||||||
adjustment->value + adjustment->page_size);
|
gtk_adjustment_get_value (adjustment) +
|
||||||
|
adjustment->page_size);
|
||||||
|
|
||||||
gradient_editor_set_hint (editor, str1, str2, NULL, NULL);
|
gradient_editor_set_hint (editor, str1, str2, NULL, NULL);
|
||||||
|
|
||||||
@ -787,8 +788,8 @@ gradient_editor_scrollbar_update (GtkAdjustment *adjustment,
|
|||||||
renderer = GIMP_VIEW_RENDERER_GRADIENT (GIMP_VIEW (data_editor->view)->renderer);
|
renderer = GIMP_VIEW_RENDERER_GRADIENT (GIMP_VIEW (data_editor->view)->renderer);
|
||||||
|
|
||||||
gimp_view_renderer_gradient_set_offsets (renderer,
|
gimp_view_renderer_gradient_set_offsets (renderer,
|
||||||
adjustment->value,
|
gtk_adjustment_get_value (adjustment),
|
||||||
adjustment->value +
|
gtk_adjustment_get_value (adjustment) +
|
||||||
adjustment->page_size,
|
adjustment->page_size,
|
||||||
editor->instant_update);
|
editor->instant_update);
|
||||||
gimp_gradient_editor_update (editor);
|
gimp_gradient_editor_update (editor);
|
||||||
@ -923,7 +924,7 @@ view_events (GtkWidget *widget,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
GtkAdjustment *adj = GTK_ADJUSTMENT (editor->scroll_data);
|
GtkAdjustment *adj = GTK_ADJUSTMENT (editor->scroll_data);
|
||||||
gfloat value = adj->value;
|
gfloat value = gtk_adjustment_get_value (adj);
|
||||||
|
|
||||||
switch (sevent->direction)
|
switch (sevent->direction)
|
||||||
{
|
{
|
||||||
@ -1122,9 +1123,10 @@ control_events (GtkWidget *widget,
|
|||||||
|
|
||||||
gfloat new_value;
|
gfloat new_value;
|
||||||
|
|
||||||
new_value = adj->value + ((sevent->direction == GDK_SCROLL_UP) ?
|
new_value = (gtk_adjustment_get_value (adj) +
|
||||||
|
((sevent->direction == GDK_SCROLL_UP) ?
|
||||||
- adj->page_increment / 2 :
|
- adj->page_increment / 2 :
|
||||||
adj->page_increment / 2);
|
adj->page_increment / 2));
|
||||||
|
|
||||||
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
||||||
|
|
||||||
@ -1238,8 +1240,9 @@ control_expose (GtkWidget *widget,
|
|||||||
GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data),
|
GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data),
|
||||||
cr,
|
cr,
|
||||||
width, height,
|
width, height,
|
||||||
adj->value,
|
gtk_adjustment_get_value (adj),
|
||||||
adj->value + adj->page_size);
|
gtk_adjustment_get_value (adj) +
|
||||||
|
adj->page_size);
|
||||||
|
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
|
||||||
|
@ -193,28 +193,30 @@ static void
|
|||||||
gimp_histogram_box_low_adj_update (GtkAdjustment *adjustment,
|
gimp_histogram_box_low_adj_update (GtkAdjustment *adjustment,
|
||||||
GimpHistogramBox *box)
|
GimpHistogramBox *box)
|
||||||
{
|
{
|
||||||
if ((gdouble) box->view->start == adjustment->value)
|
gint value = ROUND (gtk_adjustment_get_value (adjustment));
|
||||||
return;
|
|
||||||
|
|
||||||
box->high_adj->lower = adjustment->value;
|
if (box->view->start != value)
|
||||||
|
{
|
||||||
|
box->high_adj->lower = value;
|
||||||
gtk_adjustment_changed (box->high_adj);
|
gtk_adjustment_changed (box->high_adj);
|
||||||
|
|
||||||
gimp_histogram_view_set_range (box->view,
|
gimp_histogram_view_set_range (box->view, value, box->view->end);
|
||||||
adjustment->value, box->view->end);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_histogram_box_high_adj_update (GtkAdjustment *adjustment,
|
gimp_histogram_box_high_adj_update (GtkAdjustment *adjustment,
|
||||||
GimpHistogramBox *box)
|
GimpHistogramBox *box)
|
||||||
{
|
{
|
||||||
if ((gdouble) box->view->end == adjustment->value)
|
gint value = ROUND (gtk_adjustment_get_value (value));
|
||||||
return;
|
|
||||||
|
|
||||||
box->low_adj->upper = adjustment->value;
|
if (box->view->end != value)
|
||||||
|
{
|
||||||
|
box->low_adj->upper = value;
|
||||||
gtk_adjustment_changed (box->low_adj);
|
gtk_adjustment_changed (box->low_adj);
|
||||||
|
|
||||||
gimp_histogram_view_set_range (box->view,
|
gimp_histogram_view_set_range (box->view, box->view->start, value);
|
||||||
box->view->start, adjustment->value);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -823,7 +823,8 @@ palette_editor_columns_changed (GtkAdjustment *adj,
|
|||||||
{
|
{
|
||||||
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
|
GimpPalette *palette = GIMP_PALETTE (GIMP_DATA_EDITOR (editor)->data);
|
||||||
|
|
||||||
gimp_palette_set_columns (palette, ROUND (adj->value));
|
gimp_palette_set_columns (palette,
|
||||||
|
ROUND (gtk_adjustment_get_value (adj)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,14 +90,21 @@ gimp_scale_button_update_tooltip (GimpScaleButton *button)
|
|||||||
{
|
{
|
||||||
GtkAdjustment *adj;
|
GtkAdjustment *adj;
|
||||||
gchar *text;
|
gchar *text;
|
||||||
|
gdouble value;
|
||||||
|
gdouble lower;
|
||||||
|
gdouble upper;
|
||||||
|
|
||||||
adj = gimp_gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
|
adj = gimp_gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
|
||||||
|
|
||||||
|
value = gtk_adjustment_get_value (adj);
|
||||||
|
lower = adj->lower;
|
||||||
|
upper = adj->upper;
|
||||||
|
|
||||||
/* use U+2009 THIN SPACE to seperate the percent sign from the number */
|
/* use U+2009 THIN SPACE to seperate the percent sign from the number */
|
||||||
|
|
||||||
text = g_strdup_printf ("%d\342\200\211%%",
|
text = g_strdup_printf ("%d\342\200\211%%",
|
||||||
(gint) (0.5 + ((adj->value - adj->lower) * 100.0 /
|
(gint) (0.5 + ((value - lower) * 100.0 /
|
||||||
(adj->upper - adj->lower))));
|
(upper - lower))));
|
||||||
|
|
||||||
gtk_widget_set_tooltip_text (GTK_WIDGET (button), text);
|
gtk_widget_set_tooltip_text (GTK_WIDGET (button), text);
|
||||||
g_free (text);
|
g_free (text);
|
||||||
|
Reference in New Issue
Block a user