feat(info bar): add info bar for warnings
This commit is contained in:
parent
7264b704d0
commit
682682eb13
|
@ -1,7 +1,8 @@
|
|||
use crate::model::builder_traits::*;
|
||||
use builders::{BoxBuilder, RevealerBuilder};
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::{prelude::*, StackTransitionType::SlideLeftRight, *};
|
||||
use gtk::{prelude::*, Revealer, StackTransitionType::SlideLeftRight, *};
|
||||
|
||||
use crate::view::components::pages::Pages;
|
||||
|
||||
|
@ -12,14 +13,26 @@ use crate::view::{
|
|||
properties::*,
|
||||
};
|
||||
|
||||
use super::styles::load_css;
|
||||
|
||||
pub fn ui(application: &adw::Application) {
|
||||
load_css();
|
||||
|
||||
let hamming_code = Wrapper::row_builder()
|
||||
.set_align(Alignment::new(Align::Fill, Align::Fill))
|
||||
.set_margin(MarginData::EqualsMargin(15))
|
||||
.spacing(10)
|
||||
.build();
|
||||
|
||||
hamming_code::hamming_code_page(&hamming_code);
|
||||
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)
|
||||
.build();
|
||||
|
||||
hamming_code::hamming_code_page(&hamming_code, info_bar.clone());
|
||||
|
||||
let signal_reducing = Wrapper::row_builder()
|
||||
.set_align(Alignment::new(Align::Fill, Align::Fill))
|
||||
|
@ -27,7 +40,7 @@ pub fn ui(application: &adw::Application) {
|
|||
.spacing(10)
|
||||
.build();
|
||||
|
||||
signal_reducing::signal_reducing_page(&signal_reducing);
|
||||
signal_reducing::signal_reducing_page(&signal_reducing, info_bar.clone());
|
||||
|
||||
let pages = Pages::builder()
|
||||
.set_transition(SlideLeftRight, 200)
|
||||
|
@ -38,12 +51,17 @@ pub fn ui(application: &adw::Application) {
|
|||
.build(5)
|
||||
.get();
|
||||
|
||||
let application_box = Box::new(Orientation::Vertical, 0);
|
||||
|
||||
application_box.append(&info_bar);
|
||||
application_box.append(&pages);
|
||||
|
||||
let window = ApplicationWindow::builder()
|
||||
.title("Комплексная программа для лаб. работ")
|
||||
.width_request(700)
|
||||
.height_request(400)
|
||||
.application(application)
|
||||
.child(&pages)
|
||||
.child(&application_box)
|
||||
.build();
|
||||
|
||||
window.show();
|
||||
|
|
Loading…
Reference in New Issue