Permalink
Browse files

Merge pull request #1 from amalon/master

Circular Scroll: Fix scale of speed slider
  • Loading branch information...
2 parents 1df70f2 + 5853fda commit a49c8932a29cbfd9499f4afcb3abbfb110a6b82f @mishaaq committed Mar 7, 2012
Showing with 12 additions and 9 deletions.
  1. +6 −3 kcmtouchpad.cpp
  2. +6 −6 kcmtouchpadwidget.ui
View
@@ -48,6 +48,9 @@
K_PLUGIN_FACTORY(TouchpadConfigFactory, registerPlugin<TouchpadConfig>("touchpad");)
K_EXPORT_PLUGIN(TouchpadConfigFactory("kcmtouchpad"))
+// The slider is in degrees, but config and touchpad is in radians
+static const double ScrollCircularScale = 180.0/M_PI;
+
TouchpadConfig::TouchpadConfig(QWidget *parent, const QVariantList &)
: KCModule(TouchpadConfigFactory::componentData(), parent),
setup_failed(false)
@@ -229,7 +232,7 @@ void TouchpadConfig::load()
ui->ScrollCircularEnableCB->setCheckState(config.readEntry("CircularScrolling", (int)*(char*)Touchpad::get_parameter("CircularScrolling")) ? Qt::Checked : Qt::Unchecked);
}
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST)) {
- ui->ScrollCircularSpeedS->setValue(config.readEntry("CircScrollDelta", *(double*)Touchpad::get_parameter("CircScrollDelta")));
+ ui->ScrollCircularSpeedS->setValue(ScrollCircularScale*config.readEntry("CircScrollDelta", *(double*)Touchpad::get_parameter("CircScrollDelta")));
}
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER)) {
ui->ScrollCircularCornersCBB->setCurrentIndex(config.readEntry("CircScrollTrigger", (int)*(char*)Touchpad::get_parameter("CircScrollTrigger")));
@@ -309,7 +312,7 @@ void TouchpadConfig::save()
config.writeEntry("CircularScrolling", (int)ui->ScrollCircularEnableCB->isChecked());
}
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST)) {
- config.writeEntry("CircScrollDelta", (double)ui->ScrollCircularSpeedS->value());
+ config.writeEntry("CircScrollDelta", (double)ui->ScrollCircularSpeedS->value() / ScrollCircularScale);
}
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER)) {
config.writeEntry("CircScrollTrigger", ui->ScrollCircularCornersCBB->currentIndex());
@@ -453,7 +456,7 @@ bool TouchpadConfig::apply()
Touchpad::set_parameter("CircularScrolling", ui->ScrollCircularEnableCB->isChecked());
}
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST)) {
- Touchpad::set_parameter("CircScrollDelta", ui->ScrollCircularSpeedS->value());
+ Touchpad::set_parameter("CircScrollDelta", (double)ui->ScrollCircularSpeedS->value() / ScrollCircularScale);
}
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER)) {
Touchpad::set_parameter("CircScrollTrigger", ui->ScrollCircularCornersCBB->currentIndex());
View
@@ -796,19 +796,19 @@
<string>Move angle (radians) of finger to generate a scroll event.</string>
</property>
<property name="minimum">
- <number>30</number>
+ <number>1</number>
</property>
<property name="maximum">
- <number>300</number>
+ <number>60</number>
</property>
<property name="singleStep">
- <number>30</number>
+ <number>1</number>
</property>
<property name="pageStep">
- <number>60</number>
+ <number>10</number>
</property>
<property name="value">
- <number>300</number>
+ <number>10</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -823,7 +823,7 @@
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
- <number>30</number>
+ <number>10</number>
</property>
</widget>
</item>

0 comments on commit a49c893

Please sign in to comment.