pub mod button;
pub mod dropdown;
pub mod keybinding_list;
pub mod map_input;
pub mod number_input;
pub mod text_input;
pub mod text_list;
pub mod toggle;
pub use button::{
render_button, render_button_row, ButtonColors, ButtonEvent, ButtonLayout, ButtonState,
};
pub use dropdown::{
render_dropdown, render_dropdown_aligned, DropdownColors, DropdownEvent, DropdownLayout,
DropdownState,
};
pub use keybinding_list::{
render_keybinding_list, KeybindingListColors, KeybindingListEvent, KeybindingListLayout,
KeybindingListState,
};
pub use map_input::{render_map, MapColors, MapEvent, MapLayout, MapState};
pub use number_input::{
render_number_input, render_number_input_aligned, NumberInputColors, NumberInputEvent,
NumberInputLayout, NumberInputState,
};
pub use text_input::{
render_text_input, render_text_input_aligned, TextInputColors, TextInputEvent, TextInputLayout,
TextInputState,
};
pub use text_list::{
render_text_list, TextListColors, TextListEvent, TextListLayout, TextListState,
};
pub use toggle::{
render_toggle, render_toggle_aligned, ToggleColors, ToggleEvent, ToggleLayout, ToggleState,
};
use ratatui::style::Color;
#[derive(Debug, Clone, Copy)]
pub struct ControlColors {
pub bg: Color,
pub fg: Color,
pub border: Color,
pub accent: Color,
pub disabled: Color,
}
impl Default for ControlColors {
fn default() -> Self {
Self {
bg: Color::Black,
fg: Color::White,
border: Color::DarkGray,
accent: Color::Cyan,
disabled: Color::DarkGray,
}
}
}
impl ControlColors {
pub fn from_theme(theme: &crate::view::theme::Theme) -> Self {
Self {
bg: theme.editor_bg,
fg: theme.editor_fg,
border: theme.split_separator_fg,
accent: theme.selection_bg,
disabled: theme.line_number_fg,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum FocusState {
#[default]
Normal,
Focused,
Hovered,
Disabled,
}