Formatting updates

This commit is contained in:
Zander Brown 2018-05-22 09:55:00 +01:00
parent 9b1097effe
commit 793cafd294
4 changed files with 22 additions and 12 deletions

View File

@ -1,14 +1,16 @@
#![allow(new_without_default)]
use gio::{ApplicationExt, ApplicationExtManual, ApplicationFlags, Settings,
SettingsExt, SimpleAction, SimpleActionExt, ActionMapExt};
use gio::{
ActionMapExt, ApplicationExt, ApplicationExtManual, ApplicationFlags, Settings, SettingsExt,
SimpleAction, SimpleActionExt,
};
use glib;
use gtk;
use gtk::prelude::*;
use gtk::SettingsExt as GtkSettingsExt;
use hammond_data::opml;
use hammond_data::Podcast;
use hammond_data::{opml};
use appnotif::{InAppNotification, UndoState};
use headerbar::Header;

View File

@ -1,7 +1,7 @@
use gio::MenuModel;
use glib;
use gtk;
use gtk::prelude::*;
use gio::MenuModel;
use failure::Error;
use failure::ResultExt;
@ -28,7 +28,7 @@ pub struct Header {
update_spinner: gtk::Spinner,
menu_button: gtk::Button,
menu_popover: gtk::Popover,
app_menu: MenuModel
app_menu: MenuModel,
}
impl Default for Header {
@ -66,15 +66,24 @@ impl Default for Header {
// TODO: Refactor components into smaller state machines
impl Header {
pub fn new(content: &Content, window: &gtk::ApplicationWindow,
sender: &Sender<Action>, local_menu: bool) -> Header {
pub fn new(
content: &Content,
window: &gtk::ApplicationWindow,
sender: &Sender<Action>,
local_menu: bool,
) -> Header {
let h = Header::default();
h.init(content, window, &sender, local_menu);
h
}
pub fn init(&self, content: &Content, window: &gtk::ApplicationWindow,
sender: &Sender<Action>, local_menu: bool) {
pub fn init(
&self,
content: &Content,
window: &gtk::ApplicationWindow,
sender: &Sender<Action>,
local_menu: bool,
) {
let builder = gtk::Builder::new_from_resource("/org/gnome/Hammond/gtk/headerbar.ui");
let add_popover: gtk::Popover = builder.get_object("add_popover").unwrap();
@ -217,4 +226,3 @@ fn on_url_change(
}
}
}

View File

@ -94,4 +94,4 @@ fn main() {
);
App::new().run();
}
}

View File

@ -225,4 +225,4 @@ impl HomeEpisode {
fn set_cover(&self, podcast_id: i32) -> Result<(), Error> {
utils::set_image_from_path(&self.image, podcast_id, 64)
}
}
}