We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ScrollArea::is_scrolling()
1 parent abab068 commit 145f8e2Copy full SHA for 145f8e2
crates/egui/src/containers/scroll_area.rs
@@ -185,6 +185,20 @@ pub struct ScrollArea {
185
animated: bool,
186
}
187
188
+impl ScrollArea {
189
+ pub fn is_scrolling(ui: &Ui, id_source: Id) -> bool {
190
+ let id = ui.make_persistent_id(id_source);
191
+ let scroll_target = ui.ctx().frame_state(|state| {
192
+ state.scroll_target[0].is_some() || state.scroll_target[1].is_some()
193
+ });
194
+ if let Some(state) = State::load(ui.ctx(), id) {
195
+ state.vel != Vec2::ZERO || scroll_target
196
+ } else {
197
+ false
198
+ }
199
200
+}
201
+
202
impl ScrollArea {
203
/// Create a horizontal scroll area.
204
#[inline]
0 commit comments