[gnome-control-center/wip/carlosg/wacom-pressure-steps] wacom: Snap tip/eraser pressure feel to the allowed values
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/carlosg/wacom-pressure-steps] wacom: Snap tip/eraser pressure feel to the allowed values
- Date: Wed, 24 Apr 2019 14:56:16 +0000 (UTC)
commit 79bc6cfc786dccfb0dcb871056f9c3ff2795632e
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Apr 24 16:46:41 2019 +0200
wacom: Snap tip/eraser pressure feel to the allowed values
And add markers for those. We only allow a total of 7 fixed pressure curve
values, so make the UI clear about it.
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/483
panels/wacom/cc-wacom-stylus-page.c | 12 ++++++++++++
panels/wacom/wacom-stylus-page.ui | 2 ++
2 files changed, 14 insertions(+)
---
diff --git a/panels/wacom/cc-wacom-stylus-page.c b/panels/wacom/cc-wacom-stylus-page.c
index 6eb57b14d..301cb27d9 100644
--- a/panels/wacom/cc-wacom-stylus-page.c
+++ b/panels/wacom/cc-wacom-stylus-page.c
@@ -262,6 +262,15 @@ cc_wacom_stylus_page_class_init (CcWacomStylusPageClass *klass)
object_class->dispose = cc_wacom_stylus_page_dispose;
}
+static void
+add_marks (GtkScale *scale)
+{
+ gint i;
+
+ for (i = 0; i < N_PRESSURE_CURVES; i++)
+ gtk_scale_add_mark (scale, i, GTK_POS_BOTTOM, NULL);
+}
+
static void
cc_wacom_stylus_page_init (CcWacomStylusPage *page)
{
@@ -293,6 +302,9 @@ cc_wacom_stylus_page_init (CcWacomStylusPage *page)
gtk_container_add (GTK_CONTAINER (page), box);
gtk_widget_set_vexpand (GTK_WIDGET (box), TRUE);
+ add_marks (GTK_SCALE (WID ("scale-tip-feel")));
+ add_marks (GTK_SCALE (WID ("scale-eraser-feel")));
+
g_signal_connect (WID ("scale-tip-feel"), "value-changed",
G_CALLBACK (tip_feel_value_changed_cb), page);
g_signal_connect (WID ("scale-eraser-feel"), "value-changed",
diff --git a/panels/wacom/wacom-stylus-page.ui b/panels/wacom/wacom-stylus-page.ui
index 6e2627bc4..133f3c8fb 100644
--- a/panels/wacom/wacom-stylus-page.ui
+++ b/panels/wacom/wacom-stylus-page.ui
@@ -196,6 +196,7 @@
<property name="adjustment">adjustment-eraser-feel</property>
<property name="digits">0</property>
<property name="draw_value">False</property>
+ <property name="round_digits">0</property>
</object>
<packing>
<property name="expand">True</property>
@@ -356,6 +357,7 @@
<property name="adjustment">adjustment-tip-feel</property>
<property name="digits">0</property>
<property name="draw_value">False</property>
+ <property name="round_digits">0</property>
</object>
<packing>
<property name="expand">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]