MCPcopy Create free account
hub / github.com/Bbalduzz/fletmint / __init__

Method __init__

fletmint/button.py:136–172  ·  view source on GitHub ↗
(
        self,
        width=200,
        height=50,
        on_click=None,
        disabled=False,
        label="Delete",
        icon=None,
    )

Source from the content-addressed store, hash-verified

134
135class DestructiveButton(Button):
136 def __init__(
137 self,
138 width=200,
139 height=50,
140 on_click=None,
141 disabled=False,
142 label="Delete",
143 icon=None,
144 ):
145 # Override the background color for a destructive button (red)
146 destructive_style = ButtonStyle(
147 color={
148 "": ButtonColors.button_disabled_content_color
149 if disabled
150 else ButtonColors.button_content_color, # MaterialState.DEFAULT
151 },
152 bgcolor={
153 "": "#FF0000" # Red background for the destructive action
154 if not disabled
155 else ButtonColors.button_disabled_background_color,
156 "disabled": ButtonColors.button_disabled_background_color,
157 },
158 padding=18,
159 shape=ContinuousRectangleBorder(radius=20),
160 )
161
162 # Pass the customized style to the base `Button` class
163 super().__init__(
164 width=width,
165 height=height,
166 on_click=on_click,
167 disabled=disabled,
168 label=label,
169 icon=icon,
170 )
171 # Override the style attribute directly to apply the destructive color
172 self.style = destructive_style
173
174 def did_mount(self):
175 self.update()

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected