forked from 1b-agent/opencadstudio-upstream
Dock: move app-side dock code into app::dock, trim tests, drop icon tooltip
- The dock's state handling and drawing move out of update/dialog.rs and view/mod.rs into src/app/dock/ (update.rs, view.rs, tests.rs). The overlay view_main stacked over the workspace (floating pallets, + menu, drag preview, pointer capture) becomes one `dock_overlay` call. Code is moved, not changed. - Strip icons no longer show the pallet name on hover. - Tests trimmed where they overlapped: the top / bottom half drops are one test, the two hover tests are one, and the in-group icon reorder, raise-float, empty floating title bar and slot-span tests are dropped (each is covered by another test). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
8 files changed
+2266
-2306
No files matched your search
@@ -1412,22 +1412,6 @@ mod tests {
|
||||
assert_eq!((f.x, f.w), (DOCK_MIN_W - 350.0, 350.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn raise_float_moves_it_to_the_front() {
|
||||
let mut state = DockState::default();
|
||||
for id in [PanelId::Count, PanelId::Browser] {
|
||||
state.float(FloatPanel {
|
||||
id,
|
||||
x: 0.0,
|
||||
y: 0.0,
|
||||
w: 300.0,
|
||||
h: 300.0,
|
||||
});
|
||||
}
|
||||
state.raise_float(PanelId::Count);
|
||||
assert_eq!(state.floating.last().map(|f| f.id), Some(PanelId::Count));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_panel_has_its_own_icon() {
|
||||
let ids = PanelId::ALL;
|
||||
@@ -1439,25 +1423,4 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn floating_title_bar_replaces_the_horizontal_one() {
|
||||
let floating = Chrome {
|
||||
floating: true,
|
||||
..Default::default()
|
||||
};
|
||||
let bar: Element<'_, Message> = title_bar(PanelId::Count, "Count".into(), floating);
|
||||
assert_eq!(
|
||||
bar.as_widget().size(),
|
||||
iced::Size::new(Length::Fixed(0.0), Length::Fixed(0.0))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn slot_spans_follow_weights() {
|
||||
assert_eq!(
|
||||
slot_spans(&[1.0, 3.0], 400.0),
|
||||
vec![(0.0, 100.0), (100.0, 400.0)]
|
||||
);
|
||||
assert!(slot_spans(&[], 400.0).is_empty());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user