changed inputs for second section and implemented Clone and Copy traits for Alignment data structure
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
use gtk4 as gtk;
|
||||
|
||||
use crate::{
|
||||
view::properties::*,
|
||||
model::builder_traits::*
|
||||
};
|
||||
use gtk::{*, prelude::*};
|
||||
use crate::{model::builder_traits::*, view::properties::*};
|
||||
use gtk::{prelude::*, *};
|
||||
|
||||
pub type InputLabel = String;
|
||||
|
||||
pub struct Input {
|
||||
component: Box
|
||||
component: Box,
|
||||
}
|
||||
|
||||
pub struct InputBuilder {
|
||||
align: Align,
|
||||
align: Alignment,
|
||||
label: InputLabel,
|
||||
margins: MarginData,
|
||||
}
|
||||
@@ -21,7 +18,10 @@ pub struct InputBuilder {
|
||||
impl Product<InputBuilder, Box> for Input {
|
||||
fn builder() -> InputBuilder {
|
||||
InputBuilder {
|
||||
align: Align::Start,
|
||||
align: Alignment {
|
||||
horizontal: Align::Start,
|
||||
vertical: Align::Start,
|
||||
},
|
||||
label: String::new(),
|
||||
margins: MarginData::EqualsMargin(5),
|
||||
}
|
||||
@@ -33,37 +33,30 @@ impl Product<InputBuilder, Box> for Input {
|
||||
}
|
||||
|
||||
impl InputBuilder {
|
||||
|
||||
pub fn set_label(mut self, label: &str) -> Self {
|
||||
|
||||
self.label = String::from(label);
|
||||
|
||||
self
|
||||
|
||||
}
|
||||
|
||||
pub fn set_align(mut self, align: Align) -> Self {
|
||||
|
||||
pub fn set_align(mut self, align: Alignment) -> Self {
|
||||
self.align = align;
|
||||
|
||||
self
|
||||
|
||||
}
|
||||
|
||||
pub fn set_margins(mut self, margin: MarginData) -> Self {
|
||||
|
||||
self.margins = margin;
|
||||
|
||||
self
|
||||
|
||||
}
|
||||
|
||||
pub fn build(self, monospace: bool, wrap_mode: WrapMode, input_height: i32) -> Input {
|
||||
|
||||
let input_component = Box::new(Orientation::Vertical, 0);
|
||||
|
||||
let input_label = Label::builder()
|
||||
.halign(self.align)
|
||||
.halign(self.align.horizontal)
|
||||
.valign(self.align.vertical)
|
||||
.set_margin(self.margins)
|
||||
.label(self.label)
|
||||
.build();
|
||||
@@ -84,9 +77,8 @@ impl InputBuilder {
|
||||
input_component.append(&text_view_input_frame);
|
||||
|
||||
Input {
|
||||
component: input_component
|
||||
component: input_component,
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +1,24 @@
|
||||
use std::ops::Deref;
|
||||
use gtk4 as gtk;
|
||||
|
||||
#[allow(unused)]
|
||||
use gtk::{
|
||||
Box,
|
||||
Stack,
|
||||
Widget,
|
||||
Orientation,
|
||||
StackSidebar,
|
||||
StackSwitcher,
|
||||
StackTransitionType,
|
||||
prelude::{BoxExt, IsA},
|
||||
Box, Orientation, Stack, StackSidebar, StackSwitcher, StackTransitionType, Widget,
|
||||
};
|
||||
|
||||
use crate::view::components::builder_traits::{Builder, Product};
|
||||
|
||||
pub type Page<'a> = (&'a str, &'a str, &'a Box);
|
||||
|
||||
pub struct Pages{
|
||||
wrapper: Box
|
||||
pub struct Pages {
|
||||
wrapper: Box,
|
||||
}
|
||||
|
||||
pub struct PagesBuilder{
|
||||
pub struct PagesBuilder {
|
||||
pages_content: Stack,
|
||||
}
|
||||
|
||||
impl Product<PagesBuilder, Box> for Pages {
|
||||
|
||||
fn builder() -> PagesBuilder {
|
||||
PagesBuilder {
|
||||
pages_content: Stack::new(),
|
||||
@@ -35,11 +28,9 @@ impl Product<PagesBuilder, Box> for Pages {
|
||||
fn get(self) -> Box {
|
||||
self.wrapper
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Builder<Pages, Page<'_>, i32> for PagesBuilder{
|
||||
|
||||
impl Builder<Pages, Page<'_>, i32> for PagesBuilder {
|
||||
fn build(&self, build_param: i32) -> Pages {
|
||||
let stack_sidebar = StackSidebar::new();
|
||||
let stack_switcher = StackSwitcher::new();
|
||||
@@ -52,9 +43,7 @@ impl Builder<Pages, Page<'_>, i32> for PagesBuilder{
|
||||
wrapper.append(&stack_sidebar);
|
||||
wrapper.append(&self.pages_content);
|
||||
|
||||
Pages{
|
||||
wrapper
|
||||
}
|
||||
Pages { wrapper }
|
||||
}
|
||||
|
||||
fn append_item(self, item: Page) -> Self {
|
||||
@@ -70,27 +59,18 @@ impl Builder<Pages, Page<'_>, i32> for PagesBuilder{
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl PagesBuilder {
|
||||
|
||||
fn append_page_private(
|
||||
&self,
|
||||
item: Page
|
||||
) {
|
||||
fn append_page_private(&self, item: Page) {
|
||||
self.pages_content.add_titled(item.2, Some(item.1), item.0);
|
||||
}
|
||||
|
||||
pub fn set_transition(
|
||||
self,
|
||||
type_transition : StackTransitionType,
|
||||
duration: u32
|
||||
) -> Self {
|
||||
pub fn set_transition(self, type_transition: StackTransitionType, duration: u32) -> Self {
|
||||
self.pages_content.set_transition_type(type_transition);
|
||||
self.pages_content.set_transition_duration(duration);
|
||||
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::{Notebook, Label, Box};
|
||||
use super::builder_traits::*;
|
||||
use gtk::{Box, Label, Notebook};
|
||||
|
||||
pub type TabLabel = Label;
|
||||
pub type TabContent = Box;
|
||||
@@ -9,43 +9,32 @@ pub type TabPage<'a> = (&'a str, TabContent);
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct TabsBuilder {
|
||||
tabs: Vec<(TabLabel, TabContent)>
|
||||
tabs: Vec<(TabLabel, TabContent)>,
|
||||
}
|
||||
|
||||
pub struct Tabs {
|
||||
tabs_wrapper: Notebook
|
||||
tabs_wrapper: Notebook,
|
||||
}
|
||||
|
||||
impl Product<TabsBuilder, Notebook> for Tabs {
|
||||
|
||||
fn builder() -> TabsBuilder {
|
||||
TabsBuilder {
|
||||
tabs: Vec::new(),
|
||||
}
|
||||
TabsBuilder { tabs: Vec::new() }
|
||||
}
|
||||
|
||||
fn get(self) -> Notebook {
|
||||
self.tabs_wrapper
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Builder<Tabs, TabPage<'_>, &str> for TabsBuilder{
|
||||
|
||||
impl Builder<Tabs, TabPage<'_>, &str> for TabsBuilder {
|
||||
fn build(&self, build_param: &str) -> Tabs {
|
||||
let tabs_wrapper = Notebook::builder()
|
||||
.group_name(build_param)
|
||||
.build();
|
||||
let tabs_wrapper = Notebook::builder().group_name(build_param).build();
|
||||
|
||||
self.tabs
|
||||
.iter()
|
||||
.for_each(|(label, content)| {
|
||||
tabs_wrapper.append_page(content, Some(label));
|
||||
});
|
||||
self.tabs.iter().for_each(|(label, content)| {
|
||||
tabs_wrapper.append_page(content, Some(label));
|
||||
});
|
||||
|
||||
Tabs {
|
||||
tabs_wrapper
|
||||
}
|
||||
Tabs { tabs_wrapper }
|
||||
}
|
||||
|
||||
fn append_item(mut self, item: TabPage) -> Self {
|
||||
@@ -55,21 +44,18 @@ impl Builder<Tabs, TabPage<'_>, &str> for TabsBuilder{
|
||||
}
|
||||
|
||||
fn append_items(mut self, items: Vec<TabPage>) -> Self {
|
||||
for item in items{
|
||||
for item in items {
|
||||
self.append_tab_private(item);
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
impl TabsBuilder {
|
||||
|
||||
fn append_tab_private(&mut self, item: TabPage) {
|
||||
let tab_label = Label::new(Some(item.0));
|
||||
self.tabs.push((tab_label, item.1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +1,18 @@
|
||||
use gtk4 as gtk;
|
||||
|
||||
use crate::{
|
||||
model::model::*,
|
||||
view::{
|
||||
properties::*,
|
||||
components::{
|
||||
*,
|
||||
switch::*,
|
||||
wrapper::*,
|
||||
}
|
||||
},
|
||||
controller::{
|
||||
controller::*,
|
||||
event_handlers::{button_event_handlers::*, switch_event_handlers::*},
|
||||
view_utils::input_utils::*,
|
||||
event_handlers::{
|
||||
button_event_handlers::*,
|
||||
switch_event_handlers::*,
|
||||
},
|
||||
}
|
||||
},
|
||||
model::model::*,
|
||||
view::{components::wrapper::*, properties::*},
|
||||
};
|
||||
|
||||
use gtk::{*, prelude::*};
|
||||
|
||||
pub fn hamming_code_page(wrapper: &Box) -> (){
|
||||
use gtk::{prelude::*, *};
|
||||
|
||||
pub fn hamming_code_page(wrapper: &Box) -> () {
|
||||
// input
|
||||
|
||||
let hamming_text_view_input_label = Label::builder()
|
||||
@@ -67,11 +56,10 @@ pub fn hamming_code_page(wrapper: &Box) -> (){
|
||||
|
||||
// interactive panel
|
||||
|
||||
let clear_input_button =
|
||||
Button::builder()
|
||||
.set_align(Alignment::new(Align::Fill, Align::Fill))
|
||||
.label("Очистка полей")
|
||||
.build();
|
||||
let clear_input_button = Button::builder()
|
||||
.set_align(Alignment::new(Align::Fill, Align::Fill))
|
||||
.label("Очистка полей")
|
||||
.build();
|
||||
|
||||
let hamming_crypt_button = Button::builder()
|
||||
.set_align(Alignment::new(Align::Fill, Align::Fill))
|
||||
@@ -80,9 +68,7 @@ pub fn hamming_code_page(wrapper: &Box) -> (){
|
||||
|
||||
let crypt_mode_switch = Switch::new();
|
||||
|
||||
let crypt_mode_label = Label::builder()
|
||||
.label("Режим: кодирование")
|
||||
.build();
|
||||
let crypt_mode_label = Label::builder().label("Режим: кодирование").build();
|
||||
|
||||
// references for binding actions
|
||||
|
||||
@@ -99,28 +85,27 @@ pub fn hamming_code_page(wrapper: &Box) -> (){
|
||||
|
||||
// actions
|
||||
|
||||
EventHandler::new(
|
||||
clear_input_button_to_handle,
|
||||
move |_| {
|
||||
clearing(&text_view_input_for_clearing, &text_view_output_for_clearing);
|
||||
}
|
||||
).on_click();
|
||||
EventHandler::new(clear_input_button_to_handle, move |_| {
|
||||
clearing(
|
||||
&text_view_input_for_clearing,
|
||||
&text_view_output_for_clearing,
|
||||
);
|
||||
})
|
||||
.on_click();
|
||||
|
||||
EventHandler::new(
|
||||
hamming_crypt_button.clone(),
|
||||
move |button: &Button| {
|
||||
parse_input(
|
||||
&text_view_input_for_parse,
|
||||
&text_view_output_for_output,
|
||||
crypt_mode_switch_to_handle.state()
|
||||
)
|
||||
}).on_click();
|
||||
EventHandler::new(hamming_crypt_button.clone(), move |_button: &Button| {
|
||||
parse_input(
|
||||
&text_view_input_for_parse,
|
||||
&text_view_output_for_output,
|
||||
crypt_mode_switch_to_handle.state(),
|
||||
)
|
||||
})
|
||||
.on_click();
|
||||
|
||||
EventHandler::new(
|
||||
crypt_mode_switch.clone(),
|
||||
move |s : &Switch| {
|
||||
state_controller(s, &crypt_mode_label_to_handle);
|
||||
}).on_toggle();
|
||||
EventHandler::new(crypt_mode_switch.clone(), move |s: &Switch| {
|
||||
state_controller(s, &crypt_mode_label_to_handle);
|
||||
})
|
||||
.on_toggle();
|
||||
|
||||
// wrappers
|
||||
|
||||
@@ -148,5 +133,4 @@ pub fn hamming_code_page(wrapper: &Box) -> (){
|
||||
wrapper.append(&interactive_components_wrapper);
|
||||
wrapper.append(&hamming_text_view_output_label);
|
||||
wrapper.append(&hamming_text_view_output_frame);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,78 +1,107 @@
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::{*, prelude::*};
|
||||
use crate::model::builder_traits::Product;
|
||||
use crate::view::{
|
||||
properties::*,
|
||||
components::{
|
||||
wrapper::*,
|
||||
input::Input,
|
||||
use crate::{
|
||||
model::builder_traits::Product,
|
||||
view::{
|
||||
components::{input::Input, wrapper::Wrapper},
|
||||
properties::*,
|
||||
},
|
||||
};
|
||||
use gtk::{prelude::*, Align, WrapMode, *};
|
||||
|
||||
pub fn signal_reducing_page(wrapper: &Box) {
|
||||
let (input_height, monospace, input_alignment, input_wrapping): (i32, bool, Align, WrapMode) =
|
||||
(24, true, Align::Fill, WrapMode::Word);
|
||||
|
||||
let inputs_first_line = Box::new(Orientation::Horizontal, 5);
|
||||
|
||||
inputs_first_line.set_valign(Align::Fill);
|
||||
|
||||
let input_height : i32 = 20;
|
||||
let input_label_alignment = Alignment {
|
||||
horizontal: Align::Start,
|
||||
vertical: Align::Fill,
|
||||
};
|
||||
|
||||
let wire_length_input = Input::builder()
|
||||
.set_label("Длина провода (L = [м]):")
|
||||
.set_align(Align::Fill)
|
||||
.set_label("l, м:")
|
||||
.set_margins(MarginData::EqualsMargin(5))
|
||||
.build(true, WrapMode::Word, input_height)
|
||||
.set_align(input_label_alignment)
|
||||
.build(monospace, input_wrapping, input_height)
|
||||
.get();
|
||||
|
||||
let resistance_input = Input::builder()
|
||||
.set_label("Сопротивление (Rм = [Ом * м]):")
|
||||
.set_align(Align::Fill)
|
||||
wire_length_input.set_halign(input_alignment);
|
||||
wire_length_input.set_hexpand(true);
|
||||
|
||||
let resistance_per_meter_input = Input::builder()
|
||||
.set_label("Rм, Ом:")
|
||||
.set_margins(MarginData::EqualsMargin(5))
|
||||
.build(true, WrapMode::Word, input_height)
|
||||
.set_align(input_label_alignment)
|
||||
.build(monospace, input_wrapping, input_height)
|
||||
.get();
|
||||
|
||||
let capacity_input = Input::builder()
|
||||
.set_label("Ёмкость (Cм = [пФ * м]):")
|
||||
.set_align(Align::Fill)
|
||||
resistance_per_meter_input.set_halign(input_alignment);
|
||||
resistance_per_meter_input.set_hexpand(true);
|
||||
|
||||
let capacity_per_meter_input = Input::builder()
|
||||
.set_label("Cм, пФ:")
|
||||
.set_margins(MarginData::EqualsMargin(5))
|
||||
.build(true, WrapMode::Word, input_height)
|
||||
.set_align(input_label_alignment)
|
||||
.build(monospace, input_wrapping, input_height)
|
||||
.get();
|
||||
|
||||
let inputs_second_line = Box::new(Orientation::Horizontal, 5);
|
||||
capacity_per_meter_input.set_halign(input_alignment);
|
||||
capacity_per_meter_input.set_hexpand(true);
|
||||
|
||||
inputs_second_line.set_valign(Align::Fill);
|
||||
let wrapper_first_row = Wrapper::col_builder()
|
||||
.halign(Align::Fill)
|
||||
.hexpand(true)
|
||||
.spacing(5)
|
||||
.build();
|
||||
|
||||
let voltage_input = Input::builder()
|
||||
.set_label("Напряжение (Vи = [мВ]):")
|
||||
.set_align(Align::Fill)
|
||||
wrapper_first_row.append(&wire_length_input);
|
||||
wrapper_first_row.append(&resistance_per_meter_input);
|
||||
wrapper_first_row.append(&capacity_per_meter_input);
|
||||
|
||||
let info_signal_voltage_input = Input::builder()
|
||||
.set_label("Vи, мВ:")
|
||||
.set_margins(MarginData::EqualsMargin(5))
|
||||
.build(true, WrapMode::Word, input_height)
|
||||
.set_align(input_label_alignment)
|
||||
.build(monospace, input_wrapping, input_height)
|
||||
.get();
|
||||
|
||||
let source_implicit_resistance_input = Input::builder()
|
||||
.set_label("Сопротивление источника (R = [Ом]):")
|
||||
.set_align(Align::Fill)
|
||||
info_signal_voltage_input.set_halign(input_alignment);
|
||||
info_signal_voltage_input.set_hexpand(true);
|
||||
|
||||
let resistance_of_info_voltage_source_input = Input::builder()
|
||||
.set_label("Rи, Ом:")
|
||||
.set_margins(MarginData::EqualsMargin(5))
|
||||
.build(true, WrapMode::Word, input_height)
|
||||
.set_align(input_label_alignment)
|
||||
.build(monospace, input_wrapping, input_height)
|
||||
.get();
|
||||
|
||||
let freq_input = Input::builder()
|
||||
.set_label("Частота (f = [МГц]):")
|
||||
.set_align(Align::Fill)
|
||||
resistance_of_info_voltage_source_input.set_halign(input_alignment);
|
||||
resistance_of_info_voltage_source_input.set_hexpand(true);
|
||||
|
||||
let info_voltage_source_frequency_input = Input::builder()
|
||||
.set_label("f, мГц:")
|
||||
.set_margins(MarginData::EqualsMargin(5))
|
||||
.build(true, WrapMode::Word, input_height)
|
||||
.set_align(input_label_alignment)
|
||||
.build(monospace, input_wrapping, input_height)
|
||||
.get();
|
||||
|
||||
info_voltage_source_frequency_input.set_halign(input_alignment);
|
||||
info_voltage_source_frequency_input.set_hexpand(true);
|
||||
|
||||
inputs_first_line.append(&wire_length_input);
|
||||
inputs_first_line.append(&resistance_input);
|
||||
inputs_first_line.append(&capacity_input);
|
||||
inputs_second_line.append(&voltage_input);
|
||||
inputs_second_line.append(&source_implicit_resistance_input);
|
||||
inputs_second_line.append(&freq_input);
|
||||
let wrapper_second_row = Wrapper::col_builder()
|
||||
.halign(Align::Fill)
|
||||
.hexpand(true)
|
||||
.spacing(5)
|
||||
.build();
|
||||
|
||||
wrapper.append(&inputs_first_line);
|
||||
wrapper.append(&inputs_second_line);
|
||||
wrapper_second_row.append(&info_signal_voltage_input);
|
||||
wrapper_second_row.append(&resistance_of_info_voltage_source_input);
|
||||
wrapper_second_row.append(&info_voltage_source_frequency_input);
|
||||
|
||||
}
|
||||
let main_wpapper = Wrapper::row_builder().spacing(5).build();
|
||||
|
||||
main_wpapper.append(&wrapper_first_row);
|
||||
main_wpapper.append(&wrapper_second_row);
|
||||
|
||||
wrapper.append(&main_wpapper);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::{Align};
|
||||
use gtk::builders::*;
|
||||
use gtk::Align;
|
||||
|
||||
/**
|
||||
* Types
|
||||
@@ -13,7 +13,7 @@ pub type Margin = (i32, i32, i32, i32);
|
||||
* Enums
|
||||
*/
|
||||
|
||||
pub enum MarginData{
|
||||
pub enum MarginData {
|
||||
EqualsMargin(i32),
|
||||
MultipleMargin(Margin),
|
||||
}
|
||||
@@ -26,40 +26,41 @@ pub enum MarginData{
|
||||
|
||||
pub struct Size {
|
||||
pub width: i32,
|
||||
pub height: i32
|
||||
pub height: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Alignment {
|
||||
pub horizontal: Align,
|
||||
pub vertical : Align
|
||||
pub vertical: Align,
|
||||
}
|
||||
|
||||
/**
|
||||
* Traits
|
||||
*/
|
||||
|
||||
pub trait Setters{
|
||||
pub trait Setters {
|
||||
fn set_margin(self, margin: MarginData) -> Self;
|
||||
fn set_align(self, align: Alignment) -> Self;
|
||||
}
|
||||
|
||||
pub trait TextViewSetters{
|
||||
pub trait TextViewSetters {
|
||||
fn set_text_view_margin(self, margin: MarginData) -> Self;
|
||||
}
|
||||
|
||||
impl TextViewSetters for TextViewBuilder{
|
||||
fn set_text_view_margin(self, margin: MarginData) -> Self{
|
||||
match margin{
|
||||
MarginData::EqualsMargin(margin) =>
|
||||
self.top_margin(margin)
|
||||
.left_margin(margin)
|
||||
.bottom_margin(margin)
|
||||
.right_margin(margin),
|
||||
MarginData::MultipleMargin(margins) =>
|
||||
self.top_margin(margins.0)
|
||||
.left_margin(margins.1)
|
||||
.bottom_margin(margins.2)
|
||||
.right_margin(margins.3),
|
||||
impl TextViewSetters for TextViewBuilder {
|
||||
fn set_text_view_margin(self, margin: MarginData) -> Self {
|
||||
match margin {
|
||||
MarginData::EqualsMargin(margin) => self
|
||||
.top_margin(margin)
|
||||
.left_margin(margin)
|
||||
.bottom_margin(margin)
|
||||
.right_margin(margin),
|
||||
MarginData::MultipleMargin(margins) => self
|
||||
.top_margin(margins.0)
|
||||
.left_margin(margins.1)
|
||||
.bottom_margin(margins.2)
|
||||
.right_margin(margins.3),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,24 +96,25 @@ macro_rules! impl_setters {
|
||||
}
|
||||
}
|
||||
|
||||
impl_setters!{ButtonBuilder, EntryBuilder, TextViewBuilder,
|
||||
impl_setters! {ButtonBuilder, EntryBuilder, TextViewBuilder,
|
||||
BoxBuilder, SwitchBuilder, FrameBuilder, LabelBuilder}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl Size{
|
||||
pub fn new(w: i32, h: i32) -> Size{
|
||||
Size{
|
||||
impl Size {
|
||||
pub fn new(w: i32, h: i32) -> Size {
|
||||
Size {
|
||||
width: w,
|
||||
height: h,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Alignment{
|
||||
pub fn new(horizontal: Align, vertical : Align) -> Alignment{
|
||||
Alignment{
|
||||
impl Alignment {
|
||||
pub fn new(horizontal: Align, vertical: Align) -> Alignment {
|
||||
Alignment {
|
||||
horizontal,
|
||||
vertical,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
use crate::model::builder_traits::*;
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::{*, prelude::*, StackTransitionType::SlideLeftRight};
|
||||
use gtk::{prelude::*, StackTransitionType::SlideLeftRight, *};
|
||||
|
||||
use crate::{
|
||||
view::{
|
||||
properties::*,
|
||||
components::{
|
||||
*,
|
||||
wrapper::*,
|
||||
},
|
||||
pages::*
|
||||
},
|
||||
};
|
||||
use crate::view::components::pages::Pages;
|
||||
|
||||
pub fn ui(application: &adw::Application) {
|
||||
#[allow(unused)]
|
||||
use crate::view::{
|
||||
components::{wrapper::*, *},
|
||||
pages::*,
|
||||
properties::*,
|
||||
};
|
||||
|
||||
pub fn ui(application: &adw::Application) {
|
||||
let hamming_code = Wrapper::row_builder()
|
||||
.set_align(Alignment::new(Align::Fill, Align::Fill))
|
||||
.set_margin(MarginData::EqualsMargin(15))
|
||||
@@ -37,7 +33,7 @@ pub fn ui(application: &adw::Application) {
|
||||
.set_transition(SlideLeftRight, 200)
|
||||
.append_items(vec![
|
||||
("Код Хэмминга", "Код Хэмминга", &hamming_code),
|
||||
("Затухание сигнала", "Затухание сигнала", &signal_reducing)
|
||||
("Затухание сигнала", "Затухание сигнала", &signal_reducing),
|
||||
])
|
||||
.build(5)
|
||||
.get();
|
||||
@@ -51,4 +47,4 @@ pub fn ui(application: &adw::Application) {
|
||||
.build();
|
||||
|
||||
window.show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user