From e30850d272b74e832815a68a052cfe8e819b2f78 Mon Sep 17 00:00:00 2001 From: Zeenobit Date: Tue, 8 Oct 2024 00:05:27 -0400 Subject: [PATCH] Add `Window::scroll_bar_visibility` --- crates/egui/src/containers/window.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index 438d562ede7..6c728df7fa0 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -9,6 +9,7 @@ use crate::{ }; use epaint::{emath, pos2, vec2, Galley, Pos2, Rect, RectShape, Rounding, Shape, Stroke, Vec2}; +use super::scroll_area::ScrollBarVisibility; use super::{area, resize, Area, Frame, Resize, ScrollArea}; /// Builder for a floating window which can be dragged, closed, collapsed, resized and scrolled (off by default). @@ -402,6 +403,13 @@ impl<'open> Window<'open> { self.scroll = self.scroll.drag_to_scroll(drag_to_scroll); self } + + /// Sets the [`ScrollBarVisibility`] of the window. + #[inline] + pub fn scroll_bar_visibility(mut self, visibility: ScrollBarVisibility) -> Self { + self.scroll = self.scroll.scroll_bar_visibility(visibility); + self + } } impl<'open> Window<'open> {