forked from 1b-agent/opencadstudio-upstream
Refactor src/main.rs into modular src/app/ structure
Split the 4500-line main.rs into focused submodules under src/app/: - mod.rs: H7CAD struct, Message enum, boot/new/run - document.rs: DocumentTab, HistorySnapshot, HistoryState - helpers.rs: pure helper functions - history.rs: undo/redo logic - properties.rs: properties panel logic - layers.rs: layer sync - commands.rs: dispatch_command - cmd_result.rs: apply_cmd_result - view.rs: view, subscription, tab bar - update.rs: update message handler Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
854f07517e
commit
ed9cbc2092
19 files changed
+4150
-4519
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ use iced::widget::{button, column, container, row, scrollable, text, text_input}
|
||||
use iced::{Background, Border, Color, Element, Length, Theme};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
|
||||
// ── Menu item definitions ─────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! H7CAD-style command line — bottom panel with input and history
|
||||
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
use iced::widget::{column, container, row, text, text_input};
|
||||
use iced::{Background, Border, Color, Element, Length, Theme};
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
//! Layer Manager — floating window.
|
||||
|
||||
use crate::ui::properties::{color_picker_dropdown, LinetypeItem, LwItem, lw_options};
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
use acadrust::tables::layer::Layer as DocLayer;
|
||||
use acadrust::tables::Table;
|
||||
use acadrust::types::aci_table::aci_to_rgb;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ use iced::{Background, Border, Color, Element, Length, Point, Size, Theme};
|
||||
|
||||
use crate::scene::object::GripShape;
|
||||
use crate::scene::SelectionState;
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
|
||||
/// Half-size of the crosshair center square in screen pixels (square = SQ*2 × SQ*2).
|
||||
pub const CROSSHAIR_SQ: f32 = 7.5;
|
||||
|
||||
@@ -22,7 +22,7 @@ const COMBO_PAD_V: f32 = (ROW_H - FONT_SZ * 1.3 - 2.0) / 2.0; // fills combo
|
||||
const SWATCH_SZ: f32 = ROW_H * 0.54; // ≈14 px color swatch
|
||||
|
||||
use crate::scene::object::{PropSection, PropValue};
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
|
||||
const VARIES_LABEL: &str = "*VARIES*";
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ use iced::{Background, Border, Color, Element, Fill, Length, Padding, Theme};
|
||||
use crate::modules::registry;
|
||||
use crate::modules::{CadModule, IconKind, ModuleEvent, RibbonItem, ToolDef};
|
||||
use crate::ui::properties::{LwItem, LinetypeItem, acad_color_display, color_picker_dropdown, lw_options};
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
|
||||
// ── Layout constants ───────────────────────────────────────────────────────
|
||||
//
|
||||
|
||||
@@ -7,7 +7,7 @@ use iced::widget::{button, column, container, mouse_area, row, text};
|
||||
use iced::{Background, Border, Color, Element, Fill, Length, Padding, Theme};
|
||||
|
||||
use crate::snap::{SnapType, Snapper, ALL_SNAP_MODES};
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
|
||||
/// Returns a full-screen overlay element:
|
||||
/// - a transparent click-catcher that closes the popup on outside click
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ use iced::widget::{button, container, row, text, tooltip, Row};
|
||||
use iced::{Background, Border, Color, Element, Length, Theme};
|
||||
|
||||
use crate::snap::Snapper;
|
||||
use crate::Message;
|
||||
use crate::app::Message;
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct StatusBar {
|
||||
|
||||
Reference in new issue
Block a user