Interaction · Pointer: resize, turn, band selection, and gpui's own drag
Resizable sizes a box from its right and bottom edges and a grip at its corner, within its least and greatest size; the grip is a Tab stop whose arrows resize a step. Rotatable turns an svg to its angle inside a ring whose knob a drag moves, Shift snapping to 15 degrees, with the arrows turning it a notch. SelectionArea selects items with a band drawn on empty space, a press, Command or Shift to add, and a cursor the arrows walk with Space to add or drop; Escape clears and Command-A takes all. The gallery shows gpui's own drag and drop, drag preview, double press and wheel zoom, with pointers for Sortable, LongPress and PanZoom; pinch stays blocked, gpui 0.2.2 forwards no magnify event.
This commit is contained in:
1 parent
8ade21b7ba
commit
040fc94f49
14 files changed
+1413
-16
No files matched your search
@@ -0,0 +1,21 @@
|
||||
use gpui::Rems;
|
||||
|
||||
use super::{Theme, tokens::px_to_rems};
|
||||
|
||||
/// Interaction's measures.
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub struct InteractionSizes {
|
||||
/// What an arrow key resizes a box by.
|
||||
pub step: Rems,
|
||||
/// A resize corner's grip, square.
|
||||
pub grip: Rems,
|
||||
}
|
||||
|
||||
impl Theme {
|
||||
pub fn interaction(&self) -> InteractionSizes {
|
||||
InteractionSizes {
|
||||
step: px_to_rems(8.0),
|
||||
grip: px_to_rems(12.0),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ mod chart;
|
||||
mod dashboard;
|
||||
mod files;
|
||||
mod generative;
|
||||
mod interaction;
|
||||
mod media;
|
||||
mod messaging;
|
||||
mod onboarding;
|
||||
@@ -22,6 +23,7 @@ pub use chart::ChartSizes;
|
||||
pub use dashboard::DashboardSizes;
|
||||
pub use files::FileSizes;
|
||||
pub use generative::GenerativeSizes;
|
||||
pub use interaction::InteractionSizes;
|
||||
pub use media::MediaSizes;
|
||||
pub use messaging::MessagingSizes;
|
||||
pub use onboarding::OnboardingSizes;
|
||||
|
||||
Reference in new issue
Block a user