mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
implement separated mod for window widget, rename getters
This commit is contained in:
parent
13292a977d
commit
1e00c5930c
5 changed files with 58 additions and 64 deletions
|
|
@ -1,14 +1,16 @@
|
|||
mod tab;
|
||||
mod widget;
|
||||
|
||||
use tab::Tab;
|
||||
use widget::Widget;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use tab::Tab;
|
||||
|
||||
use gtk::{gio::SimpleAction, glib::GString, prelude::BoxExt, Box, Orientation};
|
||||
use gtk::{gio::SimpleAction, glib::GString, Box};
|
||||
|
||||
pub struct Window {
|
||||
tab: Arc<Tab>,
|
||||
widget: Box,
|
||||
widget: Arc<Widget>,
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
@ -32,9 +34,7 @@ impl Window {
|
|||
tab.append(Some(GString::from("gemini://geminiprotocol.net/")), true); // demo tab @TODO replace with session restore feature
|
||||
|
||||
// GTK
|
||||
let widget = Box::builder().orientation(Orientation::Vertical).build();
|
||||
|
||||
widget.append(tab.widget());
|
||||
let widget = Arc::new(Widget::new(tab.widget()));
|
||||
|
||||
// Init struct
|
||||
Self { tab, widget }
|
||||
|
|
@ -86,7 +86,7 @@ impl Window {
|
|||
self.tab.page_description()
|
||||
}
|
||||
|
||||
pub fn widget(&self) -> &Box {
|
||||
&self.widget
|
||||
pub fn widget_gobject(&self) -> &Box {
|
||||
&self.widget.gobject()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue