mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
Add software page
This commit is contained in:
parent
e63dae366f
commit
664f3a1b44
@ -1,11 +1,13 @@
|
||||
mod info_page;
|
||||
mod oc_page;
|
||||
mod software_page;
|
||||
mod thermals_page;
|
||||
|
||||
use gtk::*;
|
||||
|
||||
use info_page::InformationPage;
|
||||
use oc_page::OcPage;
|
||||
use software_page::SoftwarePage;
|
||||
use thermals_page::ThermalsPage;
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -13,6 +15,7 @@ pub struct RootStack {
|
||||
pub container: Stack,
|
||||
pub info_page: InformationPage,
|
||||
pub thermals_page: ThermalsPage,
|
||||
pub software_page: SoftwarePage,
|
||||
pub oc_page: OcPage,
|
||||
}
|
||||
|
||||
@ -32,11 +35,16 @@ impl RootStack {
|
||||
|
||||
container.add_titled(&thermals_page.container, "thermals_page", "Thermals");
|
||||
|
||||
let software_page = SoftwarePage::new();
|
||||
|
||||
container.add_titled(&software_page.container, "software_page", "Software");
|
||||
|
||||
Self {
|
||||
container,
|
||||
info_page,
|
||||
thermals_page,
|
||||
oc_page,
|
||||
software_page,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
53
gui/src/app/root_stack/software_page.rs
Normal file
53
gui/src/app/root_stack/software_page.rs
Normal file
@ -0,0 +1,53 @@
|
||||
use gtk::*;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SoftwarePage {
|
||||
pub container: Grid,
|
||||
lact_version_label: Label,
|
||||
}
|
||||
|
||||
impl SoftwarePage {
|
||||
pub fn new() -> Self {
|
||||
let container = Grid::new();
|
||||
|
||||
container.set_margin_start(5);
|
||||
container.set_margin_end(5);
|
||||
container.set_margin_bottom(5);
|
||||
container.set_margin_top(5);
|
||||
|
||||
container.set_column_spacing(10);
|
||||
|
||||
container.attach(
|
||||
&{
|
||||
let label = Label::new(None);
|
||||
label.set_markup("<b>LACT Version:</b>");
|
||||
label.set_halign(Align::End);
|
||||
label.set_hexpand(true);
|
||||
label
|
||||
},
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
);
|
||||
let lact_version_label = Label::new(None);
|
||||
|
||||
let lact_version = env!("CARGO_PKG_VERSION");
|
||||
let lact_release_type = match cfg!(debug_assertions) {
|
||||
true => "debug",
|
||||
false => "release",
|
||||
};
|
||||
|
||||
lact_version_label.set_markup(&format!("{}-{}", lact_version, lact_release_type));
|
||||
|
||||
lact_version_label.set_hexpand(true);
|
||||
lact_version_label.set_halign(Align::Start);
|
||||
|
||||
container.attach(&lact_version_label, 1, 0, 1, 1);
|
||||
|
||||
Self {
|
||||
container,
|
||||
lact_version_label,
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user