[gimp] libgimpwidgets, plug-ins: continue GimpScaleEntry port to real widget.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets, plug-ins: continue GimpScaleEntry port to real widget.
- Date: Fri, 30 Oct 2020 22:48:03 +0000 (UTC)
commit 10dfaead68782432c0e79c750b6b0db5ab95fe75
Author: Jehan <jehan girinstud io>
Date: Fri Oct 30 21:30:16 2020 +0100
libgimpwidgets, plug-ins: continue GimpScaleEntry port to real widget.
I got rid of gimp_scale_entry_set_sensitive(), as we can now use the
generic gtk_widget_set_sensitive(), and I ported the 2 plug-ins using
this function.
I also created gimp_scale_entry_set_value() to set the value (nicer than
setting object properties).
libgimpwidgets/gimpscaleentry.c | 48 +++---
libgimpwidgets/gimpscaleentry.h | 7 +-
libgimpwidgets/gimpwidgets.def | 2 +-
plug-ins/file-jpeg/jpeg-save.c | 111 +++++++-------
.../fractal-explorer/fractal-explorer-dialogs.c | 162 ++++++++++-----------
plug-ins/fractal-explorer/fractal-explorer.h | 25 ++--
6 files changed, 163 insertions(+), 192 deletions(-)
---
diff --git a/libgimpwidgets/gimpscaleentry.c b/libgimpwidgets/gimpscaleentry.c
index 12b4c2bb86..5a8ab08814 100644
--- a/libgimpwidgets/gimpscaleentry.c
+++ b/libgimpwidgets/gimpscaleentry.c
@@ -664,6 +664,24 @@ gimp_scale_entry_new2 (const gchar *text,
return entry;
}
+/**
+ * gimp_scale_entry_set_value:
+ * @entry: The #GtkScaleEntry.
+ * @value: A new value.
+ *
+ * This function sets the value shown by @entry.
+ **/
+void
+gimp_scale_entry_set_value (GimpScaleEntry *entry,
+ gdouble value)
+{
+ g_return_if_fail (GIMP_IS_SCALE_ENTRY (entry));
+
+ g_object_set (entry,
+ "value", value,
+ NULL);
+}
+
/**
* gimp_scale_entry_get_value:
* @entry: The #GtkScaleEntry.
@@ -1052,33 +1070,3 @@ gimp_color_scale_entry_new (GtkGrid *grid,
TRUE, 0.0, 0.0,
tooltip, help_id);
}
-
-/**
- * gimp_scale_entry_set_sensitive:
- * @adjustment: a #GtkAdjustment returned by gimp_scale_entry_new()
- * @sensitive: a boolean value with the same semantics as the @sensitive
- * parameter of gtk_widget_set_sensitive()
- *
- * Sets the sensitivity of the scale_entry's #GtkLabel, #GtkHScale and
- * #GtkSpinButton.
- **/
-void
-gimp_scale_entry_set_sensitive (GtkAdjustment *adjustment,
- gboolean sensitive)
-{
- GtkWidget *widget;
-
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
-
- widget = GIMP_SCALE_ENTRY_LABEL (adjustment);
- if (widget)
- gtk_widget_set_sensitive (widget, sensitive);
-
- widget = GIMP_SCALE_ENTRY_SCALE (adjustment);
- if (widget)
- gtk_widget_set_sensitive (widget, sensitive);
-
- widget = GIMP_SCALE_ENTRY_SPINBUTTON (adjustment);
- if (widget)
- gtk_widget_set_sensitive (widget, sensitive);
-}
diff --git a/libgimpwidgets/gimpscaleentry.h b/libgimpwidgets/gimpscaleentry.h
index e95dc68ad7..38510e1671 100644
--- a/libgimpwidgets/gimpscaleentry.h
+++ b/libgimpwidgets/gimpscaleentry.h
@@ -70,6 +70,8 @@ GtkWidget * gimp_scale_entry_new2 (const gchar *text,
gdouble upper,
guint digits);
+void gimp_scale_entry_set_value (GimpScaleEntry *entry,
+ gdouble value);
gdouble gimp_scale_entry_get_value (GimpScaleEntry *entry);
GtkWidget * gimp_scale_entry_get_label (GimpScaleEntry *entry);
@@ -170,11 +172,6 @@ GtkAdjustment * gimp_color_scale_entry_new (GtkGrid *grid,
const gchar *tooltip,
const gchar *help_id);
-void gimp_scale_entry_set_sensitive (GtkAdjustment *adjustment,
- gboolean sensitive);
-
-
-
G_END_DECLS
diff --git a/libgimpwidgets/gimpwidgets.def b/libgimpwidgets/gimpwidgets.def
index 160b0b293b..328b94df2b 100644
--- a/libgimpwidgets/gimpwidgets.def
+++ b/libgimpwidgets/gimpwidgets.def
@@ -374,7 +374,7 @@ EXPORTS
gimp_scale_entry_set_increments
gimp_scale_entry_set_logarithmic
gimp_scale_entry_set_range
- gimp_scale_entry_set_sensitive
+ gimp_scale_entry_set_value
gimp_scroll_adjustment_values
gimp_scrolled_preview_freeze
gimp_scrolled_preview_get_adjustments
diff --git a/plug-ins/file-jpeg/jpeg-save.c b/plug-ins/file-jpeg/jpeg-save.c
index d9ce9d0664..52c840055f 100644
--- a/plug-ins/file-jpeg/jpeg-save.c
+++ b/plug-ins/file-jpeg/jpeg-save.c
@@ -50,8 +50,6 @@ static gboolean arithc_supported = TRUE;
static gboolean arithc_supported = FALSE;
#endif
-#define SCALE_WIDTH 125
-
/* See bugs #63610 and #61088 for a discussion about the quality settings */
#define DEFAULT_IJG_QUALITY 90.0
#define DEFAULT_SMOOTHING 0.0
@@ -100,8 +98,8 @@ typedef struct
GtkAdjustment *scale_data; /*for restart markers*/
gulong handler_id_restart;
- GtkAdjustment *quality; /*quality slidebar*/
- GtkAdjustment *smoothing; /*smoothing slidebar*/
+ GtkWidget *quality; /*quality slidebar*/
+ GtkWidget *smoothing; /*smoothing slidebar*/
GtkWidget *optimize; /*optimize toggle*/
GtkWidget *arithmetic_coding; /*arithmetic coding toggle*/
GtkWidget *progressive; /*progressive toggle*/
@@ -119,18 +117,20 @@ typedef struct
static void make_preview (void);
-static void save_restart_update (GtkAdjustment *adjustment,
- GtkWidget *toggle);
-static void subsampling_changed (GtkWidget *combo,
- GtkAdjustment *entry);
-static void quality_changed (GtkAdjustment *scale_entry,
- GtkWidget *toggle);
-static void subsampling_changed2 (GtkWidget *combo,
- GtkWidget *toggle);
-static void use_orig_qual_changed (GtkWidget *toggle,
- GtkAdjustment *scale_entry);
-static void use_orig_qual_changed2 (GtkWidget *toggle,
- GtkWidget *combo);
+static void scale_entry_update (GimpScaleEntry *entry,
+ gdouble *value);
+static void save_restart_update (GtkAdjustment *adjustment,
+ GtkWidget *toggle);
+static void subsampling_changed (GtkWidget *combo,
+ GtkWidget *entry);
+static void quality_changed (GimpScaleEntry *scale_entry,
+ GtkWidget *toggle);
+static void subsampling_changed2 (GtkWidget *combo,
+ GtkWidget *toggle);
+static void use_orig_qual_changed (GtkWidget *toggle,
+ GimpScaleEntry *scale_entry);
+static void use_orig_qual_changed2 (GtkWidget *toggle,
+ GtkWidget *combo);
static GtkWidget *restart_markers_scale = NULL;
@@ -815,9 +815,7 @@ save_dialog (GimpDrawable *drawable)
GtkWidget *dialog;
GtkWidget *vbox;
GtkWidget *vbox2;
- GtkAdjustment *entry;
GtkWidget *grid;
- GtkWidget *grid2;
GtkWidget *griddefaults;
GtkWidget *expander;
GtkWidget *frame;
@@ -853,25 +851,17 @@ save_dialog (GimpDrawable *drawable)
gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
gtk_widget_show (vbox2);
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
- gtk_box_pack_start (GTK_BOX (vbox2), grid, FALSE, FALSE, 0);
- gtk_widget_show (grid);
-
- pg.quality = entry = gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("_Quality:"),
- SCALE_WIDTH, 0, jsvals.quality,
- 0.0, 100.0, 1.0, 10.0, 0,
- TRUE, 0.0, 0.0,
- _("JPEG quality parameter"),
- "file-jpeg-save-quality");
+ pg.quality = gimp_scale_entry_new2 (_("_Quality:"), jsvals.quality, 0.0, 100.0, 0);
+ gimp_help_set_help_data (pg.quality, _("JPEG quality parameter"), "file-jpeg-save-quality");
- g_signal_connect (entry, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ g_signal_connect (pg.quality, "value-changed",
+ G_CALLBACK (scale_entry_update),
&jsvals.quality);
- g_signal_connect (entry, "value-changed",
+ g_signal_connect (pg.quality, "value-changed",
G_CALLBACK (make_preview),
NULL);
+ gtk_box_pack_start (GTK_BOX (vbox2), pg.quality, FALSE, FALSE, 0);
+ gtk_widget_show (pg.quality);
/* custom quantization tables - now used also for original quality */
pg.use_orig_quality = toggle =
@@ -1060,24 +1050,16 @@ save_dialog (GimpDrawable *drawable)
gtk_container_add (GTK_CONTAINER (frame), grid);
gtk_widget_show (grid);
- grid2 = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid2), 6);
- gtk_grid_attach (GTK_GRID (grid), grid2, 2, 0, 4, 1);
- gtk_widget_show (grid2);
-
- pg.smoothing = entry = gimp_scale_entry_new (GTK_GRID (grid2), 0, 0,
- _("S_moothing:"),
- 100, 0, jsvals.smoothing,
- 0.0, 1.0, 0.01, 0.1, 2,
- TRUE, 0.0, 0.0,
- NULL,
- "file-jpeg-save-smoothing");
- g_signal_connect (entry, "value-changed",
- G_CALLBACK (gimp_double_adjustment_update),
+ pg.smoothing = gimp_scale_entry_new2 (_("S_moothing:"), jsvals.smoothing, 0.0, 1.0, 2);
+ gimp_help_set_help_data (pg.smoothing, NULL, "file-jpeg-save-smoothing");
+ g_signal_connect (pg.smoothing, "value-changed",
+ G_CALLBACK (scale_entry_update),
&jsvals.smoothing);
- g_signal_connect (entry, "value-changed",
+ g_signal_connect (pg.smoothing, "value-changed",
G_CALLBACK (make_preview),
NULL);
+ gtk_grid_attach (GTK_GRID (grid), pg.smoothing, 2, 0, 4, 1);
+ gtk_widget_show (pg.smoothing);
restart_markers_label = gtk_label_new (_("Interval (MCU rows):"));
gtk_label_set_xalign (GTK_LABEL (restart_markers_label), 1.0);
@@ -1201,7 +1183,7 @@ save_dialog (GimpDrawable *drawable)
gimp_int_combo_box_connect (GIMP_INT_COMBO_BOX (combo),
jsvals.subsmp,
G_CALLBACK (subsampling_changed),
- entry, NULL);
+ pg.smoothing, NULL);
g_signal_connect (pg.subsmp, "changed",
G_CALLBACK (subsampling_changed2),
pg.use_orig_quality);
@@ -1439,12 +1421,12 @@ load_gui_defaults (JpegSaveGui *pg)
gtk_adjustment_set_value (restart_markers, jsvals.restart);
g_signal_handler_unblock (pg->use_restart_markers, pg->handler_id_restart);
- gtk_adjustment_set_value (pg->smoothing, jsvals.smoothing);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (pg->smoothing), jsvals.smoothing);
/* Don't override quality and subsampling setting if we already set it from original */
if (!jsvals.use_orig_quality)
{
- gtk_adjustment_set_value (pg->quality, jsvals.quality);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (pg->quality), jsvals.quality);
if (gimp_drawable_is_rgb (drawable_global))
{
@@ -1457,6 +1439,13 @@ load_gui_defaults (JpegSaveGui *pg)
jsvals.dct);
}
+static void
+scale_entry_update (GimpScaleEntry *entry,
+ gdouble *value)
+{
+ *value = gimp_scale_entry_get_value (entry);
+}
+
static void
save_restart_update (GtkAdjustment *adjustment,
GtkWidget *toggle)
@@ -1473,8 +1462,8 @@ save_restart_update (GtkAdjustment *adjustment,
}
static void
-subsampling_changed (GtkWidget *combo,
- GtkAdjustment *entry)
+subsampling_changed (GtkWidget *combo,
+ GtkWidget *entry)
{
gint value;
@@ -1483,16 +1472,16 @@ subsampling_changed (GtkWidget *combo,
jsvals.subsmp = value;
/* smoothing is not supported with nonstandard sampling ratios */
- gimp_scale_entry_set_sensitive ((gpointer) entry,
- jsvals.subsmp != JPEG_SUBSAMPLING_2x1_1x1_1x1 &&
- jsvals.subsmp != JPEG_SUBSAMPLING_1x2_1x1_1x1);
+ gtk_widget_set_sensitive (entry,
+ jsvals.subsmp != JPEG_SUBSAMPLING_2x1_1x1_1x1 &&
+ jsvals.subsmp != JPEG_SUBSAMPLING_1x2_1x1_1x1);
make_preview ();
}
static void
-quality_changed (GtkAdjustment *scale_entry,
- GtkWidget *toggle)
+quality_changed (GimpScaleEntry *scale_entry,
+ GtkWidget *toggle)
{
if (jsvals.use_orig_quality)
{
@@ -1511,13 +1500,13 @@ subsampling_changed2 (GtkWidget *combo,
}
static void
-use_orig_qual_changed (GtkWidget *toggle,
- GtkAdjustment *scale_entry)
+use_orig_qual_changed (GtkWidget *toggle,
+ GimpScaleEntry *scale_entry)
{
if (jsvals.use_orig_quality && orig_quality > 0)
{
g_signal_handlers_block_by_func (scale_entry, quality_changed, toggle);
- gtk_adjustment_set_value (scale_entry, orig_quality);
+ gimp_scale_entry_set_value (scale_entry, orig_quality);
g_signal_handlers_unblock_by_func (scale_entry, quality_changed, toggle);
}
}
diff --git a/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
b/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
index 6860e5b566..e92a48830c 100644
--- a/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
+++ b/plug-ins/fractal-explorer/fractal-explorer-dialogs.c
@@ -261,18 +261,18 @@ explorer_radio_update (GtkWidget *widget,
break;
}
- gimp_scale_entry_set_sensitive (elements->cx, c_sensitive);
- gimp_scale_entry_set_sensitive (elements->cy, c_sensitive);
+ gtk_widget_set_sensitive (elements->cx, c_sensitive);
+ gtk_widget_set_sensitive (elements->cy, c_sensitive);
set_cmap_preview ();
dialog_update_preview ();
}
static void
-explorer_double_adjustment_update (GtkAdjustment *adjustment,
- gpointer data)
+explorer_double_adjustment_update (GimpScaleEntry *entry,
+ gdouble *value)
{
- gimp_double_adjustment_update (adjustment, data);
+ *value = gimp_scale_entry_get_value (entry);
set_cmap_preview ();
dialog_update_preview ();
@@ -510,6 +510,7 @@ explorer_dialog (void)
GtkWidget *top_hbox;
GtkWidget *left_vbox;
GtkWidget *vbox;
+ GtkWidget *vbox2;
GtkWidget *bbox;
GtkWidget *frame;
GtkWidget *toggle;
@@ -722,83 +723,84 @@ explorer_dialog (void)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
- gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
- gtk_container_add (GTK_CONTAINER (frame), grid);
- gtk_widget_show (grid);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_container_add (GTK_CONTAINER (frame), vbox2);
+ gtk_widget_show (vbox2);
elements->xmin =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Left:"), SCALE_WIDTH, 10,
- wvals.xmin, -3, 3, 0.001, 0.01, 5,
- TRUE, 0, 0, NULL, NULL);
+ gimp_scale_entry_new2 (_("Left:"), wvals.xmin, -3, 3, 5);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (elements->xmin), 0.001, 0.01);
g_signal_connect (elements->xmin, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.xmin);
+ gtk_box_pack_start (GTK_BOX (vbox2), elements->xmin, TRUE, TRUE, 2);
+ gtk_widget_show (elements->xmin);
elements->xmax =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 1,
- _("Right:"), SCALE_WIDTH, 10,
- wvals.xmax, -3, 3, 0.001, 0.01, 5,
- TRUE, 0, 0, NULL, NULL);
+ gimp_scale_entry_new2 (_("Right:"), wvals.xmax, -3, 3, 5);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (elements->xmax), 0.001, 0.01);
g_signal_connect (elements->xmax, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.xmax);
+ gtk_box_pack_start (GTK_BOX (vbox2), elements->xmax, TRUE, TRUE, 2);
+ gtk_widget_show (elements->xmax);
elements->ymin =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 2,
- _("Top:"), SCALE_WIDTH, 10,
- wvals.ymin, -3, 3, 0.001, 0.01, 5,
- TRUE, 0, 0, NULL, NULL);
+ gimp_scale_entry_new2 (_("Top:"), wvals.ymin, -3, 3, 5);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (elements->ymin), 0.001, 0.01);
g_signal_connect (elements->ymin, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.ymin);
+ gtk_box_pack_start (GTK_BOX (vbox2), elements->ymin, TRUE, TRUE, 2);
+ gtk_widget_show (elements->ymin);
elements->ymax =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 3,
- _("Bottom:"), SCALE_WIDTH, 10,
- wvals.ymax, -3, 3, 0.001, 0.01, 5,
- TRUE, 0, 0, NULL, NULL);
+ gimp_scale_entry_new2 (_("Bottom:"), wvals.ymax, -3, 3, 5);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (elements->ymax), 0.001, 0.01);
g_signal_connect (elements->ymax, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.ymax);
+ gtk_box_pack_start (GTK_BOX (vbox2), elements->ymax, TRUE, TRUE, 2);
+ gtk_widget_show (elements->ymax);
elements->iter =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 4,
- _("Iterations:"), SCALE_WIDTH, 10,
- wvals.iter, 1, 1000, 1, 10, 0,
- TRUE, 0, 0,
- _("The higher the number of iterations, "
- "the more details will be calculated"), NULL);
+ gimp_scale_entry_new2 (_("Iterations:"), wvals.iter, 1, 1000, 0);
+ gimp_help_set_help_data (elements->iter,
+ _("The higher the number of iterations, "
+ "the more details will be calculated"),
+ NULL);
g_signal_connect (elements->iter, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.iter);
+ gtk_box_pack_start (GTK_BOX (vbox2), elements->iter, TRUE, TRUE, 2);
+ gtk_widget_show (elements->iter);
elements->cx =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 5,
- _("CX:"), SCALE_WIDTH, 10,
- wvals.cx, -2.5, 2.5, 0.001, 0.01, 5,
- TRUE, 0, 0,
- _("Changes aspect of fractal"), NULL);
+ gimp_scale_entry_new2 (_("CX:"), wvals.cx, -2.5, 2.5, 5);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (elements->cx), 0.001, 0.01);
+ gimp_help_set_help_data (elements->cx,
+ _("Changes aspect of fractal"), NULL);
g_signal_connect (elements->cx, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.cx);
+ gtk_box_pack_start (GTK_BOX (vbox2), elements->cx, TRUE, TRUE, 2);
+ gtk_widget_show (elements->cx);
elements->cy =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 6,
- _("CY:"), SCALE_WIDTH, 10,
- wvals.cy, -2.5, 2.5, 0.001, 0.01, 5,
- TRUE, 0, 0,
- _("Changes aspect of fractal"), NULL);
+ gimp_scale_entry_new2 (_("CY:"), wvals.cy, -2.5, 2.5, 5);
+ gimp_scale_entry_set_increments (GIMP_SCALE_ENTRY (elements->cy), 0.001, 0.01);
+ gimp_help_set_help_data (elements->cy,
+ _("Changes aspect of fractal"), NULL);
g_signal_connect (elements->cy, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.cy);
+ gtk_box_pack_start (GTK_BOX (vbox2), elements->cy, TRUE, TRUE, 2);
+ gtk_widget_show (elements->cy);
bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_margin_top (bbox, 12);
gtk_box_set_homogeneous (GTK_BOX (bbox), TRUE);
- gtk_grid_attach (GTK_GRID (grid), bbox, 0, 7, 3, 1);
+ gtk_box_pack_start (GTK_BOX (vbox2), bbox, TRUE, TRUE, 2);
gtk_widget_show (bbox);
button = gtk_button_new_with_mnemonic (_("_Open"));
@@ -910,26 +912,23 @@ explorer_dialog (void)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
- gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ grid = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (frame), grid);
gtk_widget_show (grid);
elements->ncol =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Number of colors:"), SCALE_WIDTH, 0,
- wvals.ncolors, 2, MAXNCOLORS, 1, 10, 0,
- TRUE, 0, 0,
- _("Change the number of colors in the mapping"),
- NULL);
+ gimp_scale_entry_new2 (_("Number of colors:"), wvals.ncolors, 2, MAXNCOLORS, 0);
+ gimp_help_set_help_data (elements->ncol,
+ _("Change the number of colors in the mapping"),
+ NULL);
g_signal_connect (elements->ncol, "value-changed",
G_CALLBACK (explorer_number_of_colors_callback),
&wvals.ncolors);
+ gtk_box_pack_start (GTK_BOX (grid), elements->ncol, TRUE, TRUE, 2);
+ gtk_widget_show (elements->ncol);
elements->useloglog = toggle =
gtk_check_button_new_with_label (_("Use loglog smoothing"));
- gtk_grid_attach (GTK_GRID (grid), toggle, 0, 1, 3, 1);
g_signal_connect (toggle, "toggled",
G_CALLBACK (explorer_toggle_update),
&wvals.useloglog);
@@ -937,47 +936,46 @@ explorer_dialog (void)
gtk_widget_show (toggle);
gimp_help_set_help_data (toggle, _("Use log log smoothing to eliminate "
"\"banding\" in the result"), NULL);
+ gtk_box_pack_start (GTK_BOX (grid), elements->useloglog, TRUE, TRUE, 2);
/* Color Density frame */
frame = gimp_frame_new (_("Color Density"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
- grid = gtk_grid_new ();
- gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
- gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ grid = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (frame), grid);
gtk_widget_show (grid);
elements->red =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 0,
- _("Red:"), SCALE_WIDTH, 0,
- wvals.redstretch, 0, 1, 0.01, 0.1, 2,
- TRUE, 0, 0,
- _("Change the intensity of the red channel"), NULL);
+ gimp_scale_entry_new2 (_("Red:"), wvals.redstretch, 0, 1, 2);
+ gimp_help_set_help_data (elements->red,
+ _("Change the intensity of the red channel"), NULL);
g_signal_connect (elements->red, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.redstretch);
+ gtk_box_pack_start (GTK_BOX (grid), elements->red, TRUE, TRUE, 2);
+ gtk_widget_show (elements->red);
elements->green =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 1,
- _("Green:"), SCALE_WIDTH, 0,
- wvals.greenstretch, 0, 1, 0.01, 0.1, 2,
- TRUE, 0, 0,
- _("Change the intensity of the green channel"), NULL);
+ gimp_scale_entry_new2 (_("Green:"), wvals.greenstretch, 0, 1, 2);
+ gimp_help_set_help_data (elements->green,
+ _("Change the intensity of the green channel"), NULL);
g_signal_connect (elements->green, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.greenstretch);
+ gtk_box_pack_start (GTK_BOX (grid), elements->green, TRUE, TRUE, 2);
+ gtk_widget_show (elements->green);
elements->blue =
- gimp_scale_entry_new (GTK_GRID (grid), 0, 2,
- _("Blue:"), SCALE_WIDTH, 0,
- wvals.bluestretch, 0, 1, 0.01, 0.1, 2,
- TRUE, 0, 0,
- _("Change the intensity of the blue channel"), NULL);
+ gimp_scale_entry_new2 (_("Blue:"), wvals.bluestretch, 0, 1, 2);
+ gimp_help_set_help_data (elements->blue,
+ _("Change the intensity of the blue channel"), NULL);
g_signal_connect (elements->blue, "value-changed",
G_CALLBACK (explorer_double_adjustment_update),
&wvals.bluestretch);
+ gtk_box_pack_start (GTK_BOX (grid), elements->blue, TRUE, TRUE, 2);
+ gtk_widget_show (elements->blue);
/* Color Function frame */
frame = gimp_frame_new (_("Color Function"));
@@ -1443,17 +1441,17 @@ dialog_change_scale (void)
{
ready_now = FALSE;
- gtk_adjustment_set_value (elements->xmin, wvals.xmin);
- gtk_adjustment_set_value (elements->xmax, wvals.xmax);
- gtk_adjustment_set_value (elements->ymin, wvals.ymin);
- gtk_adjustment_set_value (elements->ymax, wvals.ymax);
- gtk_adjustment_set_value (elements->iter, wvals.iter);
- gtk_adjustment_set_value (elements->cx, wvals.cx);
- gtk_adjustment_set_value (elements->cy, wvals.cy);
-
- gtk_adjustment_set_value (elements->red, wvals.redstretch);
- gtk_adjustment_set_value (elements->green,wvals.greenstretch);
- gtk_adjustment_set_value (elements->blue, wvals.bluestretch);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->xmin), wvals.xmin);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->xmax), wvals.xmax);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->ymin), wvals.ymin);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->ymax), wvals.ymax);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->iter), wvals.iter);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->cx), wvals.cx);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->cy), wvals.cy);
+
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->red), wvals.redstretch);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->green), wvals.greenstretch);
+ gimp_scale_entry_set_value (GIMP_SCALE_ENTRY (elements->blue), wvals.bluestretch);
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (elements->type[wvals.fractaltype]), TRUE);
diff --git a/plug-ins/fractal-explorer/fractal-explorer.h b/plug-ins/fractal-explorer/fractal-explorer.h
index 254e5d264e..16b6a1f223 100644
--- a/plug-ins/fractal-explorer/fractal-explorer.h
+++ b/plug-ins/fractal-explorer/fractal-explorer.h
@@ -7,7 +7,6 @@
*********************************************************************/
#define PREVIEW_SIZE 256
-#define SCALE_WIDTH 200
#define ENTRY_WIDTH 60
#define MAX_LOAD_LINE 256
#define GR_WIDTH 325
@@ -101,20 +100,20 @@ typedef struct _DialogElements DialogElements;
struct _DialogElements
{
GtkWidget *type[NUM_TYPES];
- GtkAdjustment *xmin;
- GtkAdjustment *xmax;
- GtkAdjustment *ymin;
- GtkAdjustment *ymax;
- GtkAdjustment *iter;
- GtkAdjustment *cx;
- GtkAdjustment *cy;
-
- GtkAdjustment *ncol;
+ GtkWidget *xmin;
+ GtkWidget *xmax;
+ GtkWidget *ymin;
+ GtkWidget *ymax;
+ GtkWidget *iter;
+ GtkWidget *cx;
+ GtkWidget *cy;
+
+ GtkWidget *ncol;
GtkWidget *useloglog;
- GtkAdjustment *red;
- GtkAdjustment *green;
- GtkAdjustment *blue;
+ GtkWidget *red;
+ GtkWidget *green;
+ GtkWidget *blue;
GtkWidget *redmode[3];
GtkWidget *redinvert;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]