Merge branch 'main' into element-types

This commit is contained in:
Conrad Irwin 2023-11-14 12:10:26 -07:00
commit 37d0b8424c
38 changed files with 921 additions and 396 deletions

View file

@ -1,5 +1,4 @@
use crate::{h_stack, prelude::*};
use crate::{ClickHandler, Icon, IconColor, IconElement, TextTooltip};
use crate::{h_stack, prelude::*, ClickHandler, Icon, IconElement, TextTooltip};
use gpui::{prelude::*, MouseButton, VisualContext};
use std::sync::Arc;
@ -17,7 +16,7 @@ impl<V: 'static> Default for IconButtonHandlers<V> {
pub struct IconButton<V: 'static> {
id: ElementId,
icon: Icon,
color: IconColor,
color: TextColor,
variant: ButtonVariant,
state: InteractionState,
tooltip: Option<SharedString>,
@ -29,7 +28,7 @@ impl<V: 'static> IconButton<V> {
Self {
id: id.into(),
icon,
color: IconColor::default(),
color: TextColor::default(),
variant: ButtonVariant::default(),
state: InteractionState::default(),
tooltip: None,
@ -42,7 +41,7 @@ impl<V: 'static> IconButton<V> {
self
}
pub fn color(mut self, color: IconColor) -> Self {
pub fn color(mut self, color: TextColor) -> Self {
self.color = color;
self
}
@ -72,7 +71,7 @@ impl<V: 'static> IconButton<V> {
fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let icon_color = match (self.state, self.color) {
(InteractionState::Disabled, _) => IconColor::Disabled,
(InteractionState::Disabled, _) => TextColor::Disabled,
_ => self.color,
};