Compare commits

..

2 commits

Author SHA1 Message Date
015da43d1b Bump version to 0.4.11 2024-06-23 20:59:43 +09:00
773587b664 Fix not quitting when requested, cargo fmt 2024-06-23 20:56:54 +09:00
4 changed files with 6 additions and 10 deletions

2
Cargo.lock generated
View file

@ -1616,7 +1616,7 @@ dependencies = [
[[package]] [[package]]
name = "mpd_info_screen" name = "mpd_info_screen"
version = "0.4.10" version = "0.4.11"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"clap", "clap",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "mpd_info_screen" name = "mpd_info_screen"
version = "0.4.10" version = "0.4.11"
edition = "2021" edition = "2021"
description = "Displays info on currently playing music from an MPD daemon" description = "Displays info on currently playing music from an MPD daemon"
license = "MIT" license = "MIT"

View file

@ -1,5 +1,5 @@
use std::fmt::Display;
use clap::ValueEnum; use clap::ValueEnum;
use std::fmt::Display;
#[derive(Copy, Clone, Debug, PartialEq, Eq)] #[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum LogState { pub enum LogState {

View file

@ -4,6 +4,7 @@ mod mpd_handler;
#[cfg(feature = "unicode_support")] #[cfg(feature = "unicode_support")]
mod unicode_support; mod unicode_support;
use clap::Parser;
use ggez::conf::{WindowMode, WindowSetup}; use ggez::conf::{WindowMode, WindowSetup};
use ggez::event::winit_event::{ElementState, KeyboardInput, ModifiersState}; use ggez::event::winit_event::{ElementState, KeyboardInput, ModifiersState};
use ggez::event::{self, ControlFlow, EventHandler}; use ggez::event::{self, ControlFlow, EventHandler};
@ -15,7 +16,6 @@ use std::net::Ipv4Addr;
use std::path::PathBuf; use std::path::PathBuf;
use std::thread; use std::thread;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use clap::Parser;
use debug_log::log; use debug_log::log;
@ -44,11 +44,7 @@ pub struct Opt {
help = "don't scale-fill the album art to the window" help = "don't scale-fill the album art to the window"
)] )]
do_not_fill_scale_album_art: bool, do_not_fill_scale_album_art: bool,
#[arg( #[arg(short = 'l', long = "log-level", default_value = "error")]
short = 'l',
long = "log-level",
default_value = "error",
)]
log_level: debug_log::LogLevel, log_level: debug_log::LogLevel,
#[arg( #[arg(
short, short,
@ -101,7 +97,7 @@ fn main() -> Result<(), String> {
let mut modifiers_state: ModifiersState = ModifiersState::default(); let mut modifiers_state: ModifiersState = ModifiersState::default();
event_loop.run(move |mut event, _window_target, control_flow| { event_loop.run(move |mut event, _window_target, control_flow| {
if !ctx.continuing { if !ctx.continuing || ctx.quit_requested {
*control_flow = ControlFlow::Exit; *control_flow = ControlFlow::Exit;
return; return;
} }