some more fiddling to simplify the API

svn path=/trunk/; revision=25811
This commit is contained in:
Sven Neumann 2008-05-26 16:41:34 +00:00
parent b059874979
commit 081a273f99
3 changed files with 16 additions and 15 deletions

View file

@ -366,8 +366,6 @@ gimp_prop_scale_button_new (GObject *config,
GParamSpec *param_spec;
GtkWidget *button;
gdouble value;
gdouble min;
gdouble max;
param_spec = check_param_spec_w (config, property_name,
G_TYPE_PARAM_DOUBLE, G_STRFUNC);
@ -379,12 +377,9 @@ gimp_prop_scale_button_new (GObject *config,
param_spec->name, &value,
NULL);
min = G_PARAM_SPEC_DOUBLE (param_spec)->minimum;
max = G_PARAM_SPEC_DOUBLE (param_spec)->maximum;
button = gimp_scale_button_new (min, max, (max - min) / 10.0);
gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), value);
button = gimp_scale_button_new (value,
G_PARAM_SPEC_DOUBLE (param_spec)->minimum,
G_PARAM_SPEC_DOUBLE (param_spec)->maximum);
set_param_spec (G_OBJECT (button), button, param_spec);

View file

@ -111,11 +111,17 @@ gimp_scale_button_image_expose (GtkWidget *widget,
}
GtkWidget *
gimp_scale_button_new (gdouble min,
gdouble max,
gdouble step)
gimp_scale_button_new (gdouble value,
gdouble min,
gdouble max)
{
GtkObject *adj = gtk_adjustment_new (min, min, max, step, step, 0);
GtkObject *adj;
gdouble step;
g_return_val_if_fail (value >= min && value <= max, NULL);
step = (max - min) / 10.0;
adj = gtk_adjustment_new (value, min, max, step, step, 0);
return g_object_new (GIMP_TYPE_SCALE_BUTTON,
"adjustment", adj,

View file

@ -46,9 +46,9 @@ struct _GimpScaleButtonClass
GType gimp_scale_button_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_scale_button_new (gdouble min,
gdouble max,
gdouble step);
GtkWidget * gimp_scale_button_new (gdouble value,
gdouble min,
gdouble max);
#endif /* __GIMP_SCALE_BUTTON_H__ */