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.");
|
let content = Content::new(&sender).expect("Content Initialization failed.");
|
||||||
|
|
||||||
// Create the headerbar
|
// 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.
|
// Add the content main stack to the overlay.
|
||||||
let overlay = gtk::Overlay::new();
|
let overlay = gtk::Overlay::new();
|
||||||
|
|||||||
@ -14,6 +14,8 @@ use app::Action;
|
|||||||
use stacks::Content;
|
use stacks::Content;
|
||||||
use utils::{itunes_to_rss, refresh};
|
use utils::{itunes_to_rss, refresh};
|
||||||
|
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
// TODO: split this into smaller
|
// TODO: split this into smaller
|
||||||
pub struct Header {
|
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 {
|
impl Header {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
content: &Content,
|
content: &Content,
|
||||||
window: >k::ApplicationWindow,
|
window: >k::ApplicationWindow,
|
||||||
sender: &Sender<Action>,
|
sender: &Sender<Action>,
|
||||||
) -> Header {
|
) -> Rc<Self> {
|
||||||
let h = Header::default();
|
let h = Rc::new(Header::default());
|
||||||
h.init(content, window, &sender);
|
h.init(content, window, &sender);
|
||||||
h
|
h
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user