From bfab2d53a891ca605bf210b82ca3eca2b525a688 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Tue, 18 Jun 2024 01:42:47 +0300 Subject: [PATCH] css --- data/style.css | 14 ++++++++++++++ src/content/mod.rs | 13 +++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/data/style.css b/data/style.css index 7b35c92..520da24 100644 --- a/data/style.css +++ b/data/style.css @@ -18,4 +18,18 @@ background: #ff2a03; border-radius: 10px; padding: 5px; +} + +.round-border-only-top { + border-top-right-radius: 15px; + border-top-left-radius: 15px; + border-bottom-right-radius 0=px; + border-bottom-left-radius 0px; +} + +.round-border-only-bottom { + border-top-right-radius: 0px; + border-top-left-radius: 0px; + border-bottom-right-radius 15px; + border-bottom-left-radius 15px; } \ No newline at end of file diff --git a/src/content/mod.rs b/src/content/mod.rs index b6fdf78..245dfe6 100644 --- a/src/content/mod.rs +++ b/src/content/mod.rs @@ -42,6 +42,7 @@ pub fn content() -> gtk::Box { .build(); let kernel_branch_expander_row = adw::ExpanderRow::builder() + .subtitle("Kernel Branch") .build(); kernel_branch_expander_row.add_row(&kernel_branch_expandable(&kernel_branch_expander_row)); @@ -72,11 +73,11 @@ fn kernel_branch_expandable(expander_row: &adw::ExpanderRow) -> gtk::ListBox { let searchbar = gtk::SearchEntry::builder() .search_delay(500) .build(); + searchbar.add_css_class("round-border-only-top"); let boxedlist = gtk::ListBox::builder() .selection_mode(SelectionMode::None) .build(); - boxedlist.add_css_class("boxedlist"); boxedlist.append(&searchbar); @@ -113,8 +114,11 @@ fn kernel_branch_expandable(expander_row: &adw::ExpanderRow) -> gtk::ListBox { let branch_container_viewport = gtk::ScrolledWindow::builder() .child(&branch_container) + .hscrollbar_policy(PolicyType::Never) .build(); + branch_container.add_css_class("round-border-only-bottom"); + boxedlist.append(&branch_container_viewport); searchbar.connect_search_changed(clone!(@weak searchbar, @weak branch_container => move |_| { @@ -198,7 +202,12 @@ fn get_kernel_branches() -> Vec { db: "https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/data/db-kernel-cachy.json".to_string() }; - vec![test_branch] + let test_branch2 = KernelBranch { + name: "kernel-cachy".to_string(), + db: "https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/data/db-kernel-cachy.json".to_string() + }; + + vec![test_branch, test_branch2] } fn get_running_kernel_info() -> RunningKernelInfo { let kernel = match Command::new("uname").arg("-r").stdout(Stdio::piped()).output() {