Created
April 21, 2015 16:08
-
-
Save kived/7ea69c1d50a775d60f5a to your computer and use it in GitHub Desktop.
Kivy: orientation change
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
FloatLayout: | |
screen_orientation: 'landscape' if self.width > self.height else 'portrait' | |
BoxLayout: | |
orientation: 'vertical' | |
disabled: root.screen_orientation != 'portrait' | |
size_hint: (None, None) if self.disabled else (1, 1) | |
size: (0, 0) if self.disabled else (100, 100) | |
opacity: 0 if self.disabled else 1 | |
Button | |
Button | |
Button | |
BoxLayout: | |
orientation: 'horizontal' | |
disabled: root.screen_orientation != 'landscape' | |
size_hint: (None, None) if self.disabled else (1, 1) | |
size: (0, 0) if self.disabled else (100, 100) | |
opacity: 0 if self.disabled else 1 | |
Button | |
Button | |
Button | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment