Forgot to cargo fmt
This commit is contained in:
parent
25289fbb5f
commit
938d1be04b
@ -26,8 +26,8 @@ use glib::subclass::prelude::*;
|
||||
use glib::translate::*;
|
||||
use glib::{glib_object_impl, glib_object_subclass, glib_object_wrapper, glib_wrapper};
|
||||
|
||||
use gio::{self, prelude::*, ActionMapExt, ApplicationFlags, SettingsExt};
|
||||
use gio::subclass::application::ApplicationImplExt;
|
||||
use gio::{self, prelude::*, ActionMapExt, ApplicationFlags, SettingsExt};
|
||||
|
||||
use gtk;
|
||||
use gtk::prelude::*;
|
||||
@ -39,7 +39,7 @@ use fragile::Fragile;
|
||||
use podcasts_data::Show;
|
||||
|
||||
use crate::settings;
|
||||
use crate::stacks::{PopulatedState};
|
||||
use crate::stacks::PopulatedState;
|
||||
use crate::utils;
|
||||
use crate::widgets::appnotif::{InAppNotification, SpinnerState, State};
|
||||
use crate::widgets::show_menu::{mark_all_notif, remove_show_notif, ShowMenu};
|
||||
@ -54,7 +54,7 @@ use crate::i18n::i18n;
|
||||
|
||||
pub struct HmdApplicationPrivate {
|
||||
window: RefCell<Option<MainWindow>>,
|
||||
settings: RefCell<Option<gio::Settings>>
|
||||
settings: RefCell<Option<gio::Settings>>,
|
||||
}
|
||||
|
||||
impl ObjectSubclass for HmdApplicationPrivate {
|
||||
@ -219,8 +219,10 @@ impl HmdApplication {
|
||||
Action::ShowWidgetAnimated => {
|
||||
let shows = window.content.get_shows();
|
||||
let pop = shows.borrow().populated();
|
||||
pop.borrow_mut()
|
||||
.switch_visible(PopulatedState::Widget, gtk::StackTransitionType::SlideLeft);
|
||||
pop.borrow_mut().switch_visible(
|
||||
PopulatedState::Widget,
|
||||
gtk::StackTransitionType::SlideLeft,
|
||||
);
|
||||
}
|
||||
Action::ShowShowsAnimated => {
|
||||
let shows = window.content.get_shows();
|
||||
@ -269,7 +271,8 @@ impl HmdApplication {
|
||||
|
||||
let old = window.updater.replace(Some(updater));
|
||||
old.map(|i| i.destroy());
|
||||
window.updater
|
||||
window
|
||||
.updater
|
||||
.borrow()
|
||||
.as_ref()
|
||||
.map(|i| i.show(&window.overlay));
|
||||
@ -283,7 +286,8 @@ impl HmdApplication {
|
||||
window.headerbar.set_secondary_menu(menu);
|
||||
}
|
||||
Action::EmptyState => {
|
||||
window.window
|
||||
window
|
||||
.window
|
||||
.lookup_action("refresh")
|
||||
.and_then(|action| action.downcast::<gio::SimpleAction>().ok())
|
||||
// Disable refresh action
|
||||
@ -293,7 +297,8 @@ impl HmdApplication {
|
||||
window.content.switch_to_empty_views();
|
||||
}
|
||||
Action::PopulatedState => {
|
||||
window.window
|
||||
window
|
||||
.window
|
||||
.lookup_action("refresh")
|
||||
.and_then(|action| action.downcast::<gio::SimpleAction>().ok())
|
||||
// Enable refresh action
|
||||
|
||||
@ -27,6 +27,7 @@ use gtk::prelude::*;
|
||||
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
|
||||
use crate::app::{Action, HmdApplication};
|
||||
use crate::headerbar::Header;
|
||||
use crate::settings::{self, WindowGeometry};
|
||||
use crate::stacks::Content;
|
||||
@ -34,11 +35,10 @@ use crate::utils;
|
||||
use crate::widgets::about_dialog;
|
||||
use crate::widgets::appnotif::InAppNotification;
|
||||
use crate::widgets::player;
|
||||
use crate::app::{Action, HmdApplication};
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::config::APP_ID;
|
||||
use crate::i18n::i18n;
|
||||
@ -71,7 +71,7 @@ pub struct MainWindow {
|
||||
}
|
||||
|
||||
impl MainWindow {
|
||||
pub fn new (app: &HmdApplication) -> Self {
|
||||
pub fn new(app: &HmdApplication) -> Self {
|
||||
let settings = gio::Settings::new("org.gnome.Podcasts");
|
||||
|
||||
let (sender, receiver) = unbounded();
|
||||
@ -220,4 +220,3 @@ impl Deref for MainWindow {
|
||||
&self.window
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user