forked from 1b-agent/opencadstudio-upstream
Dock: Layer Manager pallet, double-click to float / dock
- LAYERS opens the Layer Manager as a dockable pallet instead of a modal dialog with a darkened backdrop. It floats over the middle of the drawing the first time and keeps its place after that; LAYERS again (or its close button) hides it. The table keeps its natural width and scrolls sideways when the pallet is narrower, and the Name column divider now drags through the dock's pointer capture. Ctrl+A selects all layers while a layer row is selected in the open pallet. - The Layer Manager is listed in the tab-row pallet menu like the others. - Double-clicking a docked title bar floats the panel beside its edge; double-clicking a floating title bar docks the panel on the side its title bar faces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
7 files changed
+177
-45
No files matched your search
+37
-4
@@ -323,13 +323,46 @@ impl LayerPanel {
|
||||
self.linetype_items = items;
|
||||
}
|
||||
|
||||
/// Render the layer panel as the full content of its own OS window.
|
||||
pub fn view_window(
|
||||
/// The Layer Manager as a dock pallet: its title bar, then the table at
|
||||
/// its natural width, scrolling sideways when the pallet is narrower.
|
||||
pub fn view_panel(
|
||||
&self,
|
||||
name_col_w: f32,
|
||||
sizing: crate::ui::modal::ModalSizing,
|
||||
width: f32,
|
||||
chrome: crate::ui::dock::Chrome,
|
||||
) -> Element<'_, Message> {
|
||||
self.view_content(name_col_w, sizing)
|
||||
use crate::ui::dock::PanelId;
|
||||
let title_bar = crate::ui::dock::title_bar(
|
||||
PanelId::Layers,
|
||||
crate::tr!("modal", "layer-manager"),
|
||||
chrome,
|
||||
);
|
||||
let table = self.view_content(
|
||||
name_col_w,
|
||||
crate::ui::modal::ModalSizing {
|
||||
width: Length::Shrink,
|
||||
height: Length::Fill,
|
||||
},
|
||||
);
|
||||
let body = scrollable(table)
|
||||
.direction(iced::widget::scrollable::Direction::Horizontal(
|
||||
iced::widget::scrollable::Scrollbar::new(),
|
||||
))
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill);
|
||||
container(column![title_bar, body])
|
||||
.width(Length::Fixed(width))
|
||||
.height(Length::Fill)
|
||||
.style(|theme: &Theme| container::Style {
|
||||
background: Some(Background::Color(theme.palette().background.base.color)),
|
||||
border: Border {
|
||||
color: theme.palette().background.neutral.color,
|
||||
width: 1.0,
|
||||
radius: 0.0.into(),
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
.into()
|
||||
}
|
||||
|
||||
fn view_content(
|
||||
|
||||
Reference in new issue
Block a user