How to use the kivymd.button.MDIconButton function in kivymd

To help you get started, we’ve selected a few kivymd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AndreMiras / KivyMD / kivymd / toolbar.py View on Github external
def update_action_bar(self, action_bar, action_bar_items):
        action_bar.clear_widgets()
        new_width = 0
        for item in action_bar_items:
            new_width += dp(48)
            action_bar.add_widget(MDIconButton(icon=item[0],
                                               on_release=item[1],
                                               opposite_colors=True,
                                               text_color=self.specific_text_color,
                                               theme_text_color='Custom'))
        action_bar.width = new_width
github HeaTTheatR / KivyMD / kivymd / theme_picker.py View on Github external
on_release: app.theme_cls.theme_style = 'Light'
                    MDIconButton:
                        size: dp(100), dp(100)
                        pos: self.pos
                        size_hint: (None, None)
                        canvas:
                            Color:
                                rgba: 0, 0, 0, 1
                            Ellipse:
                                size: self.size
                                pos: self.pos
                        on_release: app.theme_cls.theme_style = 'Dark'
''')


class ColorSelector(MDIconButton):
    color_name = OptionProperty(
            'Indigo',
            options=['Red', 'Pink', 'Purple', 'DeepPurple', 'Indigo', 'Blue',
                     'LightBlue', 'Cyan', 'Teal', 'Green', 'LightGreen',
                     'Lime', 'Yellow', 'Amber', 'Orange', 'DeepOrange',
                     'Brown', 'Grey', 'BlueGrey'])

    def rgb_hex(self, col):
        return get_color_from_hex(colors[col][self.theme_cls.accent_hue])


class MDThemePicker(ThemableBehavior, FloatLayout, ModalView,
                    SpecificBackgroundColorBehavior,
                    RectangularElevationBehavior):
    pass
github AndreMiras / KivyMD / kivymd / theme_picker.py View on Github external
on_release: app.theme_cls.theme_style = 'Light'
                    MDIconButton:
                        size: dp(100), dp(100)
                        pos: self.pos
                        size_hint: (None, None)
                        canvas:
                            Color:
                                rgba: 0, 0, 0, 1
                            Ellipse:
                                size: self.size
                                pos: self.pos
                        on_release: app.theme_cls.theme_style = 'Dark'
""")


class ColorSelector(MDIconButton):
    color_name = OptionProperty(
            'Indigo',
            options=['Red', 'Pink', 'Purple', 'DeepPurple', 'Indigo', 'Blue',
                     'LightBlue', 'Cyan', 'Teal', 'Green', 'LightGreen',
                     'Lime', 'Yellow', 'Amber', 'Orange', 'DeepOrange',
                     'Brown', 'Grey', 'BlueGrey'])

    def rgb_hex(self, col):
        return get_color_from_hex(colors[col][self.theme_cls.accent_hue])


class MDThemePicker(ThemableBehavior, FloatLayout, ModalView,
                    SpecificBackgroundColorBehavior,
                    RectangularElevationBehavior):
    pass