forked from 1b-agent/opencadstudio-upstream
feat(options): menu bar, ribbon and HPASSOC switches; see-through command line by default
Options > Display gains Window Elements with "Show the menu bar" (MENUBAR) and "Show the ribbon" (RIBBON / RIBBONCLOSE); Options > User Preferences gains a Hatch switch for HPASSOC. The command line now starts at 80 % opacity so the drawing shows through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ee18f7ad3c
commit
8a2bc443e0
29 files changed
+163
-3
No files matched your search
@@ -2616,6 +2616,12 @@ pub enum Message {
|
||||
/// Toggle reversing the mouse-wheel zoom direction (ZOOMWHEEL).
|
||||
ZoomWheelReversedChanged(bool),
|
||||
TouchpadPanChanged(bool),
|
||||
/// Options: show the pull-down menus (MENUBAR).
|
||||
MenuBarChanged(bool),
|
||||
/// Options: show the ribbon (RIBBON / RIBBONCLOSE).
|
||||
RibbonVisibleChanged(bool),
|
||||
/// Options: new hatches are associative (HPASSOC).
|
||||
HatchAssociativeChanged(bool),
|
||||
/// Interface scale in percent (Options > Display).
|
||||
UiScaleChanged(u16),
|
||||
/// Change how far one wheel notch zooms, from the Options slider
|
||||
|
||||
+1
-1
@@ -904,7 +904,7 @@ impl Default for UserSettings {
|
||||
language: crate::i18n::Language::default(),
|
||||
cliprompt_lines: 3,
|
||||
commandline_fade_ms: 3000,
|
||||
command_line_opacity: 100,
|
||||
command_line_opacity: 80,
|
||||
snap_spacing_x: 10.0,
|
||||
snap_spacing_y: 10.0,
|
||||
grid_spacing_x: 10.0,
|
||||
|
||||
@@ -9082,6 +9082,24 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::MenuBarChanged(shown) => {
|
||||
self.show_menu_bar = shown;
|
||||
self.persist_settings_if_changed();
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::RibbonVisibleChanged(shown) => {
|
||||
self.ribbon_closed = !shown;
|
||||
self.persist_settings_if_changed();
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::HatchAssociativeChanged(associative) => {
|
||||
self.hatch_associative = associative;
|
||||
self.persist_settings_if_changed();
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::TouchpadPanChanged(enabled) => {
|
||||
self.touchpad_pan = enabled;
|
||||
self.persist_settings_if_changed();
|
||||
|
||||
@@ -300,6 +300,9 @@ impl OpenCADStudio {
|
||||
cliprompt_lines: self.cliprompt_lines,
|
||||
commandline_fade_ms: self.commandline_fade_ms,
|
||||
command_line_opacity: self.command_line.opacity_percent(),
|
||||
show_menu_bar: self.show_menu_bar,
|
||||
show_ribbon: !self.ribbon_closed,
|
||||
hatch_associative: self.hatch_associative,
|
||||
zoom_wheel_reversed: self.zoom_wheel_reversed,
|
||||
touchpad_pan: self.touchpad_pan,
|
||||
ui_scale_percent: self.ui_scale_percent,
|
||||
|
||||
@@ -3697,6 +3697,10 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
|
||||
"Width factor" => Some(("common", "width-factor-sentence-case")),
|
||||
"Width: %{value}" => Some(("ui", "width-value")),
|
||||
"Window" => Some(("common", "window")),
|
||||
"Window Elements" => Some(("common", "options-window-elements")),
|
||||
"Show the menu bar (MENUBAR)" => Some(("common", "options-show-menu-bar")),
|
||||
"Show the ribbon (RIBBON / RIBBONCLOSE)" => Some(("common", "options-show-ribbon")),
|
||||
"New hatches follow their boundaries (HPASSOC)" => Some(("common", "options-hpassoc")),
|
||||
"Arc Length" => Some(("common", "menu-arc-length")),
|
||||
"Construction Line" => Some(("common", "menu-construction-line")),
|
||||
"Dimension Style" => Some(("common", "menu-dimension-style")),
|
||||
|
||||
@@ -192,7 +192,7 @@ pub struct CommandLine {
|
||||
/// the pinned step prompt still shows.
|
||||
fade_ms: u32,
|
||||
/// COMMANDLINEOPACITY: how opaque the command line's panels are, in
|
||||
/// percent (20–100, default 100), so the drawing shows through.
|
||||
/// percent (20–100, default 80), so the drawing shows through.
|
||||
opacity_percent: u8,
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ impl Default for CommandLine {
|
||||
step_options: Vec::new(),
|
||||
cliprompt_lines: 3,
|
||||
fade_ms: DEFAULT_COMMANDLINE_FADE_MS,
|
||||
opacity_percent: 100,
|
||||
opacity_percent: 80,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,12 @@ pub struct AppPrefs {
|
||||
pub commandline_fade_ms: i32,
|
||||
/// COMMANDLINEOPACITY: command-line panel opacity in percent.
|
||||
pub command_line_opacity: u8,
|
||||
/// MENUBAR: the pull-down menus show above the ribbon.
|
||||
pub show_menu_bar: bool,
|
||||
/// The ribbon shows (RIBBON / RIBBONCLOSE).
|
||||
pub show_ribbon: bool,
|
||||
/// HPASSOC: new hatches follow their boundary objects.
|
||||
pub hatch_associative: bool,
|
||||
/// ZOOMWHEEL: reverse the mouse-wheel zoom direction.
|
||||
pub zoom_wheel_reversed: bool,
|
||||
/// Scroll pans and Ctrl+scroll zooms (touchpads).
|
||||
@@ -920,6 +926,30 @@ pub fn view_window<'a>(
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
.push(Space::new().height(24))
|
||||
.push(text(crate::t!("Window Elements")).size(15))
|
||||
.push(Space::new().height(10))
|
||||
.push(
|
||||
row![
|
||||
iced::widget::checkbox(prefs.show_menu_bar)
|
||||
.on_toggle(Message::MenuBarChanged)
|
||||
.size(15),
|
||||
text(crate::t!("Show the menu bar (MENUBAR)")).size(12),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
.push(Space::new().height(8))
|
||||
.push(
|
||||
row![
|
||||
iced::widget::checkbox(prefs.show_ribbon)
|
||||
.on_toggle(Message::RibbonVisibleChanged)
|
||||
.size(15),
|
||||
text(crate::t!("Show the ribbon (RIBBON / RIBBONCLOSE)")).size(12),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
.push(Space::new().height(24))
|
||||
.push(text(crate::t!("Command Line")).size(15))
|
||||
.push(Space::new().height(10))
|
||||
.push(
|
||||
@@ -1479,6 +1509,17 @@ pub fn view_window<'a>(
|
||||
]
|
||||
.spacing(10)
|
||||
.align_y(iced::Center),
|
||||
Space::new().height(24),
|
||||
text(crate::t!("Hatch")).size(15),
|
||||
Space::new().height(10),
|
||||
row![
|
||||
iced::widget::checkbox(prefs.hatch_associative)
|
||||
.on_toggle(Message::HatchAssociativeChanged)
|
||||
.size(15),
|
||||
text(crate::t!("New hatches follow their boundaries (HPASSOC)")).size(12),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(iced::Center),
|
||||
]
|
||||
.spacing(0)
|
||||
.width(sizing.width);
|
||||
|
||||
Reference in new issue
Block a user