show scrollbar if >2 rows of app groups
This commit is contained in:
parent
ce3bcd7821
commit
e160649a14
5 changed files with 102 additions and 76 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use gtk4::ScrolledWindow;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use gtk4::glib;
|
||||
|
|
@ -9,3 +10,11 @@ pub fn data_path() -> PathBuf {
|
|||
path.push("data.json");
|
||||
path
|
||||
}
|
||||
|
||||
pub fn set_group_scroll_policy(scroll_window: &ScrolledWindow, group_cnt: u32) {
|
||||
if scroll_window.policy().1 == gtk4::PolicyType::Never && group_cnt > 16 {
|
||||
scroll_window.set_policy(gtk4::PolicyType::Never, gtk4::PolicyType::Automatic);
|
||||
} else if scroll_window.policy().1 == gtk4::PolicyType::Automatic && group_cnt <= 16 {
|
||||
scroll_window.set_policy(gtk4::PolicyType::Never, gtk4::PolicyType::Never);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue