Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add disabled as an option on text_button
Nate Butlerf6faeea7207f
diff --git a/styles/src/component/text_button.ts b/styles/src/component/text_button.tsindex b911cd5b778..ead017a8032 100644--- a/styles/src/component/text_button.ts+++ b/styles/src/component/text_button.ts@@ -17,6 +17,7 @@ interface TextButtonOptions {variant?: Button.Variantcolor?: keyof Theme["lowest"]margin?: Partial<Margin>+ disabled?: booleantext_properties?: TextProperties}@@ -29,6 +30,7 @@ export function text_button({color,layer,margin,+ disabled,text_properties,}: TextButtonOptions = {}) {const theme = useTheme()@@ -65,13 +67,17 @@ export function text_button({state: {default: {background: background_color,- color: foreground(layer ?? theme.lowest, color),+ color:+ disabled+ ? foreground(layer ?? theme.lowest, "disabled")+ : foreground(layer ?? theme.lowest, color),},- hovered: {- background: background(layer ?? theme.lowest, color, "hovered"),- color: foreground(layer ?? theme.lowest, color, "hovered"),- },- clicked: {+ hovered:+ disabled ? {} : {+ background: background(layer ?? theme.lowest, color, "hovered"),+ color: foreground(layer ?? theme.lowest, color, "hovered"),+ },+ clicked: disabled ? {} : {background: background(layer ?? theme.lowest, color, "pressed"),color: foreground(layer ?? theme.lowest, color, "pressed"),},