add buttons

This commit is contained in:
Ward from fusion-voyager-3 2024-06-18 02:06:32 +03:00
parent bfab2d53a8
commit 89ffdbfc26
5 changed files with 54 additions and 5 deletions

View File

@ -23,13 +23,13 @@
.round-border-only-top { .round-border-only-top {
border-top-right-radius: 15px; border-top-right-radius: 15px;
border-top-left-radius: 15px; border-top-left-radius: 15px;
border-bottom-right-radius 0=px; border-bottom-right-radius: 0px;
border-bottom-left-radius 0px; border-bottom-left-radius: 0px;
} }
.round-border-only-bottom { .round-border-only-bottom {
border-top-right-radius: 0px; border-top-right-radius: 0px;
border-top-left-radius: 0px; border-top-left-radius: 0px;
border-bottom-right-radius 15px; border-bottom-right-radius: 15px;
border-bottom-left-radius 15px; border-bottom-left-radius: 15px;
} }

View File

@ -47,8 +47,16 @@ pub fn build_ui(app: &adw::Application) {
window_bottombar.append(&cancel_button); window_bottombar.append(&cancel_button);
window_bottombar.append(&apply_button); window_bottombar.append(&apply_button);
let content_stack = gtk::Stack::builder()
.transition_type(StackTransitionType::Crossfade)
.build();
content_stack.add_named(&content::content(), Some("content_page"));
let window_toolbar = adw::ToolbarView::builder() let window_toolbar = adw::ToolbarView::builder()
.content(&content::content()) .content(&content_stack)
.build(); .build();
window_toolbar.add_top_bar(&window_headerbar); window_toolbar.add_top_bar(&window_headerbar);

View File

@ -57,6 +57,44 @@ pub fn content() -> gtk::Box {
.margin_bottom(20) .margin_bottom(20)
.margin_top(20) .margin_top(20)
.build(); .build();
let button_box = gtk::Box::builder()
.orientation(Orientation::Horizontal)
.margin_start(10)
.margin_end(10)
.margin_bottom(20)
.margin_top(20)
.hexpand(true)
.halign(Align::Center)
.build();
let browse_kernels_button = gtk::Button::builder()
.icon_name("web")
.halign(Align::Start)
.margin_start(10)
.margin_end(10)
.height_request(50)
.width_request(50)
.tooltip_text("Browse Kernel for select branch")
.hexpand(true)
.build();
browse_kernels_button.add_css_class("circular");
let config_kernel_button = gtk::Button::builder()
.icon_name("settings")
.halign(Align::End)
.margin_start(10)
.margin_end(10)
.height_request(50)
.width_request(50)
.tooltip_text("Configure Sched_EXT settings")
.hexpand(true)
.build();
config_kernel_button.add_css_class("circular");
button_box.append(&browse_kernels_button);
button_box.append(&config_kernel_button);
kernel_branch_expander_row_boxedlist.add_css_class("boxed-list"); kernel_branch_expander_row_boxedlist.add_css_class("boxed-list");
kernel_branch_expander_row_boxedlist.append(&kernel_branch_expander_row); kernel_branch_expander_row_boxedlist.append(&kernel_branch_expander_row);
@ -65,6 +103,7 @@ pub fn content() -> gtk::Box {
content_box.append(&kernel_badge_box); content_box.append(&kernel_badge_box);
content_box.append(&tux_icon); content_box.append(&tux_icon);
content_box.append(&kernel_branch_expander_row_boxedlist); content_box.append(&kernel_branch_expander_row_boxedlist);
content_box.append(&button_box);
content_box content_box
} }

View File

@ -1,5 +1,6 @@
mod build_ui; mod build_ui;
mod content; mod content;
mod sched_ext;
use gtk::*; use gtk::*;
use adw::prelude::*; use adw::prelude::*;

1
src/sched_ext/mod.rs Normal file
View File

@ -0,0 +1 @@
//fn sched_ext_page()