Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Slider.sensitivity #5145

Merged
merged 6 commits into from
May 15, 2017
Merged

Add Slider.sensitivity #5145

merged 6 commits into from
May 15, 2017

Conversation

KeyWeeUsr
Copy link
Contributor

Bases on #3275 idea although I'm not quite sure if this is what @tito meant. On the other hand,
if it's meant like there should be something more tweakable in python so that kv can change it directly (i.e. not via sensitivity: 'cursor' only) then there could be e.g. this:

#py:
sensitivity = auto/cursor/manual(?)
cursor_collide_area = ListProperty([?])
elif self.sensitivity == 'cursor':
    root.cursor_collide_area # collide with that & grab

#kv:
Image:
    on_pos: root.cursor_collide_area = [*self.pos, *self.size] if root.sensitivity == 'cursor' else root.cursor_collide_area

# widget kv:
Slider:
    sensitivity: 'manual'
    cursor_collide_area: [0, 0, 400, 300] # half-window from origin

but that seems a little bit uglier (two properties for a single feature) although it seems to be a quite usable solution too (and probably even "too tweakable").

@dessant
Copy link
Contributor

dessant commented May 13, 2017

We could use handle in place of cursor.

@KeyWeeUsr
Copy link
Contributor Author

The unittest for the default and sensitivity='handle' behavior works correctly I believe both locally and on Travis Appveyor. The rest of the functionality is basically what was requested in the previous issue/PR so this should be ok to merge as it works with widgets only (not with canvas instructions directly).

Any requested changes?

@dessant
Copy link
Contributor

dessant commented May 15, 2017

Versionadded syntax, the rest looks good, though I have not tested.

@KeyWeeUsr KeyWeeUsr merged commit 873427d into kivy:master May 15, 2017
@KeyWeeUsr KeyWeeUsr deleted the slider_sens branch May 15, 2017 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants