app: add gimp_prop_range_set_ui_limits()

... which sets the limits of the range-widget's handle-bar
explicitly, instead of using the lower/upper properties' limits.
This commit is contained in:
Ell 2020-06-02 18:30:07 +03:00
parent fa5dd99559
commit ce8235e977
2 changed files with 19 additions and 0 deletions

View File

@ -1034,6 +1034,8 @@ gimp_prop_range_new (GObject *config,
gimp_handle_bar_connect_events (GIMP_HANDLE_BAR (handle_bar), color_bar);
g_object_set_data (G_OBJECT (vbox), "gimp-range-handle-bar", handle_bar);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
@ -1064,6 +1066,20 @@ gimp_prop_range_new (GObject *config,
return vbox;
}
void
gimp_prop_range_set_ui_limits (GtkWidget *widget,
gdouble lower,
gdouble upper)
{
GimpHandleBar *handle_bar;
g_return_if_fail (GTK_IS_WIDGET (widget));
handle_bar = g_object_get_data (G_OBJECT (widget), "gimp-range-handle-bar");
gimp_handle_bar_set_limits (handle_bar, lower, upper);
}
/**********/
/* view */

View File

@ -88,6 +88,9 @@ GtkWidget * gimp_prop_range_new (GObject *config,
gdouble page_increment,
gint digits,
gboolean sorted);
void gimp_prop_range_set_ui_limits (GtkWidget *widget,
gdouble lower,
gdouble upper);
/* GParamObject (GimpViewable) */