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

Sebastian Wiesner basti.wiesner at gmx.net
Wed Mar 10 14:37:03 CET 2010


SVN commit 1101652 by swiesner:

FEATURE: Added setting to always enable edge motion
GUI: Added checkbox for this setting to motion page
Added edgeMotionAlways property to Touchpad

 M  +6 -0      daemon/org.kde.Touchpad.xml  
 M  +1 -0      daemon/synaptiksdaemon.cpp  
 M  +11 -0     daemon/touchpad.cpp  
 M  +32 -0     daemon/touchpad.h  
 M  +8 -0      daemon/touchpadadaptor.cpp  
 M  +3 -0      daemon/touchpadadaptor.h  
 M  +31 -2     kcmodule/ui/motionpage.ui  
 M  +5 -0      synaptiks.kcfg  


--- trunk/playground/utils/synaptiks/daemon/org.kde.Touchpad.xml #1101651:1101652
@@ -28,6 +28,12 @@
     <method name="setAccelerationFactor">
       <arg name="accel" type="d" direction="in"/>
     </method>
+    <method name="edgeMotionAlways">
+      <arg type="b" direction="out"/>
+    </method>
+    <method name="setEdgeMotionAlways">
+      <arg name="enabled" type="b" direction="in"/>
+    </method>
     <method name="circularScrolling">
       <arg type="b" direction="out"/>
     </method>
--- trunk/playground/utils/synaptiks/daemon/synaptiksdaemon.cpp #1101651:1101652
@@ -240,6 +240,7 @@
         << "CircularTouchpad"
         // motion configuration
         << "MinimumSpeed" << "MaximumSpeed" << "AccelerationFactor"
+        << "EdgeMotionAlways"
         // scrolling configuration
         << "CircularScrolling" << "CircularScrollingTrigger"
         << "HorizontalTwoFingerScrolling" << "VerticalTwoFingerScrolling"
--- trunk/playground/utils/synaptiks/daemon/touchpad.cpp #1101651:1101652
@@ -37,6 +37,7 @@
 
 static const char OFF[] = "Synaptics Off";
 static const char MOVE_SPEED[] = "Synaptics Move Speed";
+static const char EDGE_MOTION_ALWAYS[] = "Synaptics Edge Motion Always";
 static const char CIRCULAR_SCROLLING[] = "Synaptics Circular Scrolling";
 static const char CIRCULAR_SCROLLING_TRIGGER[] =
     "Synaptics Circular Scrolling Trigger";
@@ -162,6 +163,16 @@
     d->device->setProperty(MOVE_SPEED, accel, AccelerationItem);
 }
 
+bool Touchpad::edgeMotionAlways() const {
+    Q_D(const Touchpad);
+    return d->device->property<bool>(EDGE_MOTION_ALWAYS, 0);
+}
+
+void Touchpad::setEdgeMotionAlways(bool enabled) {
+    Q_D(Touchpad);
+    d->device->setProperty(EDGE_MOTION_ALWAYS, enabled);
+}
+
 bool Touchpad::circularScrolling() const {
     Q_D(const Touchpad);
     return d->device->property<bool>(CIRCULAR_SCROLLING, 0);
--- trunk/playground/utils/synaptiks/daemon/touchpad.h #1101651:1101652
@@ -169,6 +169,20 @@
                    WRITE setAccelerationFactor DESIGNABLE false)
 
         /**
+         * @brief Use edge motion always.
+         *
+         * Cursor movement continues, if the finger hits the touchpad edge.
+         * This feature is called "edge motion".  By default, it is only
+         * active when dragging.  If this property is set to @c true, edge
+         * motion is always active, even for normal movement.
+         *
+         * @sa setEdgeMotionAlways(bool)
+         * @sa edgeMotionAlways()
+         */
+        Q_PROPERTY(bool edgeMotionAlways READ edgeMotionAlways
+                   WRITE setEdgeMotionAlways DESIGNABLE false)
+
+        /**
          * @brief Whether circular scrolling is enabled or not.
          *
          * If circular scrolling is enabled, the user can scroll by moving
@@ -671,6 +685,24 @@
         Q_SCRIPTABLE void setAccelerationFactor(float accel);
 
         /**
+         * @brief Is edge motion always active, or only when dragging?
+         *
+         * @return @c true, if edge motion is always active, or @c false, if
+         *         it is only active when dragging.
+         * @sa edgeMotionAlways
+         */
+        Q_SCRIPTABLE bool edgeMotionAlways() const;
+
+        /**
+         * @brief Enable edge motion for all movements.
+         *
+         * @param enabled if @c true, edge motion will always be active, if
+         *        @c false, edge motion is only used when dragging
+         * @sa edgeMotionAlways
+         */
+        Q_SCRIPTABLE void setEdgeMotionAlways(bool enabled);
+
+        /**
          * @brief Is circular scrolling enabled?
          *
          * @return @c true, if circular scrolling is enabled, @c false
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.cpp #1101651:1101652
@@ -80,6 +80,14 @@
     this->setPropertyOrDBusError("accelerationFactor", accel);
 }
 
+bool TouchpadAdaptor::edgeMotionAlways() const {
+    return this->propertyOrDBusError("edgeMotionAlways").toBool();
+}
+
+void TouchpadAdaptor::setEdgeMotionAlways(bool enabled) {
+    this->setPropertyOrDBusError("edgeMotionAlways", enabled);
+}
+
 bool TouchpadAdaptor::circularScrolling() const {
     return this->propertyOrDBusError("circularScrolling").toBool();
 }
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.h #1101651:1101652
@@ -65,6 +65,9 @@
         double accelerationFactor() const;
         void setAccelerationFactor(double accel);
 
+        bool edgeMotionAlways() const;
+        void setEdgeMotionAlways(bool enabled);
+
         bool circularScrolling() const;
         void setCircularScrolling(bool enabled);
 
--- trunk/playground/utils/synaptiks/kcmodule/ui/motionpage.ui #1101651:1101652
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
-    <height>300</height>
+    <width>388</width>
+    <height>304</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -77,6 +77,35 @@
      </layout>
     </widget>
    </item>
+   <item>
+    <widget class="QGroupBox" name="edgeMotionGroup">
+     <property name="title">
+      <string comment="@title:group">Continue cursor motion when hitting the touchpad edge</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <item>
+       <widget class="QCheckBox" name="kcfg_EdgeMotionAlways">
+        <property name="text">
+         <string comment="@option:radio">For all movements, not only dragging</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <customwidgets>
--- trunk/playground/utils/synaptiks/synaptiks.kcfg #1101651:1101652
@@ -73,6 +73,11 @@
       <min>0</min>
       <max>1</max>
     </entry>
+    <entry name="EdgeMotionAlways" type="Bool">
+      <label>Enable edge motion for all movements, not only for
+drags</label>
+      <default>false</default>
+    </entry>
   </group>
   <group name="Scrolling">
     <entry name="CircularScrolling" type="Bool">



More information about the kde-doc-english mailing list