forked from 1b-agent/opencadstudio-upstream
feat(ui): replace app-menu logo with a quick-access file toolbar
Remove the OCS-logo button and the dropdown menu it opened; the top strip now shows direct New / Open / Save / Save As / Print buttons ahead of the undo/redo controls. Drop the HELP and OPTIONS commands (HELP dumped text to the command line, OPTIONS aliased the drafting-settings popup). The app-menu overlay is gone, so its rendering code, MENU_ITEMS, four dead messages, and the LOGO_RED / GEAR / HELP assets are removed. The recents list it held is the only survivor — moved into OpenCADStudio.recent_files via a new app/recent.rs, backing the Start page's Recent Documents panel. Quick-access icons are redrawn in a cleaner style (file-plus, folder-open, device-floppy, file-export, printer) and tinted light so they read on the dark strip; FOLDER / DOC keep their old glyphs for the file browser. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
2bc5c2a686
commit
7bab7c7b8d
17 files changed
+154
-643
No files matched your search
+6
-12
@@ -14,6 +14,7 @@ mod mtext_editor;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub mod plugin_host;
|
||||
mod properties;
|
||||
mod recent;
|
||||
mod settings;
|
||||
mod style_ops;
|
||||
mod text_inline;
|
||||
@@ -155,7 +156,7 @@ pub struct QSelectState {
|
||||
pub append: bool,
|
||||
}
|
||||
use crate::snap::Snapper;
|
||||
use crate::ui::{AppMenu, CommandLine, Ribbon, StatusBar};
|
||||
use crate::ui::{CommandLine, Ribbon, StatusBar};
|
||||
use acadrust::types::{Color as AcadColor, LineWeight};
|
||||
use acadrust::CadDocument;
|
||||
|
||||
@@ -192,7 +193,8 @@ pub(super) struct OpenCADStudio {
|
||||
active_tab: usize,
|
||||
tab_counter: usize,
|
||||
ribbon: Ribbon,
|
||||
app_menu: AppMenu,
|
||||
/// Recently opened files, newest first — backs the Start page panel.
|
||||
recent_files: Vec<std::path::PathBuf>,
|
||||
command_line: CommandLine,
|
||||
/// Paying Patreon supporters shown on the Start page (name, pledge cents),
|
||||
/// fetched once at boot, highest pledge first.
|
||||
@@ -1121,12 +1123,6 @@ pub enum Message {
|
||||
command: String,
|
||||
path: Option<std::path::PathBuf>,
|
||||
},
|
||||
// ── Application menu ──────────────────────────────────────────────────
|
||||
ToggleAppMenu,
|
||||
CloseAppMenu,
|
||||
/// Close the menu and immediately dispatch a CAD command.
|
||||
CloseAppMenuAndRun(String),
|
||||
AppMenuSearch(String),
|
||||
// ── Document tabs ──────────────────────────────────────────────────────
|
||||
/// Create a new empty document tab.
|
||||
TabNew,
|
||||
@@ -1918,16 +1914,14 @@ impl OpenCADStudio {
|
||||
// Boot with only the Welcome/Start tab. The user creates drawings
|
||||
// explicitly (File → New); we never auto-spawn Drawing1.
|
||||
let start_tab = DocumentTab::new_start();
|
||||
let mut app_menu = AppMenu::new();
|
||||
// Restore recents from disk so the Start page lists them across runs.
|
||||
app_menu.load_persistent_recents();
|
||||
let mut app = Self {
|
||||
start: Instant::now(),
|
||||
tabs: vec![start_tab],
|
||||
active_tab: 0,
|
||||
tab_counter: 0,
|
||||
ribbon: Ribbon::new(),
|
||||
app_menu,
|
||||
// Restore recents from disk so the Start page lists them across runs.
|
||||
recent_files: recent::load_recent_files(),
|
||||
command_line: CommandLine::new(),
|
||||
patrons: Vec::new(),
|
||||
history_content: iced::widget::text_editor::Content::new(),
|
||||
|
||||
Reference in new issue
Block a user