from ui.qml_widget import Qml_Widget


class Qml_Switch(Qml_Widget):
    def __init__(self, checked=False):  # , size, color=None):
        super().__init__()
        self.set_checked(False)
        self.toggled = self.qml_item.toggled

    def set_checked(self, checked):
        self.set("checked", checked)

    @property
    def checked(self):
        return self.get("checked")
