From 6aa62a907b0869f12c9b12c44a2158879fd602d1 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 29 Jun 2008 13:41:24 +0000 Subject: [PATCH] app/dialogs/channel-options-dialog.c app/dialogs/palette-import-dialog.c 2008-06-29 Michael Natterer * 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 --- ChangeLog | 23 ++++++++++++++++ app/dialogs/channel-options-dialog.c | 2 +- app/dialogs/palette-import-dialog.c | 9 +++--- app/display/gimpdisplayshell-callbacks.c | 19 +++++++++---- app/display/gimpnavigationeditor.c | 5 ++-- app/tools/gimpbrightnesscontrasttool.c | 8 ++++-- app/tools/gimpcolorbalancetool.c | 28 ++++++++----------- app/tools/gimpcolorizetool.c | 6 ++-- app/tools/gimphuesaturationtool.c | 28 ++++++++----------- app/tools/gimplevelstool.c | 35 ++++++++++++++---------- app/tools/gimpposterizetool.c | 7 ++--- app/widgets/gimpbrusheditor.c | 12 ++++---- app/widgets/gimpbrushfactoryview.c | 2 +- app/widgets/gimpbrushselect.c | 8 ++++-- app/widgets/gimpcolormapeditor.c | 4 ++- app/widgets/gimpcontainertreeview-dnd.c | 4 +-- app/widgets/gimpgradienteditor.c | 25 +++++++++-------- app/widgets/gimphistogrambox.c | 26 ++++++++++-------- app/widgets/gimppaletteeditor.c | 3 +- app/widgets/gimpscalebutton.c | 11 ++++++-- 20 files changed, 157 insertions(+), 108 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97320e6ebf..c31d9c240a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2008-06-29 Michael Natterer + + * 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 * plug-ins/color-rotate/color-rotate-callbacks.c diff --git a/app/dialogs/channel-options-dialog.c b/app/dialogs/channel-options-dialog.c index 520746b350..67a2dd369c 100644 --- a/app/dialogs/channel-options-dialog.c +++ b/app/dialogs/channel-options-dialog.c @@ -191,7 +191,7 @@ channel_options_opacity_update (GtkAdjustment *adjustment, GimpRGB 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); } diff --git a/app/dialogs/palette-import-dialog.c b/app/dialogs/palette-import-dialog.c index 05a1e6d43b..831a498191 100644 --- a/app/dialogs/palette-import-dialog.c +++ b/app/dialogs/palette-import-dialog.c @@ -726,7 +726,8 @@ palette_import_columns_changed (GtkAdjustment *adj, ImportDialog *dialog) { 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 ****************/ @@ -772,9 +773,9 @@ palette_import_make_palette (ImportDialog *dialog) if (! palette_name || ! strlen (palette_name)) palette_name = _("Untitled"); - n_colors = ROUND (dialog->num_colors->value); - n_columns = ROUND (dialog->columns->value); - threshold = ROUND (dialog->threshold->value); + n_colors = ROUND (gtk_adjustment_get_value (dialog->num_colors)); + n_columns = ROUND (gtk_adjustment_get_value (dialog->columns)); + threshold = ROUND (gtk_adjustment_get_value (dialog->threshold)); switch (dialog->import_type) { diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index e6c8d62e71..b98bf6c8a0 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -987,10 +987,11 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, break; } - value = adj->value + ((direction == GDK_SCROLL_UP || - direction == GDK_SCROLL_LEFT) ? - -adj->page_increment / 2 : - adj->page_increment / 2); + value = (gtk_adjustment_get_value (adj) + + ((direction == GDK_SCROLL_UP || + direction == GDK_SCROLL_LEFT) ? + -adj->page_increment / 2 : + adj->page_increment / 2)); value = CLAMP (value, adj->lower, adj->upper - adj->page_size); gtk_adjustment_set_value (adj, value); @@ -1651,14 +1652,20 @@ static void gimp_display_shell_vscrollbar_update (GtkAdjustment *adjustment, 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 gimp_display_shell_hscrollbar_update (GtkAdjustment *adjustment, 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 diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c index a402a00a71..f9b8fa476b 100644 --- a/app/display/gimpnavigationeditor.c +++ b/app/display/gimpnavigationeditor.c @@ -541,7 +541,7 @@ gimp_navigation_editor_scroll (GimpNavigationView *view, g_assert (adj != NULL); - value = adj->value; + value = gtk_adjustment_get_value (adj); switch (direction) { @@ -566,7 +566,8 @@ static void gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj, 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 diff --git a/app/tools/gimpbrightnesscontrasttool.c b/app/tools/gimpbrightnesscontrasttool.c index bfadfcd883..b11bd612d2 100644 --- a/app/tools/gimpbrightnesscontrasttool.c +++ b/app/tools/gimpbrightnesscontrasttool.c @@ -386,7 +386,9 @@ brightness_contrast_brightness_changed (GtkAdjustment *adjustment, GimpBrightnessContrastTool *bc_tool) { 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) { @@ -401,7 +403,9 @@ brightness_contrast_contrast_changed (GtkAdjustment *adjustment, GimpBrightnessContrastTool *bc_tool) { 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) { diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c index 28bb659084..0371d59d34 100644 --- a/app/tools/gimpcolorbalancetool.c +++ b/app/tools/gimpcolorbalancetool.c @@ -424,12 +424,11 @@ static void color_balance_preserve_toggled (GtkWidget *widget, GimpColorBalanceTool *cb_tool) { - GimpColorBalanceConfig *config = cb_tool->config; - gboolean active = GTK_TOGGLE_BUTTON (widget)->active; + gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - 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, NULL); } @@ -439,12 +438,11 @@ static void color_balance_cr_changed (GtkAdjustment *adjustment, GimpColorBalanceTool *cb_tool) { - GimpColorBalanceConfig *config = cb_tool->config; - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 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, NULL); } @@ -454,12 +452,11 @@ static void color_balance_mg_changed (GtkAdjustment *adjustment, GimpColorBalanceTool *cb_tool) { - GimpColorBalanceConfig *config = cb_tool->config; - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 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, NULL); } @@ -469,12 +466,11 @@ static void color_balance_yb_changed (GtkAdjustment *adjustment, GimpColorBalanceTool *cb_tool) { - GimpColorBalanceConfig *config = cb_tool->config; - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 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, NULL); } diff --git a/app/tools/gimpcolorizetool.c b/app/tools/gimpcolorizetool.c index bacffa22c0..5f82e526b5 100644 --- a/app/tools/gimpcolorizetool.c +++ b/app/tools/gimpcolorizetool.c @@ -312,7 +312,7 @@ static void colorize_hue_changed (GtkAdjustment *adjustment, GimpColorizeTool *col_tool) { - gdouble value = adjustment->value / 360.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 360.0; if (col_tool->config->hue != value) { @@ -326,7 +326,7 @@ static void colorize_saturation_changed (GtkAdjustment *adjustment, GimpColorizeTool *col_tool) { - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 100.0; if (col_tool->config->saturation != value) { @@ -340,7 +340,7 @@ static void colorize_lightness_changed (GtkAdjustment *adjustment, GimpColorizeTool *col_tool) { - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 100.0; if (col_tool->config->lightness != value) { diff --git a/app/tools/gimphuesaturationtool.c b/app/tools/gimphuesaturationtool.c index 7c25480fd6..0b8f5d0abe 100644 --- a/app/tools/gimphuesaturationtool.c +++ b/app/tools/gimphuesaturationtool.c @@ -568,12 +568,11 @@ static void hue_saturation_hue_changed (GtkAdjustment *adjustment, GimpHueSaturationTool *hs_tool) { - GimpHueSaturationConfig *config = hs_tool->config; - gdouble value = adjustment->value / 180.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 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, NULL); } @@ -583,12 +582,11 @@ static void hue_saturation_lightness_changed (GtkAdjustment *adjustment, GimpHueSaturationTool *hs_tool) { - GimpHueSaturationConfig *config = hs_tool->config; - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 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, NULL); } @@ -598,12 +596,11 @@ static void hue_saturation_saturation_changed (GtkAdjustment *adjustment, GimpHueSaturationTool *hs_tool) { - GimpHueSaturationConfig *config = hs_tool->config; - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 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, NULL); } @@ -613,12 +610,11 @@ static void hue_saturation_overlap_changed (GtkAdjustment *adjustment, GimpHueSaturationTool *hs_tool) { - GimpHueSaturationConfig *config = hs_tool->config; - gdouble value = adjustment->value / 100.0; + gdouble value = gtk_adjustment_get_value (adjustment) / 100.0; - if (config->overlap != value) + if (hs_tool->config->overlap != value) { - g_object_set (config, + g_object_set (hs_tool->config, "overlap", value, NULL); } diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index c9fdce6aa1..3df5f4c35e 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -797,10 +797,10 @@ gimp_levels_tool_config_notify (GObject *object, gtk_adjustment_set_value (tool->high_input, config->high_input[config->channel] * 255.0); - tool->low_input->upper = tool->high_input->value; - tool->high_input->lower = tool->low_input->value; - tool->gamma_linear->lower = tool->low_input->value; - tool->gamma_linear->upper = tool->high_input->value; + tool->low_input->upper = gtk_adjustment_get_value (tool->high_input); + tool->high_input->lower = gtk_adjustment_get_value (tool->low_input); + tool->gamma_linear->lower = gtk_adjustment_get_value (tool->low_input); + tool->gamma_linear->upper = gtk_adjustment_get_value (tool->high_input); gtk_adjustment_changed (tool->low_input); gtk_adjustment_changed (tool->high_input); gtk_adjustment_changed (tool->gamma_linear); @@ -938,10 +938,12 @@ levels_stretch_callback (GtkWidget *widget, static void 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; - delta = (tool->high_input->value - tool->low_input->value) / 2.0; - mid = tool->low_input->value + delta; + delta = (high_input - low_input) / 2.0; + mid = low_input + delta; tmp = log10 (1.0 / tool->config->gamma[tool->config->channel]); value = mid + delta * tmp; @@ -952,14 +954,16 @@ static void levels_linear_gamma_changed (GtkAdjustment *adjustment, 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; - delta = (tool->high_input->value - tool->low_input->value) / 2.0; + delta = (high_input - low_input) / 2.0; if (delta >= 0.5) { - mid = tool->low_input->value + delta; - tmp = (adjustment->value - mid) / delta; + mid = low_input + delta; + tmp = (gtk_adjustment_get_value (adjustment) - mid) / delta; value = 1.0 / pow (10, tmp); /* round the gamma value to the nearest 1/100th */ @@ -974,7 +978,7 @@ levels_low_input_changed (GtkAdjustment *adjustment, GimpLevelsTool *tool) { GimpLevelsConfig *config = tool->config; - gint value = ROUND (adjustment->value); + gint value = ROUND (gtk_adjustment_get_value (adjustment)); tool->high_input->lower = value; tool->gamma_linear->lower = value; @@ -996,11 +1000,12 @@ levels_gamma_changed (GtkAdjustment *adjustment, GimpLevelsTool *tool) { 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, - "gamma", adjustment->value, + "gamma", value, NULL); } @@ -1012,7 +1017,7 @@ levels_high_input_changed (GtkAdjustment *adjustment, GimpLevelsTool *tool) { GimpLevelsConfig *config = tool->config; - gint value = ROUND (adjustment->value); + gint value = ROUND (gtk_adjustment_get_value (adjustment)); tool->low_input->upper = value; tool->gamma_linear->upper = value; @@ -1034,7 +1039,7 @@ levels_low_output_changed (GtkAdjustment *adjustment, GimpLevelsTool *tool) { 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) { @@ -1049,7 +1054,7 @@ levels_high_output_changed (GtkAdjustment *adjustment, GimpLevelsTool *tool) { 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) { diff --git a/app/tools/gimpposterizetool.c b/app/tools/gimpposterizetool.c index 60a1cb66e0..a3faaee072 100644 --- a/app/tools/gimpposterizetool.c +++ b/app/tools/gimpposterizetool.c @@ -260,12 +260,11 @@ static void gimp_posterize_tool_levels_changed (GtkAdjustment *adjustment, GimpPosterizeTool *posterize_tool) { - GimpPosterizeConfig *config = posterize_tool->config; - gint value = ROUND (adjustment->value); + gint value = ROUND (gtk_adjustment_get_value (adjustment)); - if (config->levels != value) + if (posterize_tool->config->levels != value) { - g_object_set (config, + g_object_set (posterize_tool->config, "levels", value, NULL); } diff --git a/app/widgets/gimpbrusheditor.c b/app/widgets/gimpbrusheditor.c index cf0b7bc43a..9d8495f4fb 100644 --- a/app/widgets/gimpbrusheditor.c +++ b/app/widgets/gimpbrusheditor.c @@ -347,12 +347,12 @@ gimp_brush_editor_update_brush (GtkAdjustment *adjustment, brush = GIMP_BRUSH_GENERATED (GIMP_DATA_EDITOR (editor)->data); - radius = editor->radius_data->value; - spikes = ROUND (editor->spikes_data->value); - hardness = editor->hardness_data->value; - ratio = editor->aspect_ratio_data->value; - angle = editor->angle_data->value; - spacing = editor->spacing_data->value; + radius = gtk_adjustment_get_value (editor->radius_data); + spikes = ROUND (gtk_adjustment_get_value (editor->spikes_data)); + hardness = gtk_adjustment_get_value (editor->hardness_data); + ratio = gtk_adjustment_get_value (editor->aspect_ratio_data); + angle = gtk_adjustment_get_value (editor->angle_data); + spacing = gtk_adjustment_get_value (editor->spacing_data); if (radius != gimp_brush_generated_get_radius (brush) || spikes != gimp_brush_generated_get_spikes (brush) || diff --git a/app/widgets/gimpbrushfactoryview.c b/app/widgets/gimpbrushfactoryview.c index d61f61f472..34cd66ec47 100644 --- a/app/widgets/gimpbrushfactoryview.c +++ b/app/widgets/gimpbrushfactoryview.c @@ -242,7 +242,7 @@ gimp_brush_factory_view_spacing_update (GtkAdjustment *adjustment, gimp_brush_factory_view_spacing_changed, 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, gimp_brush_factory_view_spacing_changed, diff --git a/app/widgets/gimpbrushselect.c b/app/widgets/gimpbrushselect.c index bf9fd0c119..298c0d5971 100644 --- a/app/widgets/gimpbrushselect.c +++ b/app/widgets/gimpbrushselect.c @@ -332,7 +332,7 @@ gimp_brush_select_opacity_update (GtkAdjustment *adjustment, GimpBrushSelect *select) { gimp_context_set_opacity (GIMP_PDB_DIALOG (select)->context, - adjustment->value / 100.0); + gtk_adjustment_get_value (adjustment) / 100.0); } static void @@ -353,9 +353,11 @@ static void gimp_brush_select_spacing_update (GtkAdjustment *adjustment, 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); } diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c index 648044e20b..153de28de8 100644 --- a/app/widgets/gimpcolormapeditor.c +++ b/app/widgets/gimpcolormapeditor.c @@ -829,7 +829,9 @@ gimp_colormap_adjustment_changed (GtkAdjustment *adjustment, 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); } diff --git a/app/widgets/gimpcontainertreeview-dnd.c b/app/widgets/gimpcontainertreeview-dnd.c index 88bff49431..4ad8f2d82a 100644 --- a/app/widgets/gimpcontainertreeview-dnd.c +++ b/app/widgets/gimpcontainertreeview-dnd.c @@ -185,9 +185,9 @@ gimp_container_tree_view_scroll_timeout (gpointer data) #endif if (tree_view->scroll_dir == GDK_SCROLL_UP) - new_value = adj->value - SCROLL_STEP; + new_value = gtk_adjustment_get_value (adj) - SCROLL_STEP; 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); diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c index f7968c7f4f..bc6ea86788 100644 --- a/app/widgets/gimpgradienteditor.c +++ b/app/widgets/gimpgradienteditor.c @@ -586,7 +586,7 @@ gimp_gradient_editor_zoom (GimpGradientEditor *editor, adjustment = GTK_ADJUSTMENT (editor->scroll_data); - old_value = adjustment->value; + old_value = gtk_adjustment_get_value (adjustment); old_page_size = adjustment->page_size; switch (zoom_type) @@ -776,8 +776,9 @@ gradient_editor_scrollbar_update (GtkAdjustment *adjustment, editor->zoom_factor); str2 = g_strdup_printf (_("Displaying [%0.4f, %0.4f]"), - adjustment->value, - adjustment->value + adjustment->page_size); + gtk_adjustment_get_value (adjustment), + gtk_adjustment_get_value (adjustment) + + adjustment->page_size); 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); gimp_view_renderer_gradient_set_offsets (renderer, - adjustment->value, - adjustment->value + + gtk_adjustment_get_value (adjustment), + gtk_adjustment_get_value (adjustment) + adjustment->page_size, editor->instant_update); gimp_gradient_editor_update (editor); @@ -923,7 +924,7 @@ view_events (GtkWidget *widget, else { GtkAdjustment *adj = GTK_ADJUSTMENT (editor->scroll_data); - gfloat value = adj->value; + gfloat value = gtk_adjustment_get_value (adj); switch (sevent->direction) { @@ -1122,9 +1123,10 @@ control_events (GtkWidget *widget, gfloat new_value; - new_value = adj->value + ((sevent->direction == GDK_SCROLL_UP) ? - - adj->page_increment / 2 : - adj->page_increment / 2); + new_value = (gtk_adjustment_get_value (adj) + + ((sevent->direction == GDK_SCROLL_UP) ? + - adj->page_increment / 2 : + adj->page_increment / 2)); 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), cr, width, height, - adj->value, - adj->value + adj->page_size); + gtk_adjustment_get_value (adj), + gtk_adjustment_get_value (adj) + + adj->page_size); cairo_destroy (cr); diff --git a/app/widgets/gimphistogrambox.c b/app/widgets/gimphistogrambox.c index 3f5736dd2a..3b7b1862a2 100644 --- a/app/widgets/gimphistogrambox.c +++ b/app/widgets/gimphistogrambox.c @@ -193,28 +193,30 @@ static void gimp_histogram_box_low_adj_update (GtkAdjustment *adjustment, GimpHistogramBox *box) { - if ((gdouble) box->view->start == adjustment->value) - return; + gint value = ROUND (gtk_adjustment_get_value (adjustment)); - box->high_adj->lower = adjustment->value; - gtk_adjustment_changed (box->high_adj); + if (box->view->start != value) + { + box->high_adj->lower = value; + gtk_adjustment_changed (box->high_adj); - gimp_histogram_view_set_range (box->view, - adjustment->value, box->view->end); + gimp_histogram_view_set_range (box->view, value, box->view->end); + } } static void gimp_histogram_box_high_adj_update (GtkAdjustment *adjustment, GimpHistogramBox *box) { - if ((gdouble) box->view->end == adjustment->value) - return; + gint value = ROUND (gtk_adjustment_get_value (value)); - box->low_adj->upper = adjustment->value; - gtk_adjustment_changed (box->low_adj); + if (box->view->end != value) + { + box->low_adj->upper = value; + gtk_adjustment_changed (box->low_adj); - gimp_histogram_view_set_range (box->view, - box->view->start, adjustment->value); + gimp_histogram_view_set_range (box->view, box->view->start, value); + } } static void diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c index 4833a8ac4c..aebdbdc72f 100644 --- a/app/widgets/gimppaletteeditor.c +++ b/app/widgets/gimppaletteeditor.c @@ -823,7 +823,8 @@ palette_editor_columns_changed (GtkAdjustment *adj, { 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))); } } diff --git a/app/widgets/gimpscalebutton.c b/app/widgets/gimpscalebutton.c index 444a59d629..8728384de6 100644 --- a/app/widgets/gimpscalebutton.c +++ b/app/widgets/gimpscalebutton.c @@ -90,14 +90,21 @@ gimp_scale_button_update_tooltip (GimpScaleButton *button) { GtkAdjustment *adj; gchar *text; + gdouble value; + gdouble lower; + gdouble upper; 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 */ text = g_strdup_printf ("%d\342\200\211%%", - (gint) (0.5 + ((adj->value - adj->lower) * 100.0 / - (adj->upper - adj->lower)))); + (gint) (0.5 + ((value - lower) * 100.0 / + (upper - lower)))); gtk_widget_set_tooltip_text (GTK_WIDGET (button), text); g_free (text);