[SOLVED] Why does 'background' in the condition disable 'hover_background'?
Posted: Thu Oct 27, 2022 3:03 am
I have a layout with non-standard sized buttons that I create in the loop, so I have to set my own background for a particular button.
And because of this all the buttons don't have hover_background, which are written in the styles
Why the conditions for background dominate - I understand. But I don't understand why it disables the visibility of the already existing hover_background in the styles, because it's a different property. Also, it's about the background, but not about other parameters, which are also set in the styles, for example - height.
I understand that I can explicitly specify hover_background here
But I want to understand the principle of this problem and, if possible, put all the styles in style blocks instead of specifying them in the loop body
Code: Select all
vbox:
for i in range(len(btns)):
hbox:
for k in range(len(btns[i]))
textbutton btns[i][k]:
background If(i == 0 or k == 3, btn_opers_bg, btn_nums_bg)Code: Select all
style main_button:
background btn_nums_bg
hover_background btn_nums_hover_bg
xysize btn_sizeI understand that I can explicitly specify hover_background here
Code: Select all
for k in range(len(btns[i]))
textbutton btns[i][k]:
background If(i == 0 or k == 3, btn_opers_bg, btn_nums_bg)
hover_background 'some_color'