Replies: 9 comments 10 replies
-
@gbm001 In my opinion, this is a more appropriate place for this topic :) |
Beta Was this translation helpful? Give feedback.
-
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
MDScreen:
MDIconButton:
size_hint: None, None
pos_hint: {"center_y": 0.5}
size: 0, 0
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run() ValueError: MDIconButton._radius is below the minimum bound (0.100000) https://github.com/kivymd/KivyMD/blob/master/kivymd/uix/button/button.py#L861 |
Beta Was this translation helpful? Give feedback.
-
For example, similar errors occur when using the |
Beta Was this translation helpful? Give feedback.
-
I've obviously done the error handler on BoundedNumericProperty for _radius wrong; I wanted it to automatically set anything less than 0.1 to 0.1. |
Beta Was this translation helpful? Give feedback.
-
@gbm001 Perhaps this bug should be reported in Kivy issues. |
Beta Was this translation helpful? Give feedback.
-
Is there a plan to implement an MD3 colour scheme into KivyMD? In theory, it should be simpler even than using the MD2014 colour themes; you just pick a primary, secondary and tertiary hue, a neutral and neutral variant hue, and an error hue, and then just magically generate everything from that (I say 'hue' because I think the primary/secondary/tertiary etc. should be 40% (?) shades). |
Beta Was this translation helpful? Give feedback.
-
Added the ability to set a custom disabled button color for icon elements, text and button line: from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
MDScreen:
MDRoundFlatIconButton:
text: "Button disabled with default disabled color"
disabled: True
pos_hint: {"center_x": .5, "center_y": .2}
MDRoundFlatIconButton:
id: btn
text: "Button disabled with custom disabled color"
disabled: True
disabled_color: 0, 0, 1, 1
pos_hint: {"center_x": .5, "center_y": .3}
MDRaisedButton:
text: "Set disabled color"
pos_hint: {"center_x": .5, "center_y": .4}
on_release: btn.disabled_color = (1, 1, 0, 1)
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run() |
Beta Was this translation helpful? Give feedback.
-
@gbm001 |
Beta Was this translation helpful? Give feedback.
-
Hello I'm New |
Beta Was this translation helpful? Give feedback.
-
This is to keep track, and allow comment on, things I think either need fixing or I am planning on improving to do with KivyMD Buttons.
There are fundamentally two kinds of (MD2) buttons currently supported:
In both MD2 and MD3, Floating Action Buttons can have text as well as an icon ('extended' FABs). This leaves the plain icon button as the only button that doesn't take potentially both text and an icon. Consequently, it would probably be easier to roll the Icon properties into BaseButton since they could be used in almost every MD button, and always include (at least for the 'rectangular' buttons) both an icon and a text label. If the button had no icon (for a 'rectangular' button), the label would just be zero-width which (except for text-only buttons) gets the correct padding.
Consequently, I propose making these changes, fixing the label size/padding issues and minimum width/heights for the existing classes, then creating an 'MDButton' class which can be set to MD2 or MD3 and covers all rectangular button options via a 'button_type' parameter (which sets defaults for line color/width, background color/width etc). Then MDIconButton and MDFloatingActionButton would then remain as separate classes.
Beta Was this translation helpful? Give feedback.
All reactions