.
This commit is contained in:
1 parent
282035872d
commit
74df424ecc
1 file changed
+18
@@ -0,0 +1,18 @@
|
||||
# material_icon.py
|
||||
|
||||
from fabric.widgets.label import Label
|
||||
|
||||
def MaterialIcon(icon_name: str, size: str = "24px", props: dict = None):
|
||||
label_props = {
|
||||
"label": icon_name, # Directly use the provided icon name
|
||||
"name": "material_icon",
|
||||
"style": f"font-size: {size}; ", # Set font family for Material Icons
|
||||
"h_align": "center", # Align horizontally
|
||||
"v_align": "center" # Align vertically
|
||||
}
|
||||
|
||||
if props:
|
||||
label_props.update(props)
|
||||
|
||||
return Label(**label_props)
|
||||
|
||||
Reference in new issue
Block a user