summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrell Anderson <[email protected]>2013-03-02 21:32:09 -0600
committerDarrell Anderson <[email protected]>2013-03-02 21:32:09 -0600
commit48e7fc5a76e0fedff4bbee92a801e84cb011eee3 (patch)
treeb2c229dd9002645d2019799a07ba99d84f27e741
parent0cb3dd415155adc58748ea5cc4da4679abcf320b (diff)
downloadtdebase-48e7fc5a76e0fedff4bbee92a801e84cb011eee3.tar.gz
tdebase-48e7fc5a76e0fedff4bbee92a801e84cb011eee3.zip
Add GUI control support to test kcontrol mouse double-click setting.
Work is needed to toggle the icon image after testing the double-click. This partially resolves bug report 1324.
-rw-r--r--kcontrol/input/mouse.cpp32
-rw-r--r--kcontrol/input/mouse.h5
-rw-r--r--kcontrol/input/pics/CMakeLists.txt2
-rw-r--r--kcontrol/input/pics/Makefile.am2
4 files changed, 34 insertions, 7 deletions
diff --git a/kcontrol/input/mouse.cpp b/kcontrol/input/mouse.cpp
index 49b67c98d..8957c6f87 100644
--- a/kcontrol/input/mouse.cpp
+++ b/kcontrol/input/mouse.cpp
@@ -55,6 +55,8 @@
#include <tqwhatsthis.h>
#include <tqtabwidget.h>
#include <tqradiobutton.h>
+#include <tqstyle.h>
+#include <tqevent.h>
#include <tdelocale.h>
#include <kdialog.h>
@@ -223,8 +225,6 @@ MouseConfig::MouseConfig (TQWidget * parent, const char *name)
" rapidly to different areas on the screen.");
TQWhatsThis::add( thresh, wtstr );
- // It would be nice if the user had a test field.
- // Selecting such values in milliseconds is not intuitive
doubleClickInterval = new KIntNumInput(thresh, 2000, tab2);
doubleClickInterval->setLabel(i18n("Double click interval:"));
doubleClickInterval->setRange(0, 2000, 100);
@@ -241,7 +241,33 @@ MouseConfig::MouseConfig (TQWidget * parent, const char *name)
" separate clicks.");
TQWhatsThis::add( doubleClickInterval, wtstr );
- lay->addSpacing(15);
+ lay->addSpacing(10);
+
+ doubleClickLabel = new TQLabel(i18n("Double-click on the image below to test your double-click interval:"), tab2);
+ lay->addWidget(doubleClickLabel);
+ wtstr = i18n("The image will change when your double-click"
+ " test time is less than or equal to the interval you"
+ " configured. When changing the interval, be sure to select"
+ " the Apply button before testing. For example, the image"
+ " will not change when you configure a double-click interval"
+ " of 700 milliseconds and the time between two successive"
+ " clicks on the image is 800 milliseconds, but the image will"
+ " change when the time between clicks is 600 milliseconds."
+ " The goal is to select a comfortable interval that you find"
+ " is not too fast or slow.");
+ TQWhatsThis::add( doubleClickLabel, wtstr );
+ doubleClickButton = new TQPushButton( tab2 );
+ doubleClickButton->setAcceptDrops( false );
+ // The images are 32x32.
+ uint sz = style().pixelMetric( TQStyle::PM_ButtonMargin ) * 2 + 48;
+ doubleClickButton->setFixedSize( sz, sz );
+ // Show the first image.
+ doubleClickButton->setPixmap(locate("data", "kcminput/pics/doubleclick_1.png"));
+ lay->addWidget(doubleClickButton);
+ // Use the same What's This help for the pushbutton.
+ TQWhatsThis::add( doubleClickButton, wtstr );
+
+ lay->addSpacing(10);
dragStartTime = new KIntNumInput(doubleClickInterval, 2000, tab2);
dragStartTime->setLabel(i18n("Drag start time:"));
diff --git a/kcontrol/input/mouse.h b/kcontrol/input/mouse.h
index 01f6c1071..833ef3bdc 100644
--- a/kcontrol/input/mouse.h
+++ b/kcontrol/input/mouse.h
@@ -145,12 +145,13 @@ private:
ThemePage* themetab;
MouseSettings *settings;
- TQCheckBox *mouseKeys;
+ TQCheckBox *mouseKeys;
KIntNumInput *mk_delay, *mk_interval, *mk_time_to_max, *mk_max_speed,
*mk_curve;
+ TQLabel *doubleClickLabel;
+ TQPushButton *doubleClickButton;
};
#endif
-
diff --git a/kcontrol/input/pics/CMakeLists.txt b/kcontrol/input/pics/CMakeLists.txt
index 69c246e4f..0c9331efe 100644
--- a/kcontrol/input/pics/CMakeLists.txt
+++ b/kcontrol/input/pics/CMakeLists.txt
@@ -10,5 +10,5 @@
#################################################
install( FILES
- mouse_rh.png mouse_lh.png
+ mouse_rh.png mouse_lh.png doubleclick_1.png doubleclick_2.png
DESTINATION ${DATA_INSTALL_DIR}/kcminput/pics )
diff --git a/kcontrol/input/pics/Makefile.am b/kcontrol/input/pics/Makefile.am
index fa9cd0d71..e97dd54b2 100644
--- a/kcontrol/input/pics/Makefile.am
+++ b/kcontrol/input/pics/Makefile.am
@@ -1,3 +1,3 @@
-kcminput_pics_data_DATA = mouse_rh.png mouse_lh.png
+kcminput_pics_data_DATA = mouse_rh.png mouse_lh.png doubleclick_1.png doubleclick_2.png
kcminput_pics_datadir = $(kde_datadir)/kcminput/pics