правки интерфейса
This commit is contained in:
10
src/app.rs
10
src/app.rs
@@ -117,7 +117,7 @@ impl App {
|
|||||||
|
|
||||||
fn default_status(&self) -> String {
|
fn default_status(&self) -> String {
|
||||||
match self.playing_index.and_then(|i| self.library.track(i)) {
|
match self.playing_index.and_then(|i| self.library.track(i)) {
|
||||||
Some(t) => format!("{} — {}", self.locales.display_artist(&t.artist), t.title),
|
Some(t) => format!("{} - {}", self.locales.display_artist(&t.artist), t.title),
|
||||||
None => self.locales.t.help.clone(),
|
None => self.locales.t.help.clone(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ impl App {
|
|||||||
self.playing_index = Some(idx);
|
self.playing_index = Some(idx);
|
||||||
self.library.sync_with_playing(idx);
|
self.library.sync_with_playing(idx);
|
||||||
self.player.toggle_pause();
|
self.player.toggle_pause();
|
||||||
let msg = format!("{}: {} — {}",
|
let msg = format!("{}: {} - {}",
|
||||||
self.locales.t.restored,
|
self.locales.t.restored,
|
||||||
self.locales.display_artist(&track.artist),
|
self.locales.display_artist(&track.artist),
|
||||||
track.title);
|
track.title);
|
||||||
@@ -393,7 +393,7 @@ impl App {
|
|||||||
match row {
|
match row {
|
||||||
RightRow::Track { index_in_library } => {
|
RightRow::Track { index_in_library } => {
|
||||||
if let Some(track) = self.library.track(index_in_library).cloned() {
|
if let Some(track) = self.library.track(index_in_library).cloned() {
|
||||||
let name = format!("{} — {}", self.locales.display_artist(&track.artist), track.title);
|
let name = format!("{} - {}", self.locales.display_artist(&track.artist), track.title);
|
||||||
self.deleted_paths.insert(track.path.clone());
|
self.deleted_paths.insert(track.path.clone());
|
||||||
self.raw_tracks.retain(|t| t.path != track.path);
|
self.raw_tracks.retain(|t| t.path != track.path);
|
||||||
if Some(index_in_library) == self.playing_index {
|
if Some(index_in_library) == self.playing_index {
|
||||||
@@ -602,7 +602,7 @@ impl App {
|
|||||||
match self.player.play(&track.path, None) {
|
match self.player.play(&track.path, None) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
self.playing_index = Some(index_in_library);
|
self.playing_index = Some(index_in_library);
|
||||||
self.set_status(format!("{} — {}", self.locales.display_artist(&track.artist), track.title));
|
self.set_status(format!("{} - {}", self.locales.display_artist(&track.artist), track.title));
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let msg = format!("{}: {}", self.locales.t.error, e);
|
let msg = format!("{}: {}", self.locales.t.error, e);
|
||||||
@@ -699,7 +699,7 @@ impl App {
|
|||||||
match self.player.seek_by(delta_secs, total) {
|
match self.player.seek_by(delta_secs, total) {
|
||||||
Ok(new_pos) => {
|
Ok(new_pos) => {
|
||||||
let sign = if delta_secs >= 0 { "+" } else { "" };
|
let sign = if delta_secs >= 0 { "+" } else { "" };
|
||||||
let msg = format!("{} {}{}с → {:02}:{:02}",
|
let msg = format!("{} {}{} → {:02}:{:02}",
|
||||||
self.locales.t.seek, sign, delta_secs,
|
self.locales.t.seek, sign, delta_secs,
|
||||||
new_pos.as_secs() / 60, new_pos.as_secs() % 60);
|
new_pos.as_secs() / 60, new_pos.as_secs() % 60);
|
||||||
self.set_status(msg);
|
self.set_status(msg);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ fn make_album_header(
|
|||||||
|
|
||||||
fn make_track_item(app: &App, index_in_library: usize, area_width: u16) -> ListItem<'static> {
|
fn make_track_item(app: &App, index_in_library: usize, area_width: u16) -> ListItem<'static> {
|
||||||
let is_playing = Some(index_in_library) == app.playing_index;
|
let is_playing = Some(index_in_library) == app.playing_index;
|
||||||
let marker = if is_playing { "♪ " } else { " " };
|
let marker = if is_playing { "* " } else { " " };
|
||||||
|
|
||||||
let (title, num, dur) = match app.library.track(index_in_library) {
|
let (title, num, dur) = match app.library.track(index_in_library) {
|
||||||
Some(t) => (
|
Some(t) => (
|
||||||
@@ -142,7 +142,7 @@ fn make_track_item(app: &App, index_in_library: usize, area_width: u16) -> ListI
|
|||||||
};
|
};
|
||||||
|
|
||||||
let style = if is_playing {
|
let style = if is_playing {
|
||||||
Style::default().fg(Color::Green)
|
Style::default().fg(Color::Rgb(173, 255, 47))
|
||||||
} else {
|
} else {
|
||||||
Style::default()
|
Style::default()
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user