Reputation: 83
I've started using Kivy for python app's UI. I want to style my buttons using an atlas with images. I've created one, with some standard 100x100 png images: btn_up, btn_down.
Button:
text: _('State')
font_size: 22
on_press: screens.current = 'current_state'
background_normal: 'atlas://res/bkts_atlas/btn_up'
background_down: 'atlas://res/bkts_atlas/btn_down'
The image on the buttons is stretched. The default Kivy button (using defaultheme atlas) is rendered ok, even if the button image is a square-like image in the atlas. I mean it keeps a nice form when rendered even if the button size isn't square. How can I fix it ? Thanks in advance.
Upvotes: 0
Views: 476
Reputation: 29488
The Button stretches its image disproportionately in order to let you use a single image for different button shapes (note how the default image always has borders of the same width, no matter the button size). I think the way to disable this is just to add border: 0, 0, 0, 0
, or other options will have other effects.
Upvotes: 0