From 30e16f7f1602f84f8defcfcb18249afe8c1fa8c2 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 19:42:54 +0000 Subject: [PATCH] Remove the logo-and-name beside the menu bar; version 2.2.2 The application button already is the DraftCraft logo; the second, larger logo with the wordmark beside File pushed the menus right. Both the Windows title bar and the web build's top row now start with the menus. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F67RssNr67uM2HRS3vdet4 --- CHANGELOG.md | 5 +++++ Cargo.lock | 34 +++++++++++++++--------------- Cargo.toml | 2 +- crates/ui-egui/src/menus.rs | 13 +++--------- crates/ui-egui/src/window_frame.rs | 16 ++++++-------- 5 files changed, 33 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 828cdf42..35428276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ How to write it (see AGENTS.md): ## Unreleased +## 2.2.2 + +### Improved +- The DraftCraft logo with its name no longer sits beside the menu bar: the application button already is the logo, so the menus (File, Edit …) start at the left edge. + ## 2.2.1 ### New diff --git a/Cargo.lock b/Cargo.lock index 50c72123..46ba4072 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1196,7 +1196,7 @@ checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" [[package]] name = "draftcraft" -version = "2.2.1" +version = "2.2.2" dependencies = [ "chrono", "clap", @@ -1226,7 +1226,7 @@ dependencies = [ [[package]] name = "draftcraft-cli" -version = "2.2.1" +version = "2.2.2" dependencies = [ "clap", "clap_complete", @@ -1242,14 +1242,14 @@ dependencies = [ [[package]] name = "draftcraft-color" -version = "2.2.1" +version = "2.2.2" dependencies = [ "serde", ] [[package]] name = "draftcraft-constraints" -version = "2.2.1" +version = "2.2.2" dependencies = [ "draftcraft-doc", "draftcraft-geom", @@ -1259,7 +1259,7 @@ dependencies = [ [[package]] name = "draftcraft-doc" -version = "2.2.1" +version = "2.2.2" dependencies = [ "draftcraft-color", "draftcraft-geom", @@ -1270,14 +1270,14 @@ dependencies = [ [[package]] name = "draftcraft-dwg" -version = "2.2.1" +version = "2.2.2" dependencies = [ "chrono", ] [[package]] name = "draftcraft-dxf" -version = "2.2.1" +version = "2.2.2" dependencies = [ "encoding_rs", "log", @@ -1286,7 +1286,7 @@ dependencies = [ [[package]] name = "draftcraft-engine" -version = "2.2.1" +version = "2.2.2" dependencies = [ "craft-docpath", "draftcraft-color", @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "draftcraft-fonts" -version = "2.2.1" +version = "2.2.2" dependencies = [ "draftcraft-geom", "encoding_rs", @@ -1322,14 +1322,14 @@ dependencies = [ [[package]] name = "draftcraft-geom" -version = "2.2.1" +version = "2.2.2" dependencies = [ "serde", ] [[package]] name = "draftcraft-io" -version = "2.2.1" +version = "2.2.2" dependencies = [ "chrono", "craft-pdf", @@ -1352,7 +1352,7 @@ dependencies = [ [[package]] name = "draftcraft-mcp" -version = "2.2.1" +version = "2.2.2" dependencies = [ "clap", "draftcraft-engine", @@ -1366,7 +1366,7 @@ dependencies = [ [[package]] name = "draftcraft-render" -version = "2.2.1" +version = "2.2.2" dependencies = [ "draftcraft-color", "draftcraft-doc", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "draftcraft-setup" -version = "2.2.1" +version = "2.2.2" dependencies = [ "rfd", "winresource", @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "draftcraft-ui-egui" -version = "2.2.1" +version = "2.2.2" dependencies = [ "chrono", "craft-ui", @@ -1416,7 +1416,7 @@ dependencies = [ [[package]] name = "draftcraft-web" -version = "2.2.1" +version = "2.2.2" dependencies = [ "craft-web-host", "draftcraft-engine", @@ -6151,7 +6151,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee" [[package]] name = "xtask" -version = "2.2.1" +version = "2.2.2" dependencies = [ "chrono", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 3ac73684..1fc2b168 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"] # default-members [workspace.package] -version = "2.2.1" +version = "2.2.2" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 431a3973..48cbe135 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -794,8 +794,8 @@ pub fn menu_bar(app: &mut CadApp, ui: &mut egui::Ui) { } } -/// The web build's top row, matching DraftCraft's own title bar on Windows: the logo, the name, then -/// the menus (File … Help), above the application bar and the ribbon. A browser tab has no title +/// The web build's top row, matching DraftCraft's own title bar on Windows: the menus (File … +/// Help), above the application bar and the ribbon (whose application button is the logo). A browser tab has no title /// bar of DraftCraft's own, so without this the menu bar sat under the ribbon. #[cfg(target_arch = "wasm32")] pub fn web_top_row(app: &mut CadApp, ui: &mut egui::Ui) { @@ -803,10 +803,7 @@ pub fn web_top_row(app: &mut CadApp, ui: &mut egui::Ui) { let mut clicked = None; egui::Panel::top("cc_menubar").exact_size(WEB_TOP_ROW_H).frame(egui::Frame::NONE.fill(t.chrome_dark)).show(ui, |ui| { let r = ui.max_rect(); - let p = ui.painter().clone(); - let logo_left = r.left() + 8.0; - let logo_w = crate::brand::paint_full(&p, logo_left, r.center().y, WEB_LOGO_H, t.chrome_dark); - let menus = egui::Rect::from_min_max(egui::pos2(logo_left + logo_w + 12.0, r.top()), r.max); + let menus = egui::Rect::from_min_max(egui::pos2(r.left() + 6.0, r.top()), r.max); ui.scope_builder(egui::UiBuilder::new().max_rect(menus).layout(egui::Layout::left_to_right(egui::Align::Center)), |ui| { ui.set_clip_rect(menus); clicked = menu_titles(app, ui); @@ -821,10 +818,6 @@ pub fn web_top_row(app: &mut CadApp, ui: &mut egui::Ui) { #[cfg(target_arch = "wasm32")] const WEB_TOP_ROW_H: f32 = 30.0; -/// Height of the full logo (icon and wordmark) in the web build's top row: as in the Windows title bar. -#[cfg(target_arch = "wasm32")] -const WEB_LOGO_H: f32 = 24.0; - /// The menu titles (File, Edit … Help) and their menus, in `ui`. Returns the command chosen. pub fn menu_titles(app: &CadApp, ui: &mut egui::Ui) -> Option { let tree = tree(app); diff --git a/crates/ui-egui/src/window_frame.rs b/crates/ui-egui/src/window_frame.rs index 0e562fdf..34db0dd4 100644 --- a/crates/ui-egui/src/window_frame.rs +++ b/crates/ui-egui/src/window_frame.rs @@ -1,6 +1,7 @@ //! DraftCraft's own window frame, as Windows CAD programs draw theirs. The desktop's title bar is -//! turned off and DraftCraft draws one row in its place: the logo, the name, the menu bar (File, -//! Edit, View … Help) and the minimize, maximize and close buttons. Its empty part moves the +//! turned off and DraftCraft draws one row in its place: the menu bar (File, Edit, View … Help) +//! and the minimize, maximize and close buttons. No logo there: the application button under it +//! already is the DraftCraft logo. Its empty part moves the //! window (a double-click maximizes it), and the window's edges and corners resize it. The menu //! bar no longer needs a row of its own under the ribbon. //! @@ -16,8 +17,8 @@ use crate::theme::Tokens; /// Height of the title bar row. pub const TITLE_H: f32 = 30.0; -/// Height of the full logo (icon and wordmark) in the title bar, in points. -const LOGO_H: f32 = 24.0; +/// The menu bar's distance from the window's left edge. +pub const MENU_INSET: f32 = 6.0; /// Width of each window button, as Windows draws them. const BUTTON_W: f32 = 46.0; /// How far in from the window's edge a press resizes it. @@ -59,7 +60,7 @@ enum Caption { Close, } -/// The title bar row: logo, name, menu bar, the empty part that moves the window, window buttons. +/// The title bar row: menu bar, the empty part that moves the window, window buttons. pub fn title_bar(app: &mut CadApp, ui: &mut egui::Ui) { let t = Tokens::get(); let mut clicked = None; @@ -70,11 +71,8 @@ pub fn title_bar(app: &mut CadApp, ui: &mut egui::Ui) { // First, so the controls drawn over it keep their own clicks. let title = crate::chrome::window_title(app); craft_window::title_bar::empty_area(ui, free).on_hover_text(title.clone()); - let p = ui.painter().clone(); - let logo_left = r.left() + 8.0; - let logo_w = crate::brand::paint_full(&p, logo_left, r.center().y, LOGO_H, t.chrome_dark); if app.ui.in_window_menu { - let menus = Rect::from_min_max(pos2(logo_left + logo_w + 12.0, r.top()), pos2(free.right(), r.bottom())); + let menus = Rect::from_min_max(pos2(r.left() + MENU_INSET, r.top()), pos2(free.right(), r.bottom())); ui.scope_builder(egui::UiBuilder::new().max_rect(menus).layout(egui::Layout::left_to_right(egui::Align::Center)), |ui| { ui.set_clip_rect(menus); clicked = crate::menus::menu_titles(app, ui);