Beam cursor
This commit is contained in:
+11
-1
@@ -40,7 +40,7 @@ use winit::event_loop::{
|
|||||||
};
|
};
|
||||||
use winit::keyboard::{Key, NamedKey};
|
use winit::keyboard::{Key, NamedKey};
|
||||||
use winit::platform::wayland::EventLoopBuilderExtWayland;
|
use winit::platform::wayland::EventLoopBuilderExtWayland;
|
||||||
use winit::window::{Window, WindowId};
|
use winit::window::{CursorIcon, Window, WindowId};
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════════════
|
||||||
// PANE
|
// PANE
|
||||||
@@ -3230,6 +3230,16 @@ impl ApplicationHandler<UserEvent> for App {
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Set cursor icon to IBeam when hovering over a pane
|
||||||
|
if let Some(window) = &self.window {
|
||||||
|
let icon = if pane_geom.is_some() {
|
||||||
|
CursorIcon::Text
|
||||||
|
} else {
|
||||||
|
CursorIcon::Default
|
||||||
|
};
|
||||||
|
window.set_cursor(icon);
|
||||||
|
}
|
||||||
|
|
||||||
// Switch focus if dragging on a different pane
|
// Switch focus if dragging on a different pane
|
||||||
if self.mouse_down_pos.is_some() {
|
if self.mouse_down_pos.is_some() {
|
||||||
if let Some(geom) = &pane_geom {
|
if let Some(geom) = &pane_geom {
|
||||||
|
|||||||
Reference in New Issue
Block a user