feat: Add global toasts and annotation copy feedback
Create a reusable ToastHost/ToastGlobal rendered as an overlay, and use it to show a toast after copying an annotation. Adjust modal backdrop click handling so toasts don’t close the modal, add a simple color mix helper for toast styling, and remove the unused task table priority color helper.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use gpui::prelude::*;
|
||||
use gpui::{Pixels, px, rems};
|
||||
|
||||
use crate::theme::Theme;
|
||||
use crate::theme::{Color, Theme};
|
||||
|
||||
pub const CARD_RADIUS: Pixels = px(6.0);
|
||||
pub const CARD_PADDING: Pixels = px(8.0);
|
||||
@@ -170,3 +170,13 @@ pub fn text_button_style(div: gpui::Div, theme: &Theme) -> gpui::Div {
|
||||
.cursor_pointer()
|
||||
.hover(|s| s.text_color(theme.accent))
|
||||
}
|
||||
|
||||
pub fn mix_color(base: Color, tint: Color, amount: f32) -> Color {
|
||||
let amount = amount.clamp(0.0, 1.0);
|
||||
gpui::Rgba {
|
||||
r: base.r + (tint.r - base.r) * amount,
|
||||
g: base.g + (tint.g - base.g) * amount,
|
||||
b: base.b + (tint.b - base.b) * amount,
|
||||
a: 1.0,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user