mirror of
https://github.com/figsoda/mmtc
synced 2024-11-22 15:13:03 +00:00
rename "Plain" to "Text"
This commit is contained in:
parent
d2b794e81f
commit
9e1ec98d17
3 changed files with 13 additions and 13 deletions
16
mmtc.ron
16
mmtc.ron
|
@ -1,9 +1,9 @@
|
||||||
Config(
|
Config(
|
||||||
layout: Rows([
|
layout: Rows([
|
||||||
Fixed(1, Columns([
|
Fixed(1, Columns([
|
||||||
Ratio(5, Textbox(Plain("Title"))),
|
Ratio(5, Textbox(Text("Title"))),
|
||||||
Ratio(4, Textbox(Plain("Artist"))),
|
Ratio(4, Textbox(Text("Artist"))),
|
||||||
Ratio(4, Textbox(Plain("Album"))),
|
Ratio(4, Textbox(Text("Album"))),
|
||||||
])),
|
])),
|
||||||
Free(Queue(
|
Free(Queue(
|
||||||
columns: [
|
columns: [
|
||||||
|
@ -13,19 +13,19 @@ Config(
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
Fixed(1, Textbox(If(Playing, Parts([
|
Fixed(1, Textbox(If(Playing, Parts([
|
||||||
Plain("["),
|
Text("["),
|
||||||
CurrentElapsed,
|
CurrentElapsed,
|
||||||
Plain("/"),
|
Text("/"),
|
||||||
CurrentDuration,
|
CurrentDuration,
|
||||||
Plain("] "),
|
Text("] "),
|
||||||
If(TitleExist,
|
If(TitleExist,
|
||||||
Parts([
|
Parts([
|
||||||
CurrentTitle,
|
CurrentTitle,
|
||||||
If(ArtistExist, Parts([
|
If(ArtistExist, Parts([
|
||||||
Plain(" - "),
|
Text(" - "),
|
||||||
CurrentArtist,
|
CurrentArtist,
|
||||||
If(AlbumExist, Parts([
|
If(AlbumExist, Parts([
|
||||||
Plain(" - "),
|
Text(" - "),
|
||||||
CurrentAlbum,
|
CurrentAlbum,
|
||||||
])),
|
])),
|
||||||
])),
|
])),
|
||||||
|
|
|
@ -44,7 +44,7 @@ pub enum Constrained<T> {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Texts {
|
pub enum Texts {
|
||||||
Empty,
|
Empty,
|
||||||
Plain(String),
|
Text(String),
|
||||||
CurrentElapsed,
|
CurrentElapsed,
|
||||||
CurrentDuration,
|
CurrentDuration,
|
||||||
CurrentFile,
|
CurrentFile,
|
||||||
|
@ -102,7 +102,7 @@ impl<'de> Deserialize<'de> for Texts {
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
#[serde(field_identifier)]
|
#[serde(field_identifier)]
|
||||||
enum Variant {
|
enum Variant {
|
||||||
Plain,
|
Text,
|
||||||
CurrentElapsed,
|
CurrentElapsed,
|
||||||
CurrentDuration,
|
CurrentDuration,
|
||||||
CurrentFile,
|
CurrentFile,
|
||||||
|
@ -177,7 +177,7 @@ impl<'de> Deserialize<'de> for Texts {
|
||||||
}
|
}
|
||||||
|
|
||||||
match variant {
|
match variant {
|
||||||
Variant::Plain => Ok(Texts::Plain(va.newtype_variant()?)),
|
Variant::Text => Ok(Texts::Text(va.newtype_variant()?)),
|
||||||
Variant::CurrentElapsed => unit_variant!(CurrentElapsed),
|
Variant::CurrentElapsed => unit_variant!(CurrentElapsed),
|
||||||
Variant::CurrentDuration => unit_variant!(CurrentDuration),
|
Variant::CurrentDuration => unit_variant!(CurrentDuration),
|
||||||
Variant::CurrentFile => unit_variant!(CurrentFile),
|
Variant::CurrentFile => unit_variant!(CurrentFile),
|
||||||
|
@ -199,7 +199,7 @@ impl<'de> Deserialize<'de> for Texts {
|
||||||
de.deserialize_enum(
|
de.deserialize_enum(
|
||||||
"Texts",
|
"Texts",
|
||||||
&[
|
&[
|
||||||
"Plain",
|
"Text",
|
||||||
"CurrentElapsed",
|
"CurrentElapsed",
|
||||||
"CurrentDuration",
|
"CurrentDuration",
|
||||||
"CurrentFile",
|
"CurrentFile",
|
||||||
|
|
|
@ -187,7 +187,7 @@ fn flatten(
|
||||||
) {
|
) {
|
||||||
match xs {
|
match xs {
|
||||||
Texts::Empty => (),
|
Texts::Empty => (),
|
||||||
Texts::Plain(x) => spans.push(Span::raw(x.clone())),
|
Texts::Text(x) => spans.push(Span::raw(x.clone())),
|
||||||
Texts::CurrentElapsed => {
|
Texts::CurrentElapsed => {
|
||||||
if let Some(Song { elapsed, .. }) = status.song {
|
if let Some(Song { elapsed, .. }) = status.song {
|
||||||
spans.push(Span::raw(format!(
|
spans.push(Span::raw(format!(
|
||||||
|
|
Loading…
Reference in a new issue