mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
remove extra component
This commit is contained in:
parent
b04bb0ab54
commit
10539a1d30
3 changed files with 12 additions and 42 deletions
|
|
@ -67,7 +67,7 @@ impl Item {
|
||||||
|
|
||||||
let widget = Rc::new(Widget::build(
|
let widget = Rc::new(Widget::build(
|
||||||
tab_view,
|
tab_view,
|
||||||
&page.widget.g_box,
|
&page.g_box,
|
||||||
None,
|
None,
|
||||||
position,
|
position,
|
||||||
(is_pinned, is_selected, is_attention),
|
(is_pinned, is_selected, is_attention),
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,16 @@ mod error;
|
||||||
mod input;
|
mod input;
|
||||||
mod navigation;
|
mod navigation;
|
||||||
mod search;
|
mod search;
|
||||||
mod widget;
|
|
||||||
|
|
||||||
use super::{Action as ItemAction, BrowserAction, Profile, TabAction, WindowAction};
|
use super::{Action as ItemAction, BrowserAction, Profile, TabAction, WindowAction};
|
||||||
use content::Content;
|
use content::Content;
|
||||||
use error::Error;
|
use error::Error;
|
||||||
|
use gtk::{prelude::BoxExt, Box, Orientation};
|
||||||
use input::Input;
|
use input::Input;
|
||||||
use navigation::Navigation;
|
use navigation::Navigation;
|
||||||
use search::Search;
|
use search::Search;
|
||||||
use sqlite::Transaction;
|
use sqlite::Transaction;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use widget::Widget;
|
|
||||||
|
|
||||||
pub struct Page {
|
pub struct Page {
|
||||||
pub profile: Rc<Profile>,
|
pub profile: Rc<Profile>,
|
||||||
|
|
@ -27,7 +26,7 @@ pub struct Page {
|
||||||
pub search: Rc<Search>,
|
pub search: Rc<Search>,
|
||||||
pub input: Rc<Input>,
|
pub input: Rc<Input>,
|
||||||
pub navigation: Rc<Navigation>,
|
pub navigation: Rc<Navigation>,
|
||||||
pub widget: Rc<Widget>,
|
pub g_box: Box,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Page {
|
impl Page {
|
||||||
|
|
@ -54,12 +53,13 @@ impl Page {
|
||||||
|
|
||||||
let input = Rc::new(Input::new());
|
let input = Rc::new(Input::new());
|
||||||
|
|
||||||
let widget = Rc::new(Widget::build(
|
// Init main widget
|
||||||
&navigation.g_box,
|
let g_box = Box::builder().orientation(Orientation::Vertical).build();
|
||||||
&content.g_box,
|
|
||||||
&search.g_box,
|
g_box.append(&navigation.g_box);
|
||||||
&input.clamp,
|
g_box.append(&content.g_box);
|
||||||
));
|
g_box.append(&search.g_box);
|
||||||
|
g_box.append(&input.clamp);
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -73,7 +73,8 @@ impl Page {
|
||||||
search,
|
search,
|
||||||
input,
|
input,
|
||||||
navigation,
|
navigation,
|
||||||
widget,
|
// Widget
|
||||||
|
g_box,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
use gtk::{
|
|
||||||
prelude::{BoxExt, IsA},
|
|
||||||
Box, Orientation,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct Widget {
|
|
||||||
pub g_box: Box,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Widget {
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
/// Build new `Self`
|
|
||||||
pub fn build(
|
|
||||||
// Components
|
|
||||||
navigation: &impl IsA<gtk::Widget>,
|
|
||||||
content: &impl IsA<gtk::Widget>,
|
|
||||||
search: &impl IsA<gtk::Widget>,
|
|
||||||
input: &impl IsA<gtk::Widget>,
|
|
||||||
) -> Self {
|
|
||||||
// Init self
|
|
||||||
let g_box = Box::builder().orientation(Orientation::Vertical).build();
|
|
||||||
|
|
||||||
g_box.append(navigation);
|
|
||||||
g_box.append(content);
|
|
||||||
g_box.append(search);
|
|
||||||
g_box.append(input);
|
|
||||||
|
|
||||||
Self { g_box }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue