Enable/disable scrollbar auto-hide based on OS setting

This commit is contained in:
Max Brunsfeld 2022-10-10 18:12:31 -07:00
parent b229bc69b9
commit e2700ff8c6
4 changed files with 35 additions and 9 deletions

View file

@ -699,6 +699,16 @@ impl platform::Platform for MacPlatform {
}
}
fn should_auto_hide_scrollbars(&self) -> bool {
#[allow(non_upper_case_globals)]
const NSScrollerStyleOverlay: NSInteger = 1;
unsafe {
let style: NSInteger = msg_send![class!(NSScroller), preferredScrollerStyle];
style == NSScrollerStyleOverlay
}
}
fn local_timezone(&self) -> UtcOffset {
unsafe {
let local_timezone: id = msg_send![class!(NSTimeZone), localTimeZone];