[kde-doc-english] playground/utils/synaptiks

Sebastian Wiesner basti.wiesner at gmx.net
Thu Mar 4 21:04:28 CET 2010


SVN commit 1098967 by swiesner:

GUI: Reworked coasting configuration user interface
Added new Coasting setting to generally disable or enable coasting

 M  +20 -6     daemon/synaptiksdaemon.cpp  
 M  +46 -14    kcmodule/ui/scrollingpage.ui  
 M  +6 -2      synaptiks.kcfg  


--- trunk/playground/utils/synaptiks/daemon/synaptiksdaemon.cpp #1098966:1098967
@@ -232,13 +232,27 @@
         d->config->switchOffIfMouseIsPlugged());
 
     // apply scrolling configuration
-    foreach (KConfigSkeletonItem *item, d->config->items()) {
-        if (item->group() == "Scrolling") {
-            QString property = item->name();
-            property[0] = property.at(0).toLower();
-            this->setTouchpadProperty(property.toAscii(), item->property());
-        }
+    // handle all simple items first
+    QList<QString> names;
+    names << "CircularScrolling" << "CircularScrollingTrigger"
+          << "HorizontalEdgeScrolling" << "VerticalEdgeScrolling";
+    foreach (const QString &name, names) {
+        KConfigSkeletonItem *item = d->config->findItem(name);
+        Q_ASSERT(item);
+        QString property = name;
+        property[0] = property.at(0).toLower();
+        this->setTouchpadProperty(property.toAscii(), item->property());
     }
+    // coasting configuration
+    if (d->config->coasting()) {
+        this->setTouchpadProperty(
+            "cornerCoasting", d->config->cornerCoasting());
+        this->setTouchpadProperty(
+            "coastingSpeed", d->config->coastingSpeed());
+    } else {
+        this->setTouchpadProperty("coastingSpeed", 0.0);
+    }
+
     // apply tapping configuration
     QByteArray buttons;
     for (int i=0; i < 4; i++) {
--- trunk/playground/utils/synaptiks/kcmodule/ui/scrollingpage.ui #1098966:1098967
@@ -110,18 +110,20 @@
     </widget>
    </item>
    <item>
-    <widget class="QGroupBox" name="groupBox_2">
+    <widget class="QGroupBox" name="kcfg_Coasting">
      <property name="title">
-      <string comment="@title:group">Coasting</string>
+      <string comment="@option:check">Continue edge scrolling automatically</string>
      </property>
+     <property name="checkable">
+      <bool>true</bool>
+     </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
-       <widget class="QLabel" name="label_2">
+       <widget class="QRadioButton" name="conventionalCoasting">
         <property name="text">
-         <string comment="@info">&lt;para&gt;Edge scrolling can continue in the current speed, if you release the finger from the touchpad and the scrolling speed is greater then the configured threshold (&lt;emphasis&gt;conventional coasting&lt;/emphasis&gt;).  Alternatively it can continue, if your finger stays in an edge corner (&lt;emphasis&gt;corner coasting&lt;/emphasis&gt;).&lt;/para&gt;
-</string>
+         <string>Continue edge scrolling, if the finger is lifted while scrolling</string>
         </property>
-        <property name="wordWrap">
+        <property name="checked">
          <bool>true</bool>
         </property>
        </widget>
@@ -140,8 +142,8 @@
         </item>
         <item row="0" column="1">
          <widget class="QDoubleSpinBox" name="kcfg_CoastingSpeed">
-          <property name="specialValueText">
-           <string comment="@item:inrange special value for coasting speed ">Coasting completely disabled</string>
+          <property name="minimum">
+           <double>0.010000000000000</double>
           </property>
           <property name="singleStep">
            <double>0.100000000000000</double>
@@ -151,12 +153,9 @@
        </layout>
       </item>
       <item>
-       <widget class="QCheckBox" name="kcfg_CornerCoasting">
-        <property name="enabled">
-         <bool>false</bool>
-        </property>
+       <widget class="QRadioButton" name="kcfg_CornerCoasting">
         <property name="text">
-         <string comment="@option:check">Continue edge scrolling, if the finger stays in an edge corner.</string>
+         <string comment="@option:radio">Continue edge scrolling, if the finger stays in an edge corner</string>
         </property>
        </widget>
       </item>
@@ -186,5 +185,38 @@
   </customwidget>
  </customwidgets>
  <resources/>
- <connections/>
+ <connections>
+  <connection>
+   <sender>conventionalCoasting</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>coastingSpeedLabel</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>73</x>
+     <y>273</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>78</x>
+     <y>296</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>conventionalCoasting</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>kcfg_CoastingSpeed</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>146</x>
+     <y>269</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>338</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
 </ui>
--- trunk/playground/utils/synaptiks/synaptiks.kcfg #1098966:1098967
@@ -74,15 +74,19 @@
       <label>Enable vertical scrolling at the right edge</label>
       <default>true</default>
     </entry>
+    <entry name="Coasting" type="Bool">
+      <label>Continue edge scrolling automatically.</label>
+      <default>true</default>
+    </entry>
     <entry name="CornerCoasting" type="Bool">
       <label>Continue edge scrolling while the finger stays in an edge
-corner.  CoastingSpeed must be greater than 0, otherwise coasting will be
-disabled completely regardless of this setting.</label>
+corner.  Coasting must be enabled.</label>
       <default>true</default>
     </entry>
     <entry name="CoastingSpeed" type="Double">
       <label>Set threshold speed for conventional coasting.</label>
       <default>3.0</default>
+      <min>0.01</min>
     </entry>
   </group>
   <group name="Tapping">



More information about the kde-doc-english mailing list