diff --git a/crates/ui-contract/src/contract/body/window.rs b/crates/ui-contract/src/contract/body/window.rs index 79eb032b4..2a08c3a81 100644 --- a/crates/ui-contract/src/contract/body/window.rs +++ b/crates/ui-contract/src/contract/body/window.rs @@ -810,8 +810,9 @@ impl BodyHooks<'_> { // areas cover its ends and top edge, and a cursor set over them fights the OS's. let moved = os.or(moves_window.then(|| pass::current_viewport(&ctx))); let os_bar = moved.is_some_and(|viewport| windows::shell_of(&ctx, viewport).window.chrome == WindowChrome::Inset); + let hand = pcx.env.get::() == crate::contract::MoveBandCursor::Hand; let mut part = pcx.part(MOVE_BAND, band).sense(craft_behavior::Sense::DRAG).pointer_only(reason); - if !os_bar { + if !os_bar && hand { part = part.cursor(CursorIcon::Grab).drag_cursor(CursorIcon::Grabbing); } if let Some(hit) = exclusive(WindowHit::Move).or(moves_window.then_some(WindowHit::Move)) { diff --git a/crates/ui-contract/src/contract/container.rs b/crates/ui-contract/src/contract/container.rs index 942cdd824..877b18a96 100644 --- a/crates/ui-contract/src/contract/container.rs +++ b/crates/ui-contract/src/contract/container.rs @@ -337,6 +337,20 @@ pub enum QuietHeader { Heads, } +/// The cursor over a header's move band ([`DragBand::Move`]). An app sets it once at its root (`RootEnv::values`); the +/// default is `Hand`. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, crate::runtime::env::EnvValue, crate::contract::MemoProps)] +#[env(style)] +#[non_exhaustive] +pub enum MoveBandCursor { + /// The open hand, and the closed hand while the band is dragged. + #[default] + Hand, + /// The arrow, as an OS title bar shows, also over the click-only controls on the band (menu titles, buttons): + /// production VectorCraft's title bar and panel headers. + Arrow, +} + /// A header region, filled by `Container::header`. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] #[non_exhaustive] diff --git a/crates/ui-contract/src/contract/mod.rs b/crates/ui-contract/src/contract/mod.rs index 60c7bfd0c..9e6f70812 100644 --- a/crates/ui-contract/src/contract/mod.rs +++ b/crates/ui-contract/src/contract/mod.rs @@ -69,8 +69,8 @@ pub use container::InBar; pub use container::InMenu; pub use container::{ BandFill, Bracket, Collapse, ContainerProps, DragBand, EndRegion, FooterPlace, FooterRegion, Gap, HeaderEdge, HeaderParts, HeaderRegion, - LeastWidth, Mount, Notch, POPUP_PAD, Pad, PadEdges, PaneEdge, QuietHeader, Scroll, ScrollAnchor, ScrollAxes, ScrollIndicator, SectionRhythm, - ShellPane, Sizing, ThemeScope, WrapWidth, + LeastWidth, Mount, MoveBandCursor, Notch, POPUP_PAD, Pad, PadEdges, PaneEdge, QuietHeader, Scroll, ScrollAnchor, ScrollAxes, ScrollIndicator, + SectionRhythm, ShellPane, Sizing, ThemeScope, WrapWidth, }; pub use craft_tracked::{PlainData, Revision, Tracked}; pub use craft_ui_macros::{CommandSet, Component, Pattern, PlainData, Props, register_contract}; diff --git a/crates/ui-shell/src/shell/start/stories.rs b/crates/ui-shell/src/shell/start/stories.rs index 7c7eea8b3..7d5036201 100644 --- a/crates/ui-shell/src/shell/start/stories.rs +++ b/crates/ui-shell/src/shell/start/stories.rs @@ -211,9 +211,9 @@ fn page_templates() -> Vec