Fix scrolling

This commit is contained in:
Ward from fusion-voyager-3 2024-08-10 13:36:17 +03:00
parent c4c8db90d5
commit fa65cef03f
6 changed files with 40 additions and 11 deletions

View File

@ -9,6 +9,11 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="df2ca9e1-e07d-43f4-bc68-0a6113fc1fa2" name="Changes" comment=""> <list default="true" id="df2ca9e1-e07d-43f4-bc68-0a6113fc1fa2" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bin/gui/apt_update_page/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/gui/apt_update_page/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bin/gui/apt_update_page/process.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/gui/apt_update_page/process.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bin/gui/build_ui/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/gui/build_ui/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bin/gui/flatpak_update_page/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/gui/flatpak_update_page/mod.rs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bin/gui/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/src/bin/gui/style.css" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -49,7 +54,7 @@
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.rust.reset.selective.auto.import&quot;: &quot;true&quot;, &quot;RunOnceActivity.rust.reset.selective.auto.import&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;, &quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/ward/RustroverProjects/pkg-pikman-update-manager&quot;, &quot;last_opened_file_path&quot;: &quot;/home/ward/RustroverProjects/fedora-kernel-manager&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
@ -165,6 +170,12 @@
<workItem from="1721340242546" duration="6495000" /> <workItem from="1721340242546" duration="6495000" />
<workItem from="1721388775654" duration="8802000" /> <workItem from="1721388775654" duration="8802000" />
<workItem from="1721415142159" duration="10501000" /> <workItem from="1721415142159" duration="10501000" />
<workItem from="1721723508115" duration="1009000" />
<workItem from="1721726491372" duration="189000" />
<workItem from="1721726689334" duration="811000" />
<workItem from="1721763208718" duration="1000" />
<workItem from="1721937337342" duration="20000" />
<workItem from="1723284635393" duration="1276000" />
</task> </task>
<servers /> <servers />
</component> </component>

View File

@ -99,15 +99,15 @@ pub fn apt_update_page(
let packages_boxedlist = ListBox::builder() let packages_boxedlist = ListBox::builder()
.selection_mode(SelectionMode::None) .selection_mode(SelectionMode::None)
.margin_end(15)
.margin_start(15)
.sensitive(false) .sensitive(false)
.build(); .build();
packages_boxedlist.add_css_class("boxed-list"); packages_boxedlist.add_css_class("boxed-list");
packages_boxedlist.add_css_class("round-all-scroll");
let packages_viewport = ScrolledWindow::builder() let packages_viewport = ScrolledWindow::builder()
.vexpand(true) .vexpand(true)
.hexpand(true) .hexpand(true)
.has_frame(true)
.margin_bottom(15) .margin_bottom(15)
.margin_top(15) .margin_top(15)
.margin_end(15) .margin_end(15)
@ -115,6 +115,7 @@ pub fn apt_update_page(
.height_request(390) .height_request(390)
.child(&packages_boxedlist) .child(&packages_boxedlist)
.build(); .build();
packages_viewport.add_css_class("round-all-scroll");
let packages_no_viewport_page = adw::StatusPage::builder() let packages_no_viewport_page = adw::StatusPage::builder()
.icon_name("emblem-default-symbolic") .icon_name("emblem-default-symbolic")

View File

@ -334,18 +334,23 @@ fn apt_confirm_window(
.buffer(&apt_remove_confirm_text_buffer) .buffer(&apt_remove_confirm_text_buffer)
.hexpand(true) .hexpand(true)
.vexpand(true) .vexpand(true)
.margin_top(15)
.margin_bottom(15)
.margin_start(15)
.margin_end(15)
.editable(false) .editable(false)
.build(); .build();
let apt_remove_confirm_text_viewport = gtk::ScrolledWindow::builder()
.vexpand(true)
.hexpand(true)
.has_frame(true)
.hscrollbar_policy(PolicyType::Never)
.child(&apt_remove_confirm_text_view)
.build();
apt_remove_confirm_text_viewport.add_css_class("round-all-scroll");
let apt_remove_confirm_dialog = adw::MessageDialog::builder() let apt_remove_confirm_dialog = adw::MessageDialog::builder()
.transient_for(&window) .transient_for(&window)
.heading(t!("apt_remove_confirm_dialog_heading")) .heading(t!("apt_remove_confirm_dialog_heading"))
.body(t!("apt_remove_confirm_dialog_body")) .body(t!("apt_remove_confirm_dialog_body"))
.extra_child(&apt_remove_confirm_text_view) .extra_child(&apt_remove_confirm_text_viewport)
.build(); .build();
apt_remove_confirm_dialog.add_response( apt_remove_confirm_dialog.add_response(

View File

@ -252,7 +252,7 @@ pub fn build_ui(app: &Application) {
flatpak_ran_once, flatpak_ran_once,
))); )));
} }
));g ));
apt_update_view_stack_bin.set_child(Some(&apt_update_page::apt_update_page( apt_update_view_stack_bin.set_child(Some(&apt_update_page::apt_update_page(
window.clone(), window.clone(),

View File

@ -161,15 +161,15 @@ pub fn flatpak_update_page(
let packages_boxedlist = ListBox::builder() let packages_boxedlist = ListBox::builder()
.selection_mode(SelectionMode::None) .selection_mode(SelectionMode::None)
.margin_end(15)
.margin_start(15)
.sensitive(false) .sensitive(false)
.build(); .build();
packages_boxedlist.add_css_class("boxed-list"); packages_boxedlist.add_css_class("boxed-list");
packages_boxedlist.add_css_class("round-all-scroll");
let packages_viewport = ScrolledWindow::builder() let packages_viewport = ScrolledWindow::builder()
.vexpand(true) .vexpand(true)
.hexpand(true) .hexpand(true)
.has_frame(true)
.margin_bottom(15) .margin_bottom(15)
.margin_top(15) .margin_top(15)
.margin_end(15) .margin_end(15)
@ -177,6 +177,7 @@ pub fn flatpak_update_page(
.height_request(390) .height_request(390)
.child(&packages_boxedlist) .child(&packages_boxedlist)
.build(); .build();
packages_viewport.add_css_class("round-all-scroll");
let packages_no_viewport_page = adw::StatusPage::builder() let packages_no_viewport_page = adw::StatusPage::builder()
.icon_name("emblem-default-symbolic") .icon_name("emblem-default-symbolic")

View File

@ -10,6 +10,17 @@
border-radius: 25px; border-radius: 25px;
} }
.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;
}
.background-accent-bg { .background-accent-bg {
background: @accent_bg_color; background: @accent_bg_color;
border-radius: 10px; border-radius: 10px;