Update to relm4 v0.7.0-rc.1
This commit is contained in:
parent
2e685c630b
commit
616cf987e2
|
@ -2787,9 +2787,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
|
|||
|
||||
[[package]]
|
||||
name = "relm4"
|
||||
version = "0.7.0-beta.2"
|
||||
version = "0.7.0-rc.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f505ac255c34dc85b8b189cbc8e12d012765aa9294727c6082e76777e56a50bf"
|
||||
checksum = "b7497b6d4d07b10f8d5384a657d40fb814de5fc900785322129ec459527c7af1"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"flume 0.11.0",
|
||||
|
@ -2815,9 +2815,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "relm4-macros"
|
||||
version = "0.7.0-beta.1"
|
||||
version = "0.7.0-rc.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7cdf60cdb41e28131b6c0d830db742dc2b9ea311ef319f08cfac28567ec1d938"
|
||||
checksum = "830b999c06b80fc53dac4e1b20382fde949b15cfd3342e71f53fed5346237a4f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
10
Cargo.toml
10
Cargo.toml
|
@ -1,12 +1,12 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"delfin",
|
||||
"video_player_mpv/sys",
|
||||
"video_player_mpv",
|
||||
"video_player_gst",
|
||||
"delfin",
|
||||
"video_player_mpv/sys",
|
||||
"video_player_mpv",
|
||||
"video_player_gst",
|
||||
]
|
||||
exclude = ["video_player_mpv/sys/gir"]
|
||||
default-members = ["delfin"]
|
||||
[workspace.dependencies]
|
||||
relm4 = { version = "0.7.0-beta.2", features = ["gnome_45", "libadwaita"] }
|
||||
relm4 = { version = "0.7.0-rc.1", features = ["gnome_45", "libadwaita"] }
|
||||
|
|
|
@ -101,7 +101,7 @@ impl Component for AccountList {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let accounts = FactoryVecDeque::builder()
|
||||
|
|
|
@ -116,7 +116,7 @@ impl Component for AddAccountDialog {
|
|||
|
||||
fn init(
|
||||
server: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let model = AddAccountDialog {
|
||||
|
|
|
@ -141,7 +141,7 @@ impl Component for App {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
gtk::Window::set_default_icon_name(APP_ID);
|
||||
|
|
|
@ -24,7 +24,7 @@ impl SimpleComponent for About {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let widgets = view_output!();
|
||||
|
|
|
@ -82,7 +82,7 @@ impl Component for BorgarMenu {
|
|||
|
||||
fn init(
|
||||
auth: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = BorgarMenu {
|
||||
|
|
|
@ -70,7 +70,7 @@ impl Component for SignOutDialog {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (api_client, server, account) = init;
|
||||
|
|
|
@ -70,7 +70,7 @@ impl Component for Collection {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (api_client, collection, server, account) = init;
|
||||
|
|
|
@ -34,7 +34,7 @@ impl SimpleComponent for Collections {
|
|||
|
||||
fn init(
|
||||
api_client: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let fetcher = CollectionsFetcher {
|
||||
|
|
|
@ -56,7 +56,7 @@ impl SimpleComponent for Home {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let mut model = Home { sections: vec![] };
|
||||
|
|
|
@ -32,7 +32,7 @@ impl Component for HomeSectionContinueWatching {
|
|||
|
||||
fn init(
|
||||
api_client: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let widgets = view_output!();
|
||||
|
|
|
@ -50,7 +50,7 @@ impl Component for HomeSectionLatest {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let api_client = init.0;
|
||||
|
@ -120,7 +120,7 @@ impl SimpleComponent for LatestRow {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (api_client, view) = init;
|
||||
|
|
|
@ -43,7 +43,7 @@ impl Component for HomeSectionMyMedia {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let HomeSectionMyMediaInit {
|
||||
|
|
|
@ -32,7 +32,7 @@ impl Component for HomeSectionNextUp {
|
|||
|
||||
fn init(
|
||||
api_client: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let widgets = view_output!();
|
||||
|
|
|
@ -39,7 +39,7 @@ impl SimpleComponent for MediaButton {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let (media, display) = init;
|
||||
|
|
|
@ -61,7 +61,7 @@ pub(crate) enum MediaCarouselOutput {
|
|||
}
|
||||
|
||||
impl MediaTileDisplay {
|
||||
fn min_height(&self, pages: &Vec<gtk::Box>) -> i32 {
|
||||
fn min_height(&self, pages: &[gtk::Box]) -> i32 {
|
||||
match pages.len() {
|
||||
1 => self.height() + 50,
|
||||
_ => self.height() + 80,
|
||||
|
@ -185,7 +185,7 @@ impl Component for MediaCarousel {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let MediaCarouselInit {
|
||||
|
|
|
@ -35,7 +35,7 @@ impl SimpleComponent for MediaGrid {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let MediaGridInit {
|
||||
|
|
|
@ -162,7 +162,7 @@ where
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let MediaPageInit {
|
||||
|
|
|
@ -277,7 +277,7 @@ impl Component for Library {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let (server, account, api_client) = init;
|
||||
|
|
|
@ -40,7 +40,7 @@ impl Component for SearchResults {
|
|||
|
||||
fn init(
|
||||
api_client: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = SearchResults {
|
||||
|
@ -168,7 +168,7 @@ impl Component for SearchResultsEmpty {
|
|||
|
||||
fn init(
|
||||
api_client: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = SearchResultsEmpty;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::path::PathBuf;
|
||||
use std::{fmt::Debug, path::PathBuf};
|
||||
|
||||
use anyhow::{bail, Context, Result};
|
||||
use delfin::{
|
||||
|
@ -24,13 +24,13 @@ fn main() {
|
|||
|
||||
let app = RelmApp::new(APP_ID);
|
||||
relm4_icons::initialize_icons();
|
||||
load_css();
|
||||
load_css(&app);
|
||||
app.with_broker(&APP_BROKER).run::<App>(());
|
||||
}
|
||||
|
||||
fn load_css() {
|
||||
fn load_css<T: Debug>(app: &RelmApp<T>) {
|
||||
let css = include_str!(concat!(env!("OUT_DIR"), "/app.css"));
|
||||
relm4::set_global_css(css);
|
||||
app.set_global_css(css);
|
||||
}
|
||||
|
||||
fn load_resources() -> Result<()> {
|
||||
|
|
|
@ -54,7 +54,7 @@ impl SimpleComponent for Episode {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (media, api_client) = init;
|
||||
|
@ -146,7 +146,7 @@ impl Component for EpisodeThumbnail {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (media, api_client) = init;
|
||||
|
|
|
@ -99,7 +99,7 @@ impl AsyncComponent for Episodes {
|
|||
AsyncComponentParts { model, widgets }
|
||||
}
|
||||
|
||||
fn init_loading_widgets(root: &mut Self::Root) -> Option<LoadingWidgets> {
|
||||
fn init_loading_widgets(root: Self::Root) -> Option<LoadingWidgets> {
|
||||
view! {
|
||||
#[local_ref]
|
||||
root {
|
||||
|
|
|
@ -74,7 +74,7 @@ impl AsyncComponent for MediaDetailsContents {
|
|||
}
|
||||
}
|
||||
|
||||
fn init_loading_widgets(root: &mut Self::Root) -> Option<LoadingWidgets> {
|
||||
fn init_loading_widgets(root: Self::Root) -> Option<LoadingWidgets> {
|
||||
view! {
|
||||
#[local_ref]
|
||||
root {
|
||||
|
|
|
@ -187,7 +187,7 @@ impl Component for MediaDetailsHeader {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let MediaDetailsHeaderInit {
|
||||
|
|
|
@ -79,7 +79,7 @@ impl SimpleComponent for MediaDetails {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (api_client, media, server, account) = init;
|
||||
|
|
|
@ -24,7 +24,7 @@ impl SimpleComponent for SeasonButtons {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
seasons_box: &Self::Root,
|
||||
seasons_box: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (seasons, initial_selected_season_index) = init;
|
||||
|
|
|
@ -53,7 +53,7 @@ impl AsyncComponent for Seasons {
|
|||
}
|
||||
}
|
||||
|
||||
fn init_loading_widgets(root: &mut Self::Root) -> Option<LoadingWidgets> {
|
||||
fn init_loading_widgets(root: Self::Root) -> Option<LoadingWidgets> {
|
||||
view! {
|
||||
#[local_ref]
|
||||
root {
|
||||
|
|
|
@ -97,7 +97,7 @@ impl SimpleComponent for GeneralPreferences {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let config = CONFIG.read();
|
||||
|
|
|
@ -35,7 +35,7 @@ impl SimpleComponent for Preferences {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = Preferences {
|
||||
|
|
|
@ -179,7 +179,7 @@ impl Component for VideoPlayerPreferences {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let config = CONFIG.read();
|
||||
|
|
|
@ -190,7 +190,7 @@ impl SimpleComponent for SubtitlesPreferences {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = SubtitlesPreferences {
|
||||
|
|
|
@ -120,7 +120,7 @@ impl Component for AddServerDialog {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = AddServerDialog {
|
||||
|
|
|
@ -92,7 +92,7 @@ impl Component for ServerList {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let servers = FactoryVecDeque::builder()
|
||||
|
|
|
@ -17,7 +17,7 @@ impl SimpleComponent for EmptyComponent {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
_sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = EmptyComponent;
|
||||
|
|
|
@ -55,7 +55,7 @@ impl Component for AudioTracks {
|
|||
|
||||
fn init(
|
||||
video_player: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = AudioTracks {
|
||||
|
|
|
@ -55,7 +55,7 @@ impl SimpleComponent for Fullscreen {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let window = get_main_window().expect("Failed to get main window.");
|
||||
|
|
|
@ -126,7 +126,7 @@ impl SimpleComponent for VideoPlayerControls {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let VideoPlayerControlsInit {
|
||||
|
|
|
@ -75,7 +75,7 @@ impl SimpleComponent for NextPrevEpisode {
|
|||
|
||||
fn init(
|
||||
direction: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = NextPrevEpisode {
|
||||
|
|
|
@ -54,7 +54,7 @@ impl SimpleComponent for PlayPause {
|
|||
|
||||
fn init(
|
||||
video_player: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = PlayPause {
|
||||
|
|
|
@ -169,7 +169,7 @@ impl Component for Scrubber {
|
|||
|
||||
fn init(
|
||||
video_player: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
video_player.borrow_mut().connect_position_updated({
|
||||
|
|
|
@ -81,7 +81,7 @@ impl SimpleComponent for SkipForwardsBackwards {
|
|||
|
||||
fn init(
|
||||
init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let (direction, player) = init;
|
||||
|
|
|
@ -87,7 +87,7 @@ impl Component for Subtitles {
|
|||
|
||||
fn init(
|
||||
video_player: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let model = Subtitles {
|
||||
|
|
|
@ -86,7 +86,7 @@ impl SimpleComponent for Volume {
|
|||
|
||||
fn init(
|
||||
video_player: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let config = CONFIG.read();
|
||||
|
|
|
@ -200,7 +200,7 @@ impl Component for VideoPlayer {
|
|||
|
||||
fn init(
|
||||
_init: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: relm4::ComponentSender<Self>,
|
||||
) -> relm4::ComponentParts<Self> {
|
||||
let show_controls = true;
|
||||
|
|
|
@ -179,7 +179,7 @@ impl Component for NextUp {
|
|||
|
||||
fn init(
|
||||
video_player: Self::Init,
|
||||
root: &Self::Root,
|
||||
root: Self::Root,
|
||||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let model = NextUp {
|
||||
|
|
Loading…
Reference in New Issue