Created
June 27, 2014 20:51
-
-
Save NumesSanguis/3e0282bc8252cd86b76b to your computer and use it in GitHub Desktop.
Kivy ScrollView blur
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
from kivy.uix.label import Label | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.properties import StringProperty | |
from kivy.base import runTouchApp | |
from kivy.lang import Builder | |
Builder.load_string(''' | |
<ScrollableLabel>: | |
orientation: 'vertical' | |
canvas.before: | |
Color: | |
rgba: 1, 1, 1, 1 | |
Rectangle: | |
pos: self.pos | |
size: self.size | |
ScrollView: | |
text: str('some really really long string' * 100) | |
Label: | |
text: str('some really really long string' * 100) | |
font_size: '20sp' | |
text_size: self.width-10, None | |
color: 0, 0, 0, 1 | |
# size_hint_y blurs text, try putting # in front: | |
size_hint_y: None | |
height: int(self.texture_size[1]+10) | |
valign: 'top' | |
ScrollView: | |
size_hint_y: .2 | |
BoxLayout: | |
orientation: 'vertical' | |
Button: | |
text: 'Bla1' | |
font_size: 20 | |
Button: | |
text: 'Bla2' | |
Button: | |
text: 'Bla3' | |
''') | |
class ScrollableLabel(BoxLayout): | |
pass | |
runTouchApp(ScrollableLabel()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment