#imports
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.checkbox import CheckBox
from kivy.lang import Builder
from kivy.factory import Factory
class CCheckBox(CheckBox):
pass
Factory.register('CCheckBox', cls=CCheckBox)
Builder.load_string("""
<CCheckBox>:
canvas:
Clear:
Color:
rgba: 1, .5, 1, .5
Rectangle:
size: 32, 32
pos: int(self.center_x - 16), int(self.center_y - 16)
Color:
rgba: 1, 1, 0, 1
Rectangle:
source: 'atlas://data/images/defaulttheme/checkbox%s_%s' % (('_radio' if self.group else ''), ('on' if self.active else 'off'))
size: 32, 32
pos: int(self.center_x - 16), int(self.center_y - 16)
<SMApp>:
CCheckBox:
Switch:
""")
class SMApp(App, BoxLayout):
def build(self):
return self
if __name__ == '__main__':
SMApp().run()
I have looked around for ways to change the appearance of certain types of widgets, including the Switch and Checkbox widgets, and couldn't find any. Is there a way to do this easily, or would the Kivy source/image files themselves need to be modified? If these files are modified, what kind of license and distribution ramifications would that have for a commercial application? Apologies if I'm overlooking something obvious.
--