rename "Plain" to "Text"

This commit is contained in:
figsoda 2020-10-30 17:09:22 -04:00
parent d2b794e81f
commit 9e1ec98d17
3 changed files with 13 additions and 13 deletions

View file

@ -1,9 +1,9 @@
Config(
layout: Rows([
Fixed(1, Columns([
Ratio(5, Textbox(Plain("Title"))),
Ratio(4, Textbox(Plain("Artist"))),
Ratio(4, Textbox(Plain("Album"))),
Ratio(5, Textbox(Text("Title"))),
Ratio(4, Textbox(Text("Artist"))),
Ratio(4, Textbox(Text("Album"))),
])),
Free(Queue(
columns: [
@ -13,19 +13,19 @@ Config(
],
)),
Fixed(1, Textbox(If(Playing, Parts([
Plain("["),
Text("["),
CurrentElapsed,
Plain("/"),
Text("/"),
CurrentDuration,
Plain("] "),
Text("] "),
If(TitleExist,
Parts([
CurrentTitle,
If(ArtistExist, Parts([
Plain(" - "),
Text(" - "),
CurrentArtist,
If(AlbumExist, Parts([
Plain(" - "),
Text(" - "),
CurrentAlbum,
])),
])),

View file

@ -44,7 +44,7 @@ pub enum Constrained<T> {
#[derive(Debug)]
pub enum Texts {
Empty,
Plain(String),
Text(String),
CurrentElapsed,
CurrentDuration,
CurrentFile,
@ -102,7 +102,7 @@ impl<'de> Deserialize<'de> for Texts {
#[derive(Deserialize)]
#[serde(field_identifier)]
enum Variant {
Plain,
Text,
CurrentElapsed,
CurrentDuration,
CurrentFile,
@ -177,7 +177,7 @@ impl<'de> Deserialize<'de> for Texts {
}
match variant {
Variant::Plain => Ok(Texts::Plain(va.newtype_variant()?)),
Variant::Text => Ok(Texts::Text(va.newtype_variant()?)),
Variant::CurrentElapsed => unit_variant!(CurrentElapsed),
Variant::CurrentDuration => unit_variant!(CurrentDuration),
Variant::CurrentFile => unit_variant!(CurrentFile),
@ -199,7 +199,7 @@ impl<'de> Deserialize<'de> for Texts {
de.deserialize_enum(
"Texts",
&[
"Plain",
"Text",
"CurrentElapsed",
"CurrentDuration",
"CurrentFile",

View file

@ -187,7 +187,7 @@ fn flatten(
) {
match xs {
Texts::Empty => (),
Texts::Plain(x) => spans.push(Span::raw(x.clone())),
Texts::Text(x) => spans.push(Span::raw(x.clone())),
Texts::CurrentElapsed => {
if let Some(Song { elapsed, .. }) = status.song {
spans.push(Span::raw(format!(