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 sdl2 system cursors #5308
Add sdl2 system cursors #5308
Conversation
Seems nice! If no one shows for testing, I'll look into it soon-ish. |
Everything except |
@@ -732,6 +732,19 @@ def _get_focus(self): | |||
def _set_cursor_state(self, value): | |||
pass | |||
|
|||
def set_system_cursor(self, cursor_name): | |||
'''Set cursor to a SDL_SystemCursor |
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.
Run the docstring e.g. through http://rst.ninjs.org and fix the formatting, please :)
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.
I am not sure what you want to fix, it looks like other kivy docstrings.
Wait arrow is a crosshair for me. It depends on platform. |
Yes, it depends on a platform, but neither of those should return a crosshair. See windows, wayland, cocoa/mac, x11, docs :) I think you ran an example like this: from kivy.app import runTouchApp
from kivy.lang import Builder
runTouchApp(Builder.load_string('''
#:import win kivy.core.window.Window
GridLayout:
cols: 4
Button:
text: 'arrow'
on_release: win.set_system_cursor('arrow')
Button:
text: 'ibeam'
on_release: win.set_system_cursor('ibeam')
Button:
text: 'wait'
on_release: win.set_system_cursor('wait')
Button:
text: 'crosshair'
on_release: win.set_system_cursor('crosshair')
Button:
text: 'wait_arrow'
on_release: win.set_system_cursor('wait_arrow')
Button:
text: 'size_nwse'
on_release: win.set_system_cursor('size_nwse')
Button:
text: 'size_nesw'
on_release: win.set_system_cursor('size_nesw')
Button:
text: 'size_we'
on_release: win.set_system_cursor('size_we')
Button:
text: 'size_ns'
on_release: win.set_system_cursor('size_ns')
Button:
text: 'size_all'
on_release: win.set_system_cursor('size_all')
Button:
text: 'hand'
on_release: win.set_system_cursor('hand')
Button:
text: 'no'
on_release: win.set_system_cursor('no')
''')) and changed the icons one after another. Try to press only the If you have the same result, it might be a good idea to include a note about that. |
Hello.
I have tested kivy with sdl2 system cursors on windows, ubuntu, android 4.4 and everything works very nicely. I would like to share it with other people.
This commit adds necessary structs from SDL2 and a set_system_cursor method for kivy window where you can replace your app cursor.