Headerbar: ::new() method now returns Rc<Self>.
This commit is contained in:
parent
301ebdbcd8
commit
5d6fbb6f04
@ -88,7 +88,7 @@ impl App {
|
||||
let content = Content::new(&sender).expect("Content Initialization failed.");
|
||||
|
||||
// Create the headerbar
|
||||
let header = Rc::new(Header::new(&content, &window, &sender));
|
||||
let header = Header::new(&content, &window, &sender);
|
||||
|
||||
// Add the content main stack to the overlay.
|
||||
let overlay = gtk::Overlay::new();
|
||||
|
||||
@ -14,6 +14,8 @@ use app::Action;
|
||||
use stacks::Content;
|
||||
use utils::{itunes_to_rss, refresh};
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
// TODO: split this into smaller
|
||||
pub struct Header {
|
||||
@ -60,14 +62,14 @@ impl Default for Header {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Refactor components into smaller state machines
|
||||
// TODO: Refactor components into smaller widgets.
|
||||
impl Header {
|
||||
pub fn new(
|
||||
content: &Content,
|
||||
window: >k::ApplicationWindow,
|
||||
sender: &Sender<Action>,
|
||||
) -> Header {
|
||||
let h = Header::default();
|
||||
) -> Rc<Self> {
|
||||
let h = Rc::new(Header::default());
|
||||
h.init(content, window, &sender);
|
||||
h
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user