Skip to content

Commit

Permalink
Add Window::drag-to-scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
KYovchevski committed Jun 21, 2023
1 parent 9478e50 commit f5a4890
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/egui/src/containers/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ impl<'open> Window<'open> {
self
}

/// Enable/disable scrolling on the window by dragging with the pointer. `true` by default.
///
/// See [`ScrollArea::drag_to_scroll`] for more.
pub fn drag_to_scroll(mut self, drag_to_scroll: bool) -> Self {
self.scroll = self.scroll.drag_to_scroll(drag_to_scroll);
self
}

/// Constrain the area up to which the window can be dragged.
pub fn drag_bounds(mut self, bounds: Rect) -> Self {
self.area = self.area.drag_bounds(bounds);
Expand Down

0 comments on commit f5a4890

Please sign in to comment.