Formatting updates
This commit is contained in:
parent
9b1097effe
commit
793cafd294
@ -1,14 +1,16 @@
|
|||||||
#![allow(new_without_default)]
|
#![allow(new_without_default)]
|
||||||
|
|
||||||
use gio::{ApplicationExt, ApplicationExtManual, ApplicationFlags, Settings,
|
use gio::{
|
||||||
SettingsExt, SimpleAction, SimpleActionExt, ActionMapExt};
|
ActionMapExt, ApplicationExt, ApplicationExtManual, ApplicationFlags, Settings, SettingsExt,
|
||||||
|
SimpleAction, SimpleActionExt,
|
||||||
|
};
|
||||||
use glib;
|
use glib;
|
||||||
use gtk;
|
use gtk;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::SettingsExt as GtkSettingsExt;
|
use gtk::SettingsExt as GtkSettingsExt;
|
||||||
|
|
||||||
|
use hammond_data::opml;
|
||||||
use hammond_data::Podcast;
|
use hammond_data::Podcast;
|
||||||
use hammond_data::{opml};
|
|
||||||
|
|
||||||
use appnotif::{InAppNotification, UndoState};
|
use appnotif::{InAppNotification, UndoState};
|
||||||
use headerbar::Header;
|
use headerbar::Header;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
use gio::MenuModel;
|
||||||
use glib;
|
use glib;
|
||||||
use gtk;
|
use gtk;
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gio::MenuModel;
|
|
||||||
|
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
use failure::ResultExt;
|
use failure::ResultExt;
|
||||||
@ -28,7 +28,7 @@ pub struct Header {
|
|||||||
update_spinner: gtk::Spinner,
|
update_spinner: gtk::Spinner,
|
||||||
menu_button: gtk::Button,
|
menu_button: gtk::Button,
|
||||||
menu_popover: gtk::Popover,
|
menu_popover: gtk::Popover,
|
||||||
app_menu: MenuModel
|
app_menu: MenuModel,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Header {
|
impl Default for Header {
|
||||||
@ -66,15 +66,24 @@ impl Default for Header {
|
|||||||
|
|
||||||
// TODO: Refactor components into smaller state machines
|
// TODO: Refactor components into smaller state machines
|
||||||
impl Header {
|
impl Header {
|
||||||
pub fn new(content: &Content, window: >k::ApplicationWindow,
|
pub fn new(
|
||||||
sender: &Sender<Action>, local_menu: bool) -> Header {
|
content: &Content,
|
||||||
|
window: >k::ApplicationWindow,
|
||||||
|
sender: &Sender<Action>,
|
||||||
|
local_menu: bool,
|
||||||
|
) -> Header {
|
||||||
let h = Header::default();
|
let h = Header::default();
|
||||||
h.init(content, window, &sender, local_menu);
|
h.init(content, window, &sender, local_menu);
|
||||||
h
|
h
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(&self, content: &Content, window: >k::ApplicationWindow,
|
pub fn init(
|
||||||
sender: &Sender<Action>, local_menu: bool) {
|
&self,
|
||||||
|
content: &Content,
|
||||||
|
window: >k::ApplicationWindow,
|
||||||
|
sender: &Sender<Action>,
|
||||||
|
local_menu: bool,
|
||||||
|
) {
|
||||||
let builder = gtk::Builder::new_from_resource("/org/gnome/Hammond/gtk/headerbar.ui");
|
let builder = gtk::Builder::new_from_resource("/org/gnome/Hammond/gtk/headerbar.ui");
|
||||||
|
|
||||||
let add_popover: gtk::Popover = builder.get_object("add_popover").unwrap();
|
let add_popover: gtk::Popover = builder.get_object("add_popover").unwrap();
|
||||||
@ -217,4 +226,3 @@ fn on_url_change(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user