-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handling accidental double-taps on buttons with MMSingleClickMouseArea (
#3532) * updating all versions after release * MMSingleClickMouseArea draft * code adjustments * preventing click from propagating to the background * adding new SingleClickMouseArea to photo procedures * new component description and added to gallery qrc, timer set to 2 seconds * how-to use new component * version fix * post review fixes * small code layout fix * MMSingleClickMouseArea on openLinkedFeature * adding MMSingleClickMouseArea to MMPhoto
- Loading branch information
1 parent
9f3ac1b
commit 619d682
Showing
7 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
import QtQuick | ||
|
||
/** | ||
* MMSingleClickMouseArea enhances MouseArea by preventing multiple clicks within a | ||
* specified time frame, ensuring consistent behavior and avoiding unintended actions | ||
* Similar to MouseArea, but it should be used with onSingleClicked signal handling instead of onClicked | ||
*/ | ||
|
||
MouseArea { | ||
id: root | ||
|
||
signal singleClicked() | ||
|
||
onClicked: { | ||
if ( timer.running ) { | ||
mouse.accepted = true; | ||
return; | ||
} | ||
|
||
singleClicked() | ||
timer.start() | ||
} | ||
|
||
Timer { | ||
id: timer | ||
interval: 2000 | ||
repeat: false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
619d682
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS - version 24.7.642511 just submitted!