Remove the in-app close button; the window manager provides window controls
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-18 23:04:13 +03:00
parent 80672b343d
commit ff1a939ef3
6 changed files with 4 additions and 24 deletions

View file

@ -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),
}
}
}

View file

@ -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+,")

View file

@ -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",
"Отмена",

View file

@ -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);
}

View file

@ -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)