kivymd / KivyMD

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd
https://kivymd.readthedocs.io
MIT License
2.14k stars 655 forks source link

MDSwitch misbehaves on clicking on certain regions and while holding the button #1634

Open MohamedFarhan23 opened 4 months ago

MohamedFarhan23 commented 4 months ago

On trying to switch the switchbox , it sometimes gets stuck in the middle part and while holding the button, it gets enlarged and goes out of the box. Also, currently to switch the user has to particularly click the inside circle , I personally feel it would be nice if it could change state on clicking on the anywhere on the button.

from kivymd.app import MDApp
from kivy.lang import Builder
KV="""
MDFloatLayout:
    MDSwitch:
        active:True

        pos_hint: {'center_x': 0.5,'center_y': 0.5}

"""
class SwitchButton(MDApp):
    def build(self):
        return Builder.load_string(KV)

if __name__=="__main__":
    SwitchButton().run()