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

Sebastian Wiesner basti.wiesner at gmx.net
Sat Mar 6 16:45:56 CET 2010


SVN commit 1100028 by swiesner:

FEATURE: Added setting to configure circular scrolling distance
GUI: Added configuration option for circular scrolling distance to scrolling page
Added circularScrollingDistance to Touchpad

 M  +6 -0      daemon/org.kde.Touchpad.xml  
 M  +3 -0      daemon/synaptiksdaemon.cpp  
 M  +12 -0     daemon/touchpad.cpp  
 M  +36 -0     daemon/touchpad.h  
 M  +9 -0      daemon/touchpadadaptor.cpp  
 M  +3 -0      daemon/touchpadadaptor.h  
 M  +83 -60    kcmodule/ui/scrollingpage.ui  
 M  +8 -0      synaptiks.kcfg  


--- trunk/playground/utils/synaptiks/daemon/org.kde.Touchpad.xml #1100027:1100028
@@ -22,6 +22,12 @@
     <method name="setCircularScrollingTrigger">
       <arg name="trigger" type="y" direction="in"/>
     </method>
+    <method name="circularScrollingDistance">
+      <arg type="d" direction="out"/>
+    </method>
+    <method name="setCircularScrollingDistance">
+      <arg name="angle" type="d" direction="in"/>
+    </method>
     <method name="horizontalTwoFingerScrolling">
       <arg type="b" direction="out"/>
     </method>
--- trunk/playground/utils/synaptiks/daemon/synaptiksdaemon.cpp #1100027:1100028
@@ -262,6 +262,9 @@
         // 0.0 for coasting speed disables coasting
         this->setTouchpadProperty("coastingSpeed", 0.0);
     }
+    // circular scrolling distance in degrees must be converted to radians
+    double radians = (d->config->circularScrollingDistance()*M_PI)/180.0;
+    this->setTouchpadProperty("circularScrollingDistance", radians);
     // corner and finger button settings composed from single items
     QByteArray buttons;
     for (int i=0; i < 4; i++) {
--- trunk/playground/utils/synaptiks/daemon/touchpad.cpp #1100027:1100028
@@ -39,6 +39,8 @@
 static const char CIRCULAR_SCROLLING[] = "Synaptics Circular Scrolling";
 static const char CIRCULAR_SCROLLING_TRIGGER[] =
     "Synaptics Circular Scrolling Trigger";
+static const char CIRCULAR_SCROLLING_DISTANCE[] =
+    "Synaptics Circular Scrolling Distance";
 static const char TWO_FINGER_SCROLLING[] = "Synaptics Two-Finger Scrolling";
 static const char EDGE_SCROLLING[] = "Synaptics Edge Scrolling";
 static const char COASTING_SPEED[] = "Synaptics Coasting Speed";
@@ -140,6 +142,16 @@
         d->device->property<uchar>(CIRCULAR_SCROLLING_TRIGGER, 0));
 }
 
+float Touchpad::circularScrollingDistance() const {
+    Q_D(const Touchpad);
+    return d->device->property<float>(CIRCULAR_SCROLLING_DISTANCE, 0);
+}
+
+void Touchpad::setCircularScrollingDistance(float angle) {
+    Q_D(Touchpad);
+    d->device->setProperty(CIRCULAR_SCROLLING_DISTANCE, angle);
+}
+
 bool Touchpad::horizontalTwoFingerScrolling() const {
     Q_D(const Touchpad);
     return d->device->property<bool>(
--- trunk/playground/utils/synaptiks/daemon/touchpad.h #1100027:1100028
@@ -148,6 +148,24 @@
                    READ circularScrollingTrigger
                    WRITE setCircularScrollingTrigger DESIGNABLE false)
 
+        /**
+         * @brief Move angle in radians of the finger to generate a
+         * scrolling event in circular scrolling mode.
+         *
+         * This property defines, by which angle the finger needs to move in
+         * circular scrolling mode for a scroll event to be generated.  The
+         * smaller this value is, the more scroll events are generated for a
+         * specific move angle of the finger and the faster circular
+         * scrolling gets.
+         *
+         * @sa setCircularScrollingDistance(float)
+         * @sa circularScrollingDistance()
+         */
+        Q_PROPERTY(float circularScrollingDistance
+                   READ circularScrollingDistance
+                   WRITE setCircularScrollingDistance
+                   DESIGNABLE false)
+
         /** @brief Whether horizontal scrolling with two fingres is enabled
          * or not.
          *
@@ -593,6 +611,24 @@
             CircularScrollingTrigger trigger);
 
         /**
+         * @brief Return the move angle of the finger to generate a scroll
+         * event in circular scrolling mode.
+         *
+         * @return the move angle in radians
+         * @sa circularScrollingDistance
+         */
+        Q_SCRIPTABLE float circularScrollingDistance() const;
+
+        /**
+         * @brief Set the move angle of the finger to generate a scroll
+         * event in circular scrolling mode.
+         *
+         * @param angle the move angle in radians
+         * @sa circularScrollingDistance
+         */
+        Q_SCRIPTABLE void setCircularScrollingDistance(float angle);
+
+        /**
          * @brief Is horizontal two-finger scrolling enabled?
          *
          * @return @c true, if horizontal two-finger scrolling is enabled,
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.cpp #1100027:1100028
@@ -81,6 +81,15 @@
     }
 }
 
+double TouchpadAdaptor::circularScrollingDistance() const {
+    return this->propertyOrDBusError(
+        "circularScrollingDistance").toDouble();
+}
+
+void TouchpadAdaptor::setCircularScrollingDistance(double angle) {
+    this->setPropertyOrDBusError("circularScrollingDistance", angle);
+}
+
 bool TouchpadAdaptor::horizontalTwoFingerScrolling() const {
     return this->propertyOrDBusError(
         "horizontalTwoFingerScrolling").toBool();
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.h #1100027:1100028
@@ -62,6 +62,9 @@
         uchar circularScrollingTrigger() const;
         void setCircularScrollingTrigger(uchar trigger);
 
+        double circularScrollingDistance() const;
+        void setCircularScrollingDistance(double angle);
+
         bool horizontalTwoFingerScrolling() const;
         void setHorizontalTwoFingerScrolling(bool enabled);
 
--- trunk/playground/utils/synaptiks/kcmodule/ui/scrollingpage.ui #1100027:1100028
@@ -8,7 +8,7 @@
     <x>0</x>
     <y>0</y>
     <width>478</width>
-    <height>368</height>
+    <height>445</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -114,69 +114,92 @@
      <property name="checkable">
       <bool>true</bool>
      </property>
-     <layout class="QFormLayout" name="formLayout">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::ExpandingFieldsGrow</enum>
-      </property>
-      <item row="0" column="0">
-       <widget class="QLabel" name="label">
-        <property name="text">
-         <string comment="@label:listbox">Area, which triggers circular scrolling</string>
+     <layout class="QVBoxLayout" name="verticalLayout_5">
+      <item>
+       <layout class="QFormLayout" name="formLayout">
+        <item row="0" column="0">
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string comment="@label:listbox">Area, which triggers circular scrolling</string>
+          </property>
+          <property name="buddy">
+           <cstring>kcfg_CircularScrollingTrigger</cstring>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="KComboBox" name="kcfg_CircularScrollingTrigger">
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Any edge</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Top edge</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Top right corner</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Right edge</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Bottom right corner</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Bottom edge</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Bottom left corner</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Left edge</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string comment="@item:inlistbox circular scrolling trigger area">Top left corner</string>
+           </property>
+          </item>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="KDoubleNumInput" name="kcfg_CircularScrollingDistance">
+        <property name="toolTip">
+         <string comment="@info:tooltip">Move the finger by this angle on the touchpad to scroll a single line.  The higher the angle, the slower circular scrolling becomes</string>
         </property>
-        <property name="buddy">
-         <cstring>kcfg_CircularScrollingTrigger</cstring>
+        <property name="whatsThis">
+         <string comment="@info:whatsthis">Move the finger by this angle on the touchpad to scroll a single line.  The higher the angle, the slower circular scrolling becomes</string>
         </property>
+        <property name="label">
+         <string comment="@label:spinbox">Angle by which to move the finger to scroll a single line</string>
+        </property>
+        <property name="maximum">
+         <double>360.000000000000000</double>
+        </property>
+        <property name="suffix">
+         <string comment="@label:spinbox"> °</string>
+        </property>
+        <property name="sliderEnabled">
+         <bool>true</bool>
+        </property>
        </widget>
       </item>
-      <item row="0" column="1">
-       <widget class="KComboBox" name="kcfg_CircularScrollingTrigger">
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Any edge</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Top edge</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Top right corner</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Right edge</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Bottom right corner</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Bottom edge</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Bottom left corner</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Left edge</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string comment="@item:inlistbox circular scrolling trigger area">Top left corner</string>
-         </property>
-        </item>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
--- trunk/playground/utils/synaptiks/synaptiks.kcfg #1100027:1100028
@@ -73,6 +73,14 @@
         <choice name="TopLeftCornerTrigger"/>
       </choices>
     </entry>
+    <entry name="CircularScrollingDistance" type="Double">
+      <label>The move angle of the finger (in degrees) to generate a scroll
+event in circular scrolling mode.  The greater the angle, the slower
+circular scrolling gets.</label>
+      <default>20</default>
+      <min>0.0</min>
+      <max>360.0</max>
+    </entry>
     <entry name="HorizontalTwoFingerScrolling" type="Bool">
       <label>Enable horizontal scrolling with two fingers</label>
       <default>true</default>



More information about the kde-doc-english mailing list