From 793cafd29498ea9c21bea0ba535afef229650dc1 Mon Sep 17 00:00:00 2001 From: Zander Brown Date: Tue, 22 May 2018 09:55:00 +0100 Subject: [PATCH] Formatting updates --- hammond-gtk/src/app.rs | 8 +++++--- hammond-gtk/src/headerbar.rs | 22 +++++++++++++++------- hammond-gtk/src/main.rs | 2 +- hammond-gtk/src/widgets/home_view.rs | 2 +- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/hammond-gtk/src/app.rs b/hammond-gtk/src/app.rs index f9ef7f1..dc2e7fc 100644 --- a/hammond-gtk/src/app.rs +++ b/hammond-gtk/src/app.rs @@ -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; diff --git a/hammond-gtk/src/headerbar.rs b/hammond-gtk/src/headerbar.rs index 7632fe0..06dd436 100644 --- a/hammond-gtk/src/headerbar.rs +++ b/hammond-gtk/src/headerbar.rs @@ -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: >k::ApplicationWindow, - sender: &Sender, local_menu: bool) -> Header { + pub fn new( + content: &Content, + window: >k::ApplicationWindow, + sender: &Sender, + local_menu: bool, + ) -> Header { let h = Header::default(); h.init(content, window, &sender, local_menu); h } - pub fn init(&self, content: &Content, window: >k::ApplicationWindow, - sender: &Sender, local_menu: bool) { + pub fn init( + &self, + content: &Content, + window: >k::ApplicationWindow, + sender: &Sender, + 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( } } } - diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index 83114fe..c8d4227 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -94,4 +94,4 @@ fn main() { ); App::new().run(); -} \ No newline at end of file +} diff --git a/hammond-gtk/src/widgets/home_view.rs b/hammond-gtk/src/widgets/home_view.rs index d98abff..b0321c5 100644 --- a/hammond-gtk/src/widgets/home_view.rs +++ b/hammond-gtk/src/widgets/home_view.rs @@ -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) } -} \ No newline at end of file +}