mirror of https://github.com/kivy/kivy.git
Add background color to size message.
Added a colored background to the label because it kept getting lost in the white ‘K’ field. Also changed the label color to cyan for readability.
This commit is contained in:
parent
d00d38559e
commit
ee9b869f2b
|
@ -7,10 +7,19 @@ This was a test to fix an issue with repeating texture and window reloading.
|
|||
|
||||
from kivy.app import App
|
||||
from kivy.uix.image import Image
|
||||
from kivy.properties import ObjectProperty
|
||||
from kivy.uix.label import Label
|
||||
from kivy.properties import ObjectProperty, ListProperty
|
||||
from kivy.lang import Builder
|
||||
|
||||
kv = '''
|
||||
<LabelOnBackground>:
|
||||
canvas.before:
|
||||
Color:
|
||||
rgb: self.background
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
FloatLayout:
|
||||
canvas.before:
|
||||
Color:
|
||||
|
@ -20,11 +29,22 @@ FloatLayout:
|
|||
size: self.size
|
||||
texture: app.texture
|
||||
|
||||
Label:
|
||||
LabelOnBackground:
|
||||
text: '{} (try to resize the window)'.format(root.size)
|
||||
color: (0.4, 1, 1, 1)
|
||||
background: (.3, .3, .3)
|
||||
pos_hint: {'center_x': .5, 'center_y': .5 }
|
||||
size_hint: None, None
|
||||
height: 30
|
||||
width: 250
|
||||
|
||||
'''
|
||||
|
||||
|
||||
class LabelOnBackground(Label):
|
||||
background = ListProperty((0.2, 0.2, 0.2))
|
||||
|
||||
|
||||
class RepeatTexture(App):
|
||||
|
||||
texture = ObjectProperty()
|
||||
|
|
Loading…
Reference in New Issue