feat(infobar): add infobar as 'unique' instance instead manual implementation of infobar via box, label, revealer and button;
This commit is contained in:
parent
cb2a52cc7b
commit
bd394b9bf4
|
@ -1,14 +1,13 @@
|
|||
use crate::model::builder_traits::*;
|
||||
use builders::{BoxBuilder, RevealerBuilder};
|
||||
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::{prelude::*, Revealer, StackTransitionType::SlideLeftRight, *};
|
||||
|
||||
use crate::view::components::pages::Pages;
|
||||
use info_bar::InfoBar;
|
||||
|
||||
#[allow(unused)]
|
||||
use crate::view::{
|
||||
components::{wrapper::*, *},
|
||||
components::{pages::Pages, wrapper::*, *},
|
||||
pages::*,
|
||||
properties::*,
|
||||
};
|
||||
|
@ -24,15 +23,12 @@ pub fn ui(application: &adw::Application) {
|
|||
.spacing(10)
|
||||
.build();
|
||||
|
||||
let info_bar_label = Label::builder().label("test").build();
|
||||
|
||||
let info_bar: Revealer = Revealer::builder()
|
||||
.child(&info_bar_label)
|
||||
.transition_type(RevealerTransitionType::SlideUp)
|
||||
.transition_duration(200)
|
||||
let info_bar = InfoBar::builder()
|
||||
.set_text_label("Sample text")
|
||||
.set_button_icon("close")
|
||||
.build();
|
||||
|
||||
hamming_code::hamming_code_page(&hamming_code, info_bar.clone());
|
||||
hamming_code::hamming_code_page(&hamming_code);
|
||||
|
||||
let signal_reducing = Wrapper::row_builder()
|
||||
.set_align(Alignment::new(Align::Fill, Align::Fill))
|
||||
|
@ -40,7 +36,7 @@ pub fn ui(application: &adw::Application) {
|
|||
.spacing(10)
|
||||
.build();
|
||||
|
||||
signal_reducing::signal_reducing_page(&signal_reducing, info_bar.clone());
|
||||
signal_reducing::signal_reducing_page(&signal_reducing);
|
||||
|
||||
let pages = Pages::builder()
|
||||
.set_transition(SlideLeftRight, 200)
|
||||
|
@ -53,7 +49,7 @@ pub fn ui(application: &adw::Application) {
|
|||
|
||||
let application_box = Box::new(Orientation::Vertical, 0);
|
||||
|
||||
application_box.append(&info_bar);
|
||||
application_box.append(info_bar.clone().get());
|
||||
application_box.append(&pages);
|
||||
|
||||
let window = ApplicationWindow::builder()
|
||||
|
|
Loading…
Reference in New Issue