diff --git a/src/main.rs b/src/main.rs index 9d5f95f..1d0f4ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,9 +73,17 @@ impl eframe::App for JpmmvApp ); }); + let mut title_text_size = 24.0; + + let title_len = self.current_metadata.name.len() as f32; + if title_len > 44.0 + { + title_text_size -= (title_len as f32 - 44.0) / 2.0; + } + ui.style_mut().text_styles.insert( egui::TextStyle::Body, - egui::FontId::new(24.0, eframe::epaint::FontFamily::Proportional), + egui::FontId::new(title_text_size, eframe::epaint::FontFamily::Proportional), ); ui.vertical(|ui| { diff --git a/src/player_interface.rs b/src/player_interface.rs index cb1374a..5927a27 100644 --- a/src/player_interface.rs +++ b/src/player_interface.rs @@ -52,11 +52,8 @@ pub fn get_song_metadata() -> SongMetadata sm.album = split[2].to_string(); sm.art_url = split[3].to_string(); sm.art_url = sm.art_url.trim().to_string(); - sm.is_playing = if status == "paused" { - false - } else { - true - }; + sm.is_playing = if status == "paused" || status == "stopped" + { false } else { true }; // let test_url = sm.art_url.trim_start_matches("file://").to_string();