Rename PrintStyledFont to PrintStyledContent (#297)

This commit is contained in:
Canop 2019-10-30 07:37:57 +01:00 committed by Timon
parent fe6ddb90f1
commit 4ccc240866
3 changed files with 10 additions and 9 deletions

View File

@ -23,6 +23,7 @@
- `style module` - `style module`
- Rename `ObjectStyle` to `ContentStyle`. Now full names are used for methods. - Rename `ObjectStyle` to `ContentStyle`. Now full names are used for methods.
- Rename `StyledObject` to `StyledContent` and made members private. - Rename `StyledObject` to `StyledContent` and made members private.
- Rename `PrintStyledFont` to `PrintStyledContent`
- Rename `attr` method to `attribute`. - Rename `attr` method to `attribute`.
- Rename `Attribute::NoInverse` to `NoReverse` - Rename `Attribute::NoInverse` to `NoReverse`

View File

@ -132,7 +132,7 @@
//! if (y == 0 || y == 40 - 1) || (x == 0 || x == 150 - 1) { //! if (y == 0 || y == 40 - 1) || (x == 0 || x == 150 - 1) {
//! stdout //! stdout
//! .queue(cursor::MoveTo(x,y))? //! .queue(cursor::MoveTo(x,y))?
//! .queue(style::PrintStyledFont( "█".magenta()))?; //! .queue(style::PrintStyledContent( "█".magenta()))?;
//! } //! }
//! } //! }
//! } //! }
@ -146,7 +146,7 @@
//! ```no_run //! ```no_run
//! use std::io::{stdout, Write}; //! use std::io::{stdout, Write};
//! use crossterm::{ //! use crossterm::{
//! execute, queue, Color, PrintStyledFont, //! execute, queue, Color, PrintStyledContent,
//! Colorize, cursor, terminal, style, Result //! Colorize, cursor, terminal, style, Result
//! }; //! };
//! //!
@ -158,7 +158,7 @@
//! for y in 0..40 { //! for y in 0..40 {
//! for x in 0..150 { //! for x in 0..150 {
//! if (y == 0 || y == 40 - 1) || (x == 0 || x == 150 - 1) { //! if (y == 0 || y == 40 - 1) || (x == 0 || x == 150 - 1) {
//! queue!(stdout, cursor::MoveTo(x,y), style::PrintStyledFont( "█".magenta()))?; //! queue!(stdout, cursor::MoveTo(x,y), style::PrintStyledContent( "█".magenta()))?;
//! } //! }
//! } //! }
//! } //! }
@ -178,8 +178,8 @@ pub use screen::{
}; };
#[cfg(feature = "style")] #[cfg(feature = "style")]
pub use style::{ pub use style::{
color, style, Attribute, Color, Colored, Colorize, ContentStyle, PrintStyledFont, ResetColor, color, style, Attribute, Color, Colored, Colorize, ContentStyle, PrintStyledContent,
SetAttr, SetBg, SetFg, StyledContent, Styler, TerminalColor, ResetColor, SetAttr, SetBg, SetFg, StyledContent, Styler, TerminalColor,
}; };
pub use utils::{Command, ErrorKind, ExecutableCommand, Output, QueueableCommand, Result}; pub use utils::{Command, ErrorKind, ExecutableCommand, Output, QueueableCommand, Result};

View File

@ -372,9 +372,9 @@ impl Command for SetAttr {
/// # Notes /// # Notes
/// ///
/// Commands must be executed/queued for execution otherwise they do nothing. /// Commands must be executed/queued for execution otherwise they do nothing.
pub struct PrintStyledFont<D: Display + Clone>(pub StyledContent<D>); pub struct PrintStyledContent<D: Display + Clone>(pub StyledContent<D>);
impl<D> Command for PrintStyledFont<D> impl<D> Command for PrintStyledContent<D>
where where
D: Display + Clone, D: Display + Clone,
{ {
@ -413,6 +413,6 @@ impl Command for ResetColor {
impl_display!(for SetFg); impl_display!(for SetFg);
impl_display!(for SetBg); impl_display!(for SetBg);
impl_display!(for SetAttr); impl_display!(for SetAttr);
impl_display!(for PrintStyledFont<String>); impl_display!(for PrintStyledContent<String>);
impl_display!(for PrintStyledFont<&'static str>); impl_display!(for PrintStyledContent<&'static str>);
impl_display!(for ResetColor); impl_display!(for ResetColor);