mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 16:53:05 +00:00
A dock drop's mark is DropMark::Region: the rect the moved panels take once dropped, laid out from the layout after the drop by the functions the dock draws with (tree frames, column cells, column group rects) in the room the dock registered, pruned as the area shows it. A tab join adds its tab line; a reorder in the own strip marks the line only. The ghost painter washes the region with the drop rule's colour under the shared band. Region replaces DropMark::Split; a spot without a placed rect marks a line along its edge.
39 lines
937 B
Rust
39 lines
937 B
Rust
//! Docking (20.6): panels and groups dragged through the drag session land on the group and side the pointer is over.
|
|
|
|
use craft_theme::{Contrast, ControlSize, Mode, Variant};
|
|
use craft_ui::docking::DockSizes;
|
|
use craft_ui::testing::style::{tokens, with_cx};
|
|
|
|
mod render;
|
|
|
|
mod panel_menu;
|
|
mod runs;
|
|
|
|
mod split;
|
|
|
|
mod drop;
|
|
mod drop_preview;
|
|
mod drop_session;
|
|
|
|
mod floating;
|
|
mod floating_area;
|
|
mod hidden;
|
|
|
|
mod columns;
|
|
mod dock_back;
|
|
mod group_view;
|
|
mod workspace_dialogs;
|
|
|
|
mod native;
|
|
|
|
/// The docking sizes of the default theme with the given divider gap, least pane and strip height.
|
|
fn sizes(gap: f32, least_pane: f32, strip: f32) -> DockSizes {
|
|
with_cx(&egui::Context::default(), &tokens(Mode::Light, Contrast::Standard), Variant::SECONDARY, ControlSize::Md, |cx| {
|
|
let mut sizes = DockSizes::style(cx);
|
|
sizes.gap = gap;
|
|
sizes.least_pane = least_pane;
|
|
sizes.strip = strip;
|
|
sizes
|
|
})
|
|
}
|