|
6 | 6 | //! Widget and Events traits |
7 | 7 |
|
8 | 8 | use super::{Tile, Widget}; |
| 9 | +use crate::ChildIndices; |
9 | 10 | use crate::event::{ConfigCx, CursorIcon, Event, EventCx, IsUsed, Scroll, Unused}; |
10 | | -use crate::{ActionResize, ChildIndices}; |
11 | 11 | use crate::{Id, geom::Coord}; |
12 | 12 | #[allow(unused)] use crate::{Layout, event::EventState}; |
13 | 13 | #[allow(unused)] use kas_macros as macros; |
@@ -308,26 +308,26 @@ pub trait Events: Widget + Sized { |
308 | 308 | /// |
309 | 309 | /// # Calling |
310 | 310 | /// |
311 | | - /// This method may only be called after the widget is sized. |
312 | | - /// |
313 | | - /// This method is called during [event handling](crate::event) whenever a |
314 | | - /// resize action is required (see [`ConfigCx::resize`]). |
| 311 | + /// This method may be called when processing an [update](Self#update) or |
| 312 | + /// handling an event ([`Self::handle_event`]) or message |
| 313 | + /// ([`Self::handle_messages`]) when a child widget requires resizing, but |
| 314 | + /// only after the initial sizing of the widget. |
315 | 315 | /// |
316 | 316 | /// # Implementation |
317 | 317 | /// |
318 | 318 | /// Some widgets (for example, a scroll region) are able to handle resizes |
319 | | - /// locally and should implement this method to do so |
320 | | - /// (thus avoiding the need for a full-window resize). |
| 319 | + /// locally and should implement this method to do so, avoiding the need for |
| 320 | + /// a full-window resize. |
321 | 321 | /// |
322 | | - /// Return `Some(ActionResize)` if further resizing is needed, or `None` if |
323 | | - /// resizing is complete. |
| 322 | + /// Return `true` if resizing is complete, otherwise return `false` to |
| 323 | + /// indicate that further resizing is required. |
324 | 324 | /// |
325 | | - /// The default implementation simply returns `Some(ActionResize)`. |
| 325 | + /// The default implementation simply returns `false`. |
326 | 326 | #[inline] |
327 | 327 | #[must_use] |
328 | | - fn handle_resize(&mut self, cx: &mut ConfigCx, data: &Self::Data) -> Option<ActionResize> { |
329 | | - let _ = (cx, data); |
330 | | - Some(ActionResize) |
| 328 | + fn handle_resize(&mut self, cx: &mut ConfigCx) -> bool { |
| 329 | + let _ = cx; |
| 330 | + false |
331 | 331 | } |
332 | 332 |
|
333 | 333 | /// Handler for scrolling |
|
0 commit comments