Exemplo n.º 1
0
    def on_mouse_pos(self, *args):
        pos = args[1]
        if self.pulsing:
            return

        if self.collide_point(*self.to_widget(*pos)):
            if not self.disabled:
                self.tile_color = ColorScheme.get_medium_accent()
        else:
            self.tile_color = ColorScheme.get_dark_accent()
Exemplo n.º 2
0
    def on_mouse_pos(self, *args):
        pos = args[1]
        if self.pulsing:
            return

        if self.collide_point(*self.to_widget(*pos)):
            if not self.disabled:
                self.tile_color = ColorScheme.get_medium_accent()
        else:
            self.tile_color = ColorScheme.get_dark_accent()
Exemplo n.º 3
0
class FeatureButton(TileIconButton):
    Builder.load_string("""
<FeatureButton>
    title_font: 'resource/fonts/ASL_regular.ttf'
    icon_color: (0.0, 0.0, 0.0, 1.0)
    title_color: (0.2, 0.2, 0.2, 1.0)
    line_width: 5
    """)

    disabled_color = ListProperty(ColorScheme.get_dark_accent())
    highlight_color = ListProperty(ColorScheme.get_medium_accent())

    def __init__(self, **kwargs):
        super(FeatureButton, self).__init__(**kwargs)
        self.tile_color = (1.0, 1.0, 1.0, 1.0)
        Window.bind(mouse_pos=self.on_mouse_pos)

    def on_mouse_pos(self, *args):
        pos = args[1]
        if self.pulsing:
            return

        if self.collide_point(*self.to_widget(*pos)):
            if not self.disabled:
                self.tile_color = self.highlight_color
        else:
            self.tile_color = self.disabled_color

    def on_press(self, *args):
        super(FeatureButton, self).on_press(*args)
        if not self.disabled and not self.pulsing:
            self.tile_color = self.highlight_color

    def on_release(self, *args):
        super(FeatureButton, self).on_release(*args)
        if not self.pulsing:
            self.tile_color = self.disabled_color

    def on_fade_color(self, instance, value):
        self.tile_color = value

    def on_pulsing(self, instance, value):
        self.tile_color = self.highlight_color
        super(FeatureButton, self).on_pulsing(instance, value)

    def on_disabled(self, instance, value):
        super(FeatureButton, self).on_disabled(instance, value)
        self.tile_color = self.disabled_color
Exemplo n.º 4
0
 def on_disabled(self, instance, value):
     super(LabelIconButton, self).on_disabled(instance, value)
     self.tile_color = ColorScheme.get_medium_accent()
Exemplo n.º 5
0
 def on_pulsing(self, instance, value):
     self.tile_color = ColorScheme.get_medium_accent()
     super(LabelIconButton, self).on_pulsing(instance, value)
Exemplo n.º 6
0
 def on_press(self, *args):
     super(LabelIconButton, self).on_press(*args)
     if not self.disabled and not self.pulsing:
         self.tile_color = ColorScheme.get_medium_accent()
Exemplo n.º 7
0
 def on_disabled(self, instance, value):
     super(LabelIconButton, self).on_disabled(instance, value)
     self.tile_color = ColorScheme.get_medium_accent()
Exemplo n.º 8
0
 def on_pulsing(self, instance, value):
     self.tile_color = ColorScheme.get_medium_accent()
     super(LabelIconButton, self).on_pulsing(instance, value)
Exemplo n.º 9
0
 def on_press(self, *args):
     super(LabelIconButton, self).on_press(*args)
     if not self.disabled and not self.pulsing:
         self.tile_color = ColorScheme.get_medium_accent()