fix scroll rounding

This commit is contained in:
Ward from fusion-voyager-3 2024-08-08 00:53:45 +03:00
parent 9a37dcccb9
commit ceac6592bd
5 changed files with 71 additions and 62 deletions

View File

@ -26,21 +26,17 @@ pub fn eula_page(
let eula_selection_text_view = gtk::TextView::builder()
.hexpand(true)
.vexpand(true)
.margin_top(15)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.editable(false)
.buffer(&eula_buffer)
.build();
eula_selection_text_view.add_css_class("rounded-all-25-with-padding");
let eula_selection_text_scroll = gtk::ScrolledWindow::builder()
.vexpand(true)
.hexpand(true)
.has_frame(true)
.child(&eula_selection_text_view)
.build();
eula_selection_text_scroll.add_css_class("round-all-scroll");
let eula_accept_checkbutton = gtk::CheckButton::builder()
.margin_top(15)

View File

@ -25,26 +25,21 @@ pub fn keyboard_page(
let null_checkbutton = gtk::CheckButton::builder()
.build();
let keyboard_selection_row_viewport =
gtk::ScrolledWindow::builder()
.vexpand(true)
.hexpand(true)
.build();
let keyboard_selection_row_viewport_box = gtk::ListBox::builder().build();
keyboard_selection_row_viewport_box.add_css_class("boxed-list");
keyboard_selection_row_viewport
.set_child(Some(&keyboard_selection_row_viewport_box));
let keyboard_selection_row_viewport_listbox = gtk::ListBox::builder()
.selection_mode(gtk::SelectionMode::None)
.margin_top(15)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.build();
keyboard_selection_row_viewport_listbox.add_css_class("boxed-list");
keyboard_selection_row_viewport_listbox.add_css_class("round-border-only");
let keyboard_selection_row_viewport =
gtk::ScrolledWindow::builder()
.vexpand(true)
.hexpand(true)
.has_frame(true)
.child(&keyboard_selection_row_viewport_listbox)
.build();
keyboard_selection_row_viewport.add_css_class("round-border-only-top-with-padding");
let keyboard_search_bar = gtk::SearchEntry::builder()
.hexpand(true)
@ -109,7 +104,7 @@ pub fn keyboard_page(
.build();
keymap_row.add_prefix(&keymap_checkbutton);
keymap_checkbutton.set_group(Some(&null_checkbutton));
keyboard_selection_row_viewport_box.append(&keymap_row);
keyboard_selection_row_viewport_listbox.append(&keymap_row);
keymap_checkbutton.connect_toggled(clone!(
#[weak]
keymap_checkbutton,
@ -159,10 +154,10 @@ pub fn keyboard_page(
#[weak]
keyboard_search_bar,
#[weak]
keyboard_selection_row_viewport_box,
keyboard_selection_row_viewport_listbox,
move |_|
{
let mut counter = keyboard_selection_row_viewport_box.first_child();
let mut counter = keyboard_selection_row_viewport_listbox.first_child();
while let Some(row) = counter {
if row.widget_name() == "AdwActionRow" {
if !keyboard_search_bar.text().is_empty() {

View File

@ -28,26 +28,21 @@ pub fn language_page(
let null_checkbutton = gtk::CheckButton::builder()
.build();
let language_selection_row_viewport =
gtk::ScrolledWindow::builder()
.vexpand(true)
.hexpand(true)
.build();
let language_selection_row_viewport_box = gtk::ListBox::builder().build();
language_selection_row_viewport_box.add_css_class("boxed-list");
language_selection_row_viewport
.set_child(Some(&language_selection_row_viewport_box));
let language_selection_row_viewport_listbox = gtk::ListBox::builder()
.selection_mode(gtk::SelectionMode::None)
.margin_top(15)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.build();
language_selection_row_viewport_listbox.add_css_class("boxed-list");
language_selection_row_viewport_listbox.add_css_class("round-all-scroll");
let language_selection_row_viewport =
gtk::ScrolledWindow::builder()
.vexpand(true)
.hexpand(true)
.has_frame(true)
.child(&language_selection_row_viewport_listbox)
.build();
language_selection_row_viewport.add_css_class("round-all-scroll");
let language_search_bar = gtk::SearchEntry::builder()
.hexpand(true)
@ -246,7 +241,7 @@ pub fn language_page(
.build();
locale_row.add_prefix(&locale_checkbutton);
locale_checkbutton.set_group(Some(&null_checkbutton));
language_selection_row_viewport_box.append(&locale_row);
language_selection_row_viewport_listbox.append(&locale_row);
locale_checkbutton.connect_toggled(clone!(
#[weak]
locale_checkbutton,
@ -281,10 +276,10 @@ pub fn language_page(
#[weak]
language_search_bar,
#[weak]
language_selection_row_viewport_box,
language_selection_row_viewport_listbox,
move |_|
{
let mut counter = language_selection_row_viewport_box.first_child();
let mut counter = language_selection_row_viewport_listbox.first_child();
while let Some(row) = counter {
if row.widget_name() == "AdwActionRow" {
if !language_search_bar.text().is_empty() {

View File

@ -51,9 +51,37 @@
border-bottom-left-radius: 0px;
}
.round-border-only-top-with-padding {
border-top-right-radius: 15px;
border-top-left-radius: 15px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
padding-top: 3px;
padding-right: 3px;
padding-left: 3px;
}
.round-all-scroll {
border-top-right-radius: 15px;
border-top-left-radius: 15px;
border-bottom-right-radius: 15px;
border-bottom-left-radius: 15px;
padding-top: 3px;
padding-right: 3px;
padding-left: 3px;
padding-bottom: 3px;
}
.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-round-borders {
border-top-right-radius: 0px;
border-top-left-radius: 0px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
}

View File

@ -25,26 +25,21 @@ pub fn timezone_page(
let null_checkbutton = gtk::CheckButton::builder()
.build();
let timezone_selection_row_viewport_listbox = gtk::ListBox::builder()
.selection_mode(gtk::SelectionMode::None)
.build();
timezone_selection_row_viewport_listbox.add_css_class("boxed-list");
timezone_selection_row_viewport_listbox.add_css_class("round-all-scroll");
let timezone_selection_row_viewport =
gtk::ScrolledWindow::builder()
.vexpand(true)
.hexpand(true)
.has_frame(true)
.child(&timezone_selection_row_viewport_listbox)
.build();
let timezone_selection_row_viewport_box = gtk::ListBox::builder().build();
timezone_selection_row_viewport_box.add_css_class("boxed-list");
timezone_selection_row_viewport
.set_child(Some(&timezone_selection_row_viewport_box));
let timezone_selection_row_viewport_listbox = gtk::ListBox::builder()
.selection_mode(gtk::SelectionMode::None)
.margin_top(15)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.build();
timezone_selection_row_viewport_listbox.add_css_class("boxed-list");
timezone_selection_row_viewport.add_css_class("round-all-scroll");
let timezone_search_bar = gtk::SearchEntry::builder()
.hexpand(true)
@ -94,7 +89,7 @@ pub fn timezone_page(
.build();
timezone_row.add_prefix(&timezone_checkbutton);
timezone_checkbutton.set_group(Some(&null_checkbutton));
timezone_selection_row_viewport_box.append(&timezone_row);
timezone_selection_row_viewport_listbox.append(&timezone_row);
timezone_checkbutton.connect_toggled(
clone!(
#[weak]
@ -126,10 +121,10 @@ pub fn timezone_page(
#[weak]
timezone_search_bar,
#[weak]
timezone_selection_row_viewport_box,
timezone_selection_row_viewport_listbox,
move |_|
{
let mut counter = timezone_selection_row_viewport_box.first_child();
let mut counter = timezone_selection_row_viewport_listbox.first_child();
while let Some(row) = counter {
if row.widget_name() == "AdwActionRow" {
if !timezone_search_bar.text().is_empty() {