Files
taskwarrior-gpui/src/components/input/suggestion.rs
T
Ignacio Perez 7c1824dcf7 feat: Add GPUI component library
Add core UI components for TaskWarrior GUI application:

Components:
- Input: Text input with autocomplete suggestions, keyboard navigation
- Button: Multiple variants (Primary, Secondary, Ghost, Danger, Success,
  Text)
- DropdownButton: Compound button with dropdown menu
- Icon: SVG icons with customizable sizes
- Label: Simple text display
- Panel: Container with optional title
- List: List container
- Modal: Modal dialog
- Divider: Visual separator

Infrastructure:
- Theme system with dark/light modes (Catppuccin colors)
- App module with window management
2025-12-24 19:21:04 -03:00

25 lines
526 B
Rust

use gpui::SharedString;
#[derive(Clone, Debug)]
pub struct Suggestion {
pub label: SharedString,
pub insert: SharedString,
}
impl Suggestion {
pub fn new(label: impl Into<SharedString>, insert: impl Into<SharedString>) -> Self {
Self {
label: label.into(),
insert: insert.into(),
}
}
pub fn simple(text: impl Into<SharedString>) -> Self {
let text = text.into();
Self {
label: text.clone(),
insert: text,
}
}
}