From ff1a939ef3d7b93ffeec4f4b435365918922851d Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Sun, 18 Oct 2026 23:04:13 +0300 Subject: [PATCH] Remove the in-app close button; the window manager provides window controls Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 4 ++++ apps/desktop/src/app.rs | 2 -- apps/desktop/src/game_view.rs | 4 ---- apps/desktop/src/i18n.rs | 8 -------- apps/desktop/src/library.rs | 4 ---- apps/desktop/src/widgets.rs | 6 ------ 6 files changed, 4 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa894e0..4618ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes are listed here. Versions follow [Semantic Versioning](https://semver.org/). +## [Unreleased] + +- Removed the in-app ✕ (close) button: the window manager or desktop provides window controls. + ## [0.3.0] — 2026-10-18 - Open ChessBase databases (`.cbh` with companion files) and ChessBase archives (`.cbv`), and diff --git a/apps/desktop/src/app.rs b/apps/desktop/src/app.rs index dffbd0f..6fc9798 100644 --- a/apps/desktop/src/app.rs +++ b/apps/desktop/src/app.rs @@ -580,7 +580,6 @@ impl eframe::App for App { self.settings_ui.open = true; self.settings_ui.tab = Tab::Engines; } - GameAction::Quit => ctx.send_viewport_cmd(egui::ViewportCommand::Close), GameAction::OpenSettings => self.settings_ui.open = !self.settings_ui.open, GameAction::Toast(m) => self.toast(&ctx, m), GameAction::PauseLive => { @@ -614,7 +613,6 @@ impl eframe::App for App { self.settings_dirty = true; } LibraryAction::OpenSettings => self.settings_ui.open = true, - LibraryAction::Quit => ctx.send_viewport_cmd(egui::ViewportCommand::Close), } } } diff --git a/apps/desktop/src/game_view.rs b/apps/desktop/src/game_view.rs index 0481ace..cdc2c00 100644 --- a/apps/desktop/src/game_view.rs +++ b/apps/desktop/src/game_view.rs @@ -76,7 +76,6 @@ pub enum GameAction { EngineSwitch, OpenEngineSettings, OpenSettings, - Quit, Toast(String), /// A whole-game analysis started: pause the live engine (they would share the CPU). PauseLive, @@ -377,9 +376,6 @@ impl GameView { } }); ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { - if crate::widgets::close_button(ui).clicked() { - actions.push(GameAction::Quit); - } if ui .button(tr("⚙ Settings")) .on_hover_text("Ctrl+,") diff --git a/apps/desktop/src/i18n.rs b/apps/desktop/src/i18n.rs index c34458d..64cc53d 100644 --- a/apps/desktop/src/i18n.rs +++ b/apps/desktop/src/i18n.rs @@ -131,14 +131,6 @@ const ROWS: &[[&str; 6]] = &[ "Piramidi rosa", ], // --- common / window --- - [ - "Close the application", - "Закрыть программу", - "Fermer l'application", - "Programm schließen", - "Cerrar la aplicación", - "Chiudi l'applicazione", - ], [ "Cancel", "Отмена", diff --git a/apps/desktop/src/library.rs b/apps/desktop/src/library.rs index ff1e79e..69a7fb8 100644 --- a/apps/desktop/src/library.rs +++ b/apps/desktop/src/library.rs @@ -46,7 +46,6 @@ pub enum LibraryAction { AddDatabases, RemoveDatabase(PathBuf), OpenSettings, - Quit, } /// How a database was imported, and what is worth knowing about it. @@ -255,9 +254,6 @@ impl Library { ui.horizontal(|ui| { ui.heading(tr("Databases")); ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { - if crate::widgets::close_button(ui).clicked() { - actions.push(LibraryAction::Quit); - } if ui.button(tr("⚙ Settings")).clicked() { actions.push(LibraryAction::OpenSettings); } diff --git a/apps/desktop/src/widgets.rs b/apps/desktop/src/widgets.rs index c8bad5b..23a45fe 100644 --- a/apps/desktop/src/widgets.rs +++ b/apps/desktop/src/widgets.rs @@ -1,13 +1,7 @@ //! Small shared widgets. -use crate::i18n::tr; use egui::{Color32, Sense, Stroke, Ui, vec2}; -/// Window close button (the app runs undecorated under tiling compositors). -pub fn close_button(ui: &mut Ui) -> egui::Response { - x_button(ui, vec2(32.0, 28.0), 6.0).on_hover_text(tr("Close the application")) -} - /// Compact ✕ (e.g. to cancel a running task); the caller adds the tooltip. pub fn small_close_button(ui: &mut Ui) -> egui::Response { x_button(ui, vec2(22.0, 20.0), 4.5)