KV:
Code: Alles auswählen
#---------------------------------------
<AnswerButton@ButtonBehavior+Widget>:
#---------------------------------------
size_hint: None,None
height: dp(25)
width: lbl_txt.texture_size[0] + lbl_ic.texture_size[0] + box.spacing * 3
markup: False
icon_letter: None
font_size: 14
text: ''
color: [0,0,0,0] # main Button Color avoid double button text (lbl_txt)
text_color: [1,1,1,1]
bg_color: None
truth: False
BoxLayout:
pos: root.pos
size: root.size
id: box
spacing: dp(10)
#------------
MDIcon:
#------------
id: lbl_ic
icon: "alpha-"+root.icon_letter.lower()+"-circle-outline" if root.icon_letter else "adjust"
size_hint_x: None
width: self.texture_size[0]
opposite_colors:True
#-------------
Label:
#-------------
id: lbl_txt
size_hint_x: None
width: self.texture_size[0]
text: root.text #ref
font_size: sp(root.font_size) #ref
shorten: True
color: root.text_color if root.text_color else [1,1,1,1]
markup: root.markup #ref
Code: Alles auswählen
class AnswerButton(Widget,ButtonBehavior):
pass
gruss
christian