mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-04-21 16:01:56 +00:00
Format BorderBreaker changes
This commit is contained in:
parent
2e66df3ad7
commit
1ae83be225
4 changed files with 12 additions and 16 deletions
|
|
@ -462,4 +462,3 @@ impl MainWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,13 @@ use std::{
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use crate::stremio_app::{
|
||||||
|
stremio_player::{BoolProp, FpProp, InMsg, InMsgArgs, InMsgFn, PropKey, PropVal, StrProp},
|
||||||
|
window_helper,
|
||||||
|
};
|
||||||
use flume::Sender;
|
use flume::Sender;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use crate::stremio_app::{
|
|
||||||
stremio_player::{
|
|
||||||
BoolProp, FpProp, InMsg, InMsgArgs, InMsgFn, PropKey, PropVal, StrProp,
|
|
||||||
},
|
|
||||||
window_helper,
|
|
||||||
};
|
|
||||||
|
|
||||||
static CONFIG_DIR: Lazy<PathBuf> = Lazy::new(|| {
|
static CONFIG_DIR: Lazy<PathBuf> = Lazy::new(|| {
|
||||||
env::var("APPDATA")
|
env::var("APPDATA")
|
||||||
|
|
@ -124,7 +122,10 @@ pub struct AspectController {
|
||||||
|
|
||||||
impl AspectController {
|
impl AspectController {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self::with_paths(CONFIG_DIR.join("aspect.json"), window_helper::primary_monitor_ratio())
|
Self::with_paths(
|
||||||
|
CONFIG_DIR.join("aspect.json"),
|
||||||
|
window_helper::primary_monitor_ratio(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_paths(config_path: PathBuf, display_ratio: f32) -> Self {
|
fn with_paths(config_path: PathBuf, display_ratio: f32) -> Self {
|
||||||
|
|
@ -279,11 +280,7 @@ mod tests {
|
||||||
AspectMode::AutoDetect.overlay_label(ratio),
|
AspectMode::AutoDetect.overlay_label(ratio),
|
||||||
format!("Auto ({:.2}:1)", ratio)
|
format!("Auto ({:.2}:1)", ratio)
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(AspectMode::Ratio21x9.overlay_label(ratio), "21:9 Ultrawide");
|
||||||
AspectMode::Ratio21x9.overlay_label(ratio),
|
|
||||||
"21:9 Ultrawide"
|
|
||||||
);
|
|
||||||
assert_eq!(AspectMode::Cinema.overlay_label(ratio), "Cinema");
|
assert_eq!(AspectMode::Cinema.overlay_label(ratio), "Cinema");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ pub mod player;
|
||||||
pub use player::Player;
|
pub use player::Player;
|
||||||
pub mod communication;
|
pub mod communication;
|
||||||
pub use communication::{
|
pub use communication::{
|
||||||
BoolProp, CmdVal, FpProp, InMsg, InMsgArgs, InMsgFn, PlayerEnded, PlayerEvent, PlayerProprChange,
|
BoolProp, CmdVal, FpProp, InMsg, InMsgArgs, InMsgFn, PlayerEnded, PlayerEvent,
|
||||||
PlayerResponse, PropKey, PropVal, StrProp,
|
PlayerProprChange, PlayerResponse, PropKey, PropVal, StrProp,
|
||||||
};
|
};
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod communication_tests;
|
mod communication_tests;
|
||||||
|
|
|
||||||
|
|
@ -163,4 +163,4 @@ pub fn primary_monitor_ratio() -> f32 {
|
||||||
} else {
|
} else {
|
||||||
width / height
|
width / height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue