forked from 1b-agent/opencadstudio-upstream
feat(commandline): float as bottom-centre overlay over the viewport
The command-line panel used to consume a full-width row at the bottom of the main column, taking vertical space away from the drawing area even when no command was active. Move it onto the viewport stack as a fixed-width 720 px pill aligned to the bottom-centre, with rounded corners so it reads as a floating element. The status bar still owns the very bottom of the window. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
979ca28632
commit
862e5aed31
2 files changed
+26
-9
No files matched your search
+22
-5
@@ -504,10 +504,28 @@ impl OpenCADStudio {
|
|||||||
Space::new().into()
|
Space::new().into()
|
||||||
};
|
};
|
||||||
|
|
||||||
let center_stack =
|
// Command-line sits as a bottom-centre overlay on top of the
|
||||||
iced::widget::stack![row![properties_el, viewport_stack].width(Fill).height(Fill),]
|
// viewport stack rather than as a separate row in the main
|
||||||
.width(Fill)
|
// column — frees up vertical space when no command is active
|
||||||
.height(Fill);
|
// and keeps the input close to where the cursor is drawing.
|
||||||
|
let command_line_overlay = iced::widget::container(self.command_line.view())
|
||||||
|
.width(Fill)
|
||||||
|
.height(Fill)
|
||||||
|
.align_x(iced::alignment::Horizontal::Center)
|
||||||
|
.align_y(iced::alignment::Vertical::Bottom)
|
||||||
|
.padding(iced::Padding {
|
||||||
|
top: 0.0,
|
||||||
|
right: 0.0,
|
||||||
|
bottom: 2.0,
|
||||||
|
left: 0.0,
|
||||||
|
});
|
||||||
|
|
||||||
|
let center_stack = iced::widget::stack![
|
||||||
|
row![properties_el, viewport_stack].width(Fill).height(Fill),
|
||||||
|
command_line_overlay,
|
||||||
|
]
|
||||||
|
.width(Fill)
|
||||||
|
.height(Fill);
|
||||||
|
|
||||||
let main_ui = container({
|
let main_ui = container({
|
||||||
let mut col = column![self.ribbon.view(
|
let mut col = column![self.ribbon.view(
|
||||||
@@ -519,7 +537,6 @@ impl OpenCADStudio {
|
|||||||
col = col.push(doc_tab_bar(&self.tabs, self.active_tab));
|
col = col.push(doc_tab_bar(&self.tabs, self.active_tab));
|
||||||
}
|
}
|
||||||
col.push(center_stack)
|
col.push(center_stack)
|
||||||
.push(self.command_line.view())
|
|
||||||
.push({
|
.push({
|
||||||
let is_model = tab.scene.current_layout == "Model";
|
let is_model = tab.scene.current_layout == "Model";
|
||||||
let scale_pill_enabled = is_model
|
let scale_pill_enabled = is_model
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ impl CommandLine {
|
|||||||
a: 1.0,
|
a: 1.0,
|
||||||
},
|
},
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
radius: 0.0.into(),
|
radius: 2.0.into(),
|
||||||
},
|
},
|
||||||
icon: Color::WHITE,
|
icon: Color::WHITE,
|
||||||
placeholder: Color {
|
placeholder: Color {
|
||||||
@@ -183,7 +183,7 @@ impl CommandLine {
|
|||||||
border: Border {
|
border: Border {
|
||||||
color: BORDER_COLOR,
|
color: BORDER_COLOR,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
radius: 0.0.into()
|
radius: 3.0.into()
|
||||||
},
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
@@ -194,11 +194,11 @@ impl CommandLine {
|
|||||||
border: Border {
|
border: Border {
|
||||||
color: BORDER_COLOR,
|
color: BORDER_COLOR,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
radius: 0.0.into(),
|
radius: 4.0.into(),
|
||||||
},
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
.width(Length::Fill)
|
.width(Length::Fixed(720.0))
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user