diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index dc9fa0ced34c14c60bedf38e533e603fc97c07d2..e6d5fb9e48eea9b14f440ea77dc5d0354ad1d9e6 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -1559,6 +1559,11 @@ impl App { self.active_drag.is_some() } + /// Gets the cursor style of the currently active drag operation. + pub fn active_drag_cursor_style(&self) -> Option { + self.active_drag.as_ref().and_then(|drag| drag.cursor_style) + } + /// Stops active drag and clears any related effects. pub fn stop_active_drag(&mut self, window: &mut Window) -> bool { if self.active_drag.is_some() { @@ -1570,6 +1575,21 @@ impl App { } } + /// Sets the cursor style for the currently active drag operation. + pub fn set_active_drag_cursor_style( + &mut self, + cursor_style: CursorStyle, + window: &mut Window, + ) -> bool { + if let Some(ref mut drag) = self.active_drag { + drag.cursor_style = Some(cursor_style); + window.refresh(); + true + } else { + false + } + } + /// Set the prompt renderer for GPUI. This will replace the default or platform specific /// prompts with this custom implementation. pub fn set_prompt_builder(