mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Add Window::drag-to-scroll (#3118)
This commit is contained in:
@@ -266,6 +266,14 @@ impl<'open> Window<'open> {
|
|||||||
self
|
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.
|
/// Constrain the area up to which the window can be dragged.
|
||||||
pub fn drag_bounds(mut self, bounds: Rect) -> Self {
|
pub fn drag_bounds(mut self, bounds: Rect) -> Self {
|
||||||
self.area = self.area.drag_bounds(bounds);
|
self.area = self.area.drag_bounds(bounds);
|
||||||
|
|||||||
Reference in New Issue
Block a user