forked from 1b-agent/opencadstudio-upstream
feat(options): command line text colour and a fonts folder
Display gets a command line text colour (blank keeps the theme's); it covers history, prompts and the input, while errors stay red. Files lists the fonts folder that text resolution searches, so .shx files can be added by hand; opening it creates it first. Discussions #1493, #1372 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
1c37c90c75
commit
7a8ec02003
29 files changed
+144
-15
No files matched your search
@@ -682,6 +682,7 @@ impl OpenCADStudio {
|
||||
cursor_type: self.cursor_type,
|
||||
crosshair_color: self.crosshair_color,
|
||||
snap_marker_color: self.snap_marker_color,
|
||||
command_text_color: self.command_text_color,
|
||||
lineweight_display_scale: self.lineweight_display_scale,
|
||||
isometric_drafting: self.isometric_drafting,
|
||||
iso_plane: self.iso_plane,
|
||||
@@ -798,6 +799,12 @@ impl OpenCADStudio {
|
||||
.snap_marker_color
|
||||
.map(crate::app::config::rgb_to_hex)
|
||||
.unwrap_or_default();
|
||||
self.command_text_color = s.command_text_color;
|
||||
self.command_text_color_input = s
|
||||
.command_text_color
|
||||
.map(crate::app::config::rgb_to_hex)
|
||||
.unwrap_or_default();
|
||||
crate::ui::command_line::set_text_color(s.command_text_color);
|
||||
self.lineweight_display_scale = s.lineweight_display_scale.clamp(25, 200);
|
||||
self.isometric_drafting = s.isometric_drafting;
|
||||
self.iso_plane = s.iso_plane;
|
||||
|
||||
+19
-1
@@ -8060,6 +8060,20 @@ impl OpenCADStudio {
|
||||
None => Message::Noop,
|
||||
},
|
||||
),
|
||||
Message::CommandTextColorChanged(value) => {
|
||||
self.command_text_color_input = value.clone();
|
||||
let color = if value.trim().is_empty() {
|
||||
None
|
||||
} else if let Some(rgb) = crate::app::config::parse_hex(&value) {
|
||||
Some(rgb)
|
||||
} else {
|
||||
return Task::none();
|
||||
};
|
||||
self.command_text_color = color;
|
||||
crate::ui::command_line::set_text_color(color);
|
||||
self.persist_settings_if_changed();
|
||||
Task::none()
|
||||
}
|
||||
Message::SnapMarkerColorChanged(value) => {
|
||||
self.snap_marker_color_input = value.clone();
|
||||
if value.trim().is_empty() {
|
||||
@@ -8532,7 +8546,11 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::OpenFolder(path) => crate::sys::open_url(&path, None),
|
||||
Message::OpenFolder(path) => {
|
||||
// The fonts folder exists only once something is put in it.
|
||||
let _ = std::fs::create_dir_all(&path);
|
||||
crate::sys::open_url(&path, None)
|
||||
}
|
||||
|
||||
Message::PickDragRectToggled(rectangle) => {
|
||||
self.pick_drag_rect = rectangle;
|
||||
|
||||
Reference in new issue
Block a user