mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 04:27:49 +00:00
rustfmt batch 10
This commit is contained in:
@@ -778,9 +778,8 @@ pub(crate) fn sense_members(ui: &Ui, arena: ArenaId, specs: &[MemberSpec<'_>]) -
|
||||
let layer = ui.layer_id();
|
||||
let pass_nr = pass::pass_nr(ctx, pass::current_viewport(ctx));
|
||||
// One read of the pointer and one of the arena serve the joins, the outcome and the part results.
|
||||
let (pointer_pos, target, sample) = pointer::with_frame(ctx, |frame, hover| {
|
||||
(hover, frame.map_or(0.0, |frame| frame.target), frame.and_then(|frame| frame.sample))
|
||||
});
|
||||
let (pointer_pos, target, sample) =
|
||||
pointer::with_frame(ctx, |frame, hover| (hover, frame.map_or(0.0, |frame| frame.target), frame.and_then(|frame| frame.sample)));
|
||||
let mut shapes = Vec::new();
|
||||
let mut joined = Vec::with_capacity(specs.len());
|
||||
let recording = crate::runtime::replay::recording(ctx);
|
||||
|
||||
@@ -25,7 +25,10 @@ fn quick_presses_count_clicks_with_their_own_modifiers() {
|
||||
});
|
||||
};
|
||||
let button = |pressed, modifiers| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers };
|
||||
frames.frame(vec![pointer::moved(at), button(true, egui::Modifiers::SHIFT), button(false, egui::Modifiers::SHIFT), button(true, egui::Modifiers::NONE)], &mut show);
|
||||
frames.frame(
|
||||
vec![pointer::moved(at), button(true, egui::Modifiers::SHIFT), button(false, egui::Modifiers::SHIFT), button(true, egui::Modifiers::NONE)],
|
||||
&mut show,
|
||||
);
|
||||
frames.idle(1, &mut show);
|
||||
assert_eq!(counts, vec![1, 1], "a change in modifiers starts a new click sequence");
|
||||
}
|
||||
@@ -38,7 +41,10 @@ fn a_press_uses_its_event_modifiers_when_the_frame_has_released_them() {
|
||||
frames.idle(2, &mut show);
|
||||
let at = area.center();
|
||||
frames.frame(vec![pointer::moved(at)], &mut show);
|
||||
frames.frame(vec![egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::SHIFT }], &mut show);
|
||||
frames.frame(
|
||||
vec![egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::SHIFT }],
|
||||
&mut show,
|
||||
);
|
||||
assert!(log.borrow().last().root.press.mods.shift, "the press reads Shift even after the frame has released it");
|
||||
}
|
||||
|
||||
|
||||
@@ -298,9 +298,10 @@ fn rail_footer_stays_clear_of_icons_on_either_dock_side() {
|
||||
let seen = Rc::clone(&actions);
|
||||
let mut fixture = Fixture::new(move |ui| {
|
||||
let mut workspace = held.borrow().clone();
|
||||
let out = DockArea::new("Rail dock", Bind::given(workspace.clone()), &mut RailWithFooter, DockConfig::default().iconic_mode(IconicMode::Rail))
|
||||
.rail_footer(10)
|
||||
.show(ui);
|
||||
let out =
|
||||
DockArea::new("Rail dock", Bind::given(workspace.clone()), &mut RailWithFooter, DockConfig::default().iconic_mode(IconicMode::Rail))
|
||||
.rail_footer(10)
|
||||
.show(ui);
|
||||
for action in out.actions {
|
||||
drop(workspace.apply(action.clone(), false, |_| Permissions::ALL));
|
||||
seen.borrow_mut().push(action);
|
||||
@@ -326,7 +327,10 @@ fn rail_footer_stays_clear_of_icons_on_either_dock_side() {
|
||||
assert!(last.bottom() <= after.top() && last.top() >= 0.0, "scrolling brings the last icon above the controls: {last:?}, {after:?}");
|
||||
let last = fixture.by_label("Panel 29").expect("the last icon can be clicked");
|
||||
fixture.click(&last).settle();
|
||||
assert!(actions.borrow().iter().any(|action| matches!(action, Action::Activate { panel: 29, .. })), "the scrolled icon still activates its panel");
|
||||
assert!(
|
||||
actions.borrow().iter().any(|action| matches!(action, Action::Activate { panel: 29, .. })),
|
||||
"the scrolled icon still activates its panel"
|
||||
);
|
||||
let expanded = fixture.by_label("Rail controls").expect("the controls remain on the expanded rail").rect;
|
||||
assert!((expanded.center().x - footer.center().x).abs() < footer.width(), "the controls stay at the same dock edge when expanded");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user