-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 💄 refactored totally UI and functionality
- Loading branch information
1 parent
af4bca6
commit 390d579
Showing
17 changed files
with
521 additions
and
344 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
use inquire::ui::{Attributes, Color, RenderConfig, StyleSheet, Styled}; | ||
use promptuity::themes::FancyTheme; | ||
use promptuity::{Promptuity, Term, Terminal, Theme}; | ||
|
||
/// Generates the config for the TUI | ||
/// | ||
/// Returns a [`RenderConfig`] from the inquire TUI. | ||
pub fn generate_tui_config<'config>() -> RenderConfig<'config> { | ||
let prefix = Styled::new("").with_fg(Color::White); | ||
let selected = Styled::new("►").with_fg(Color::DarkGrey); | ||
let skipped = Styled::new("*skipped*").with_fg(Color::DarkGrey); | ||
let option = StyleSheet::empty().with_fg(Color::DarkGrey); | ||
let selected_option = StyleSheet::empty().with_fg(Color::Grey); | ||
let msg = StyleSheet::empty() | ||
.with_fg(Color::DarkGrey) | ||
.with_attr(Attributes::BOLD); | ||
RenderConfig::default_colored() | ||
.with_prompt_prefix(prefix) | ||
.with_highlighted_option_prefix(selected) | ||
.with_selected_option(Some(selected_option)) | ||
.with_option(option) | ||
.with_canceled_prompt_indicator(skipped) | ||
.with_help_message(msg) | ||
pub fn generate_prompt<'a, W>( | ||
term: &'a mut dyn Terminal<W>, | ||
theme: &'a mut dyn Theme<W>, | ||
) -> Promptuity<'a, W> | ||
where | ||
W: std::io::Write, | ||
{ | ||
Promptuity::new(term, theme) | ||
} | ||
pub fn generate_config() -> (Term<std::io::Stderr>, FancyTheme) { | ||
(Term::default(), FancyTheme::default()) | ||
} |
Oops, something went wrong.