Mercurial > libervia-desktop-kivy
comparison cagou/plugins/plugin_wid_widget_selector.py @ 357:4d3a0c4f2430
core: better back key (ESC) management:
- back key (which is mapped to esc keycode by SDL2 backend) is now handler with a platform
specific method when on root widget (i.e. a default widget is selected, or nothing is
selected). Default behaviour is to do nothing, while on Android the app is put to
background
- CagouWidget now has a default key_input method which go back to default widget.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 18 Jan 2020 23:12:52 +0100 |
parents | 19422bbd9c8e |
children | 9c6fe392d623 |
comparison
equal
deleted
inserted
replaced
356:307c2501d8b2 | 357:4d3a0c4f2430 |
---|---|
64 def adjust_width(self, label, texture_size): | 64 def adjust_width(self, label, texture_size): |
65 width = max([i.minimum_width for i in self.items]) | 65 width = max([i.minimum_width for i in self.items]) |
66 for i in self.items: | 66 for i in self.items: |
67 i.width = width | 67 i.width = width |
68 | 68 |
69 def key_input(self, window, key, scancode, codepoint, modifier): | |
70 # we pass to avoid default CagouWidget which is going back to default widget | |
71 # (which is this one) | |
72 pass | |
73 | |
69 @classmethod | 74 @classmethod |
70 def factory(cls, plugin_info, target, profiles): | 75 def factory(cls, plugin_info, target, profiles): |
71 return cls() | 76 return cls() |
72 | 77 |
73 | 78 |