[gimp] app: add gimp_gtk_adjustment_chain()
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: add gimp_gtk_adjustment_chain()
- Date: Tue, 2 Jun 2020 20:30:08 +0000 (UTC)
commit 45e5c2231afb48376a1bbc37bed78ab41dad8afb
Author: Ell <ell_se yahoo com>
Date: Mon Jun 1 23:21:21 2020 +0300
app: add gimp_gtk_adjustment_chain()
... which takes a pair of GtkAdjustments, and binds the value of
the first to the lower-limit of the second, and the value of the
second to the upper-limit of the first.
app/widgets/gimpwidgets-utils.c | 15 +++++++++++++++
app/widgets/gimpwidgets-utils.h | 3 +++
2 files changed, 18 insertions(+)
---
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index b71f02ddab..937e938116 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -1576,6 +1576,21 @@ gimp_button_set_destructive (GtkWidget *button,
}
}
+void
+gimp_gtk_adjustment_chain (GtkAdjustment *adjustment1,
+ GtkAdjustment *adjustment2)
+{
+ g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment1));
+ g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment2));
+
+ g_object_bind_property (adjustment1, "value",
+ adjustment2, "lower",
+ G_BINDING_SYNC_CREATE);
+ g_object_bind_property (adjustment2, "value",
+ adjustment1, "upper",
+ G_BINDING_SYNC_CREATE);
+}
+
static gboolean
gimp_print_event_free (gpointer data)
{
diff --git a/app/widgets/gimpwidgets-utils.h b/app/widgets/gimpwidgets-utils.h
index f897eae5c2..0925dc431f 100644
--- a/app/widgets/gimpwidgets-utils.h
+++ b/app/widgets/gimpwidgets-utils.h
@@ -112,6 +112,9 @@ void gimp_button_set_destructive (GtkWidget *button
gboolean destructive,
GtkReliefStyle default_relief);
+void gimp_gtk_adjustment_chain (GtkAdjustment *adjustment1,
+ GtkAdjustment *adjustment2);
+
const gchar * gimp_print_event (const GdkEvent *event);
gboolean gimp_color_profile_store_add_defaults
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]