forked from 1b-agent/opencadstudio-upstream
Dock: keep the slot splitter at the edge column's width
A Fill-width splitter stretched the whole edge column across the workspace when two slots were stacked, squeezing the drawing view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
1 file changed
+9
-4
+9
-4
@@ -2792,7 +2792,7 @@ impl OpenCADStudio {
|
|||||||
let mut layers: Vec<Element<'_, Message>> = Vec::new();
|
let mut layers: Vec<Element<'_, Message>> = Vec::new();
|
||||||
for (n, gi) in expanded.iter().enumerate() {
|
for (n, gi) in expanded.iter().enumerate() {
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
layers.push(dock_splitter(side, expanded[n - 1], *gi));
|
layers.push(dock_splitter(side, expanded[n - 1], *gi, col_w));
|
||||||
}
|
}
|
||||||
let weight = self.dock.groups(side)[*gi].weight;
|
let weight = self.dock.groups(side)[*gi].weight;
|
||||||
layers.push(
|
layers.push(
|
||||||
@@ -3505,12 +3505,14 @@ impl canvas::Program<Message> for VBarLabel {
|
|||||||
|
|
||||||
/// Width of a collapsed (auto-collapsing) panel's tab in the edge strip.
|
/// Width of a collapsed (auto-collapsing) panel's tab in the edge strip.
|
||||||
const DOCK_RAIL_W: f32 = 28.0;
|
const DOCK_RAIL_W: f32 = 28.0;
|
||||||
|
/// Width of the grabbable divider between a docked panel and the viewport.
|
||||||
|
const DOCK_DIVIDER_W: f32 = 5.0;
|
||||||
|
|
||||||
/// Grabbable separator for a docked panel managed by the general dock. Same
|
/// Grabbable separator for a docked panel managed by the general dock. Same
|
||||||
/// visual as the previous per-panel divider but emits generic dock messages.
|
/// visual as the previous per-panel divider but emits generic dock messages.
|
||||||
fn dock_divider(id: crate::ui::dock::PanelId) -> Element<'static, Message> {
|
fn dock_divider(id: crate::ui::dock::PanelId) -> Element<'static, Message> {
|
||||||
let line = container(Space::new())
|
let line = container(Space::new())
|
||||||
.width(Length::Fixed(5.0))
|
.width(Length::Fixed(DOCK_DIVIDER_W))
|
||||||
.height(Fill)
|
.height(Fill)
|
||||||
.style(|theme: &Theme| container::Style {
|
.style(|theme: &Theme| container::Style {
|
||||||
background: Some(Background::Color(theme.palette().background.neutral.color)),
|
background: Some(Background::Color(theme.palette().background.neutral.color)),
|
||||||
@@ -3598,14 +3600,17 @@ fn dock_tab_strip(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Draggable bar between two expanded slots on an edge; double-click gives
|
/// Draggable bar between two expanded slots on an edge; double-click gives
|
||||||
/// every slot on the edge the same height again.
|
/// every slot on the edge the same height again. It spans exactly the slots'
|
||||||
|
/// width (panel plus its divider): a `Fill` width would stretch the whole
|
||||||
|
/// edge column across the workspace and squeeze the drawing view.
|
||||||
fn dock_splitter(
|
fn dock_splitter(
|
||||||
side: crate::app::config::DockSide,
|
side: crate::app::config::DockSide,
|
||||||
upper: usize,
|
upper: usize,
|
||||||
lower: usize,
|
lower: usize,
|
||||||
|
col_w: f32,
|
||||||
) -> Element<'static, Message> {
|
) -> Element<'static, Message> {
|
||||||
let line = container(Space::new())
|
let line = container(Space::new())
|
||||||
.width(Fill)
|
.width(Length::Fixed(col_w + DOCK_DIVIDER_W))
|
||||||
.height(Length::Fixed(5.0))
|
.height(Length::Fixed(5.0))
|
||||||
.style(|theme: &Theme| container::Style {
|
.style(|theme: &Theme| container::Style {
|
||||||
background: Some(Background::Color(theme.palette().background.neutral.color)),
|
background: Some(Background::Color(theme.palette().background.neutral.color)),
|
||||||
|
|||||||
Reference in new issue
Block a user