Allow configuration of swipe length#224
Conversation
2e5c86d to
15b603a
Compare
|
I've removed the setAllSwipeLengths API in favor of a This is buildable but it depends on #225 to work properly. |
Hmm, I'm not completely sold on |
|
Do you mean have all four settings in the UI? or keep it as is with one setting but make four calls? For the latter I'm not sure what to display If the lengths are different. |
Longer term I'd probably want to support both options. For now it would probably make sense to just display them as separate options. |
This adds an option to the settings popup allowing users to configure a custom swipe length. The default of 30 is retained. Co-authored-by: Nathaniel van Diepen <Eeems@users.noreply.github.com>
15b603a to
b1931db
Compare
| switch (direction){ | ||
| case 1: | ||
| m_swipeLengthRight = length; | ||
| emit swipeLengthRightChanged(length); | ||
| break; | ||
| case 2: | ||
| m_swipeLengthLeft = length; | ||
| emit swipeLengthLeftChanged(length); | ||
| break; | ||
| case 3: | ||
| m_swipeLengthUp = length; | ||
| emit swipeLengthUpChanged(length); | ||
| break; | ||
| case 4: | ||
| m_swipeLengthDown = length; | ||
| emit swipeLengthDownChanged(length); | ||
| break; | ||
| default: | ||
| qDebug() << "Invalid swipe direction: " << direction; | ||
| break; | ||
| } | ||
| } | ||
| int Controller::getSwipeLength(int direction){ | ||
| switch (direction){ | ||
| case 1: | ||
| return swipeLengthRight(); | ||
| case 2: | ||
| return swipeLengthLeft(); | ||
| case 3: | ||
| return swipeLengthUp(); | ||
| case 4: | ||
| return swipeLengthDown(); | ||
| default: | ||
| qDebug() << "Invalid swipe direction: " << direction; | ||
| return -1; | ||
| } | ||
| } |
There was a problem hiding this comment.
I'd prefer to use an enum here for readability instead of the raw integer values. Similar to what I do for WifiStatus etc: https://github.com/Eeems/oxide/blob/master/applications/launcher/controller.h#L28-L31
|
Looking good! I'll make sure to test/tweak it this evening and get it merged. |
…ible to trigger a gesture
b3c34aa to
c453c8b
Compare
|
Code Climate has analyzed commit 4cab8c1 and detected 0 issues on this pull request. View more on Code Climate. |
|
Thanks! |
Thank you for submitting the PR and getting the ball rolling on this! |
This adds an option to the settings popup allowing users to configure
a custom swipe length. The default of 30 is retained.
Let me know if this needs any changes; It's my first time working on a Qt codebase.