mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-12 16:10:07 +01:00
refactor: HintStyle -> ui/hint_style.rs
This commit is contained in:
parent
da23c89b80
commit
6ba1bd9454
3 changed files with 19 additions and 17 deletions
15
src/ui/hint_style.rs
Normal file
15
src/ui/hint_style.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
/// Describes the style of contrast to be used during rendering of the hint's
|
||||||
|
/// text.
|
||||||
|
///
|
||||||
|
/// # Note
|
||||||
|
/// In practice, this is wrapped in an `Option`, so that the hint's text can be rendered with no style.
|
||||||
|
pub enum HintStyle {
|
||||||
|
/// The hint's text will be bold (leveraging `termion::style::Bold`).
|
||||||
|
Bold,
|
||||||
|
/// The hint's text will be italicized (leveraging `termion::style::Italic`).
|
||||||
|
Italic,
|
||||||
|
/// The hint's text will be underlined (leveraging `termion::style::Underline`).
|
||||||
|
Underline,
|
||||||
|
/// The hint's text will be surrounded by these chars.
|
||||||
|
Surround(char, char),
|
||||||
|
}
|
||||||
|
|
@ -18,9 +18,11 @@
|
||||||
//!
|
//!
|
||||||
|
|
||||||
pub mod colors;
|
pub mod colors;
|
||||||
|
pub mod hint_style;
|
||||||
mod selection;
|
mod selection;
|
||||||
mod vc;
|
mod vc;
|
||||||
|
|
||||||
|
pub use hint_style::HintStyle;
|
||||||
pub use selection::Selection;
|
pub use selection::Selection;
|
||||||
|
pub use vc::HintAlignment;
|
||||||
pub use vc::ViewController;
|
pub use vc::ViewController;
|
||||||
pub use vc::{HintAlignment, HintStyle};
|
|
||||||
|
|
|
||||||
17
src/ui/vc.rs
17
src/ui/vc.rs
|
|
@ -8,6 +8,7 @@ use sequence_trie::SequenceTrie;
|
||||||
use termion::{self, color, cursor, event, style};
|
use termion::{self, color, cursor, event, style};
|
||||||
|
|
||||||
use super::colors::UiColors;
|
use super::colors::UiColors;
|
||||||
|
use super::HintStyle;
|
||||||
use super::Selection;
|
use super::Selection;
|
||||||
use crate::error::ParseError;
|
use crate::error::ParseError;
|
||||||
use crate::{output_destination::OutputDestination, textbuf};
|
use crate::{output_destination::OutputDestination, textbuf};
|
||||||
|
|
@ -629,22 +630,6 @@ impl FromStr for HintAlignment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Describes the style of contrast to be used during rendering of the hint's
|
|
||||||
/// text.
|
|
||||||
///
|
|
||||||
/// # Note
|
|
||||||
/// In practice, this is wrapped in an `Option`, so that the hint's text can be rendered with no style.
|
|
||||||
pub enum HintStyle {
|
|
||||||
/// The hint's text will be bold (leveraging `termion::style::Bold`).
|
|
||||||
Bold,
|
|
||||||
/// The hint's text will be italicized (leveraging `termion::style::Italic`).
|
|
||||||
Italic,
|
|
||||||
/// The hint's text will be underlined (leveraging `termion::style::Underline`).
|
|
||||||
Underline,
|
|
||||||
/// The hint's text will be surrounded by these chars.
|
|
||||||
Surround(char, char),
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returned value after the `Ui` has finished listening to events.
|
/// Returned value after the `Ui` has finished listening to events.
|
||||||
enum Event {
|
enum Event {
|
||||||
/// Exit with no selected matches,
|
/// Exit with no selected matches,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue