Move the game analysis / report button to the toolbar
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:
vrubel 2026-10-18 11:15:30 +03:00
parent 808382966f
commit 6cf639bb24
3 changed files with 34 additions and 46 deletions

View file

@ -257,9 +257,16 @@ impl GameView {
}
}
/// Header button: start, progress with cancel, or show/hide the report.
/// Toolbar button: start, progress with cancel, or show/hide the report.
fn review_button(&mut self, ui: &mut Ui, actions: &mut Vec<GameAction>) {
let big = |s: &str| RichText::new(s).size(18.0);
if let Some((done, total)) = self.review.progress() {
ui.add(
egui::ProgressBar::new(done as f32 / total.max(1) as f32)
.desired_width(70.0)
.text(format!("{done}/{total}")),
)
.on_hover_text(tr("Game analysis"));
if crate::widgets::small_close_button(ui)
.on_hover_text(tr("Stop the game analysis"))
.clicked()
@ -267,21 +274,15 @@ impl GameView {
self.review.cancel();
actions.push(GameAction::ResumeLive);
}
ui.add(
egui::ProgressBar::new(done as f32 / total.max(1) as f32)
.desired_width(90.0)
.text(format!("{done}/{total}")),
);
ui.label(tr("Game analysis"));
} else if self.review.has_data() {
ui.toggle_value(&mut self.review.visible, tr("📈 Report"))
ui.toggle_value(&mut self.review.visible, big("📈"))
.on_hover_text(tr(
"Show or hide the evaluation graph and the report (Shift+A)",
"Report: show or hide the evaluation graph and the report (Shift+A)",
));
} else if ui
.button(tr("📈 Analyse game"))
.button(big("📈"))
.on_hover_text(tr(
"Evaluate every move: accuracy, inaccuracies, mistakes, blunders (Shift+A)",
"Analyse game: accuracy, inaccuracies, mistakes, blunders (Shift+A)",
))
.clicked()
{
@ -340,7 +341,6 @@ impl GameView {
{
actions.push(GameAction::OpenSettings);
}
self.review_button(ui, actions);
let warnings = self
.diagnostics
.iter()
@ -864,7 +864,9 @@ impl GameView {
fn toolbar(&mut self, ui: &mut Ui, actions: &mut Vec<GameAction>) {
ui.add_space(4.0);
ui.horizontal(|ui| {
// Wraps onto a second row when the side panel is narrow.
ui.horizontal_wrapped(|ui| {
ui.spacing_mut().item_spacing.x = 5.0;
let big = |s: &str| RichText::new(s).size(18.0);
if ui
.button(big("⏮"))
@ -941,6 +943,8 @@ impl GameView {
{
actions.push(GameAction::CopyText(self.game.to_pgn(), tr("PGN copied")));
}
ui.separator();
self.review_button(ui, actions);
});
ui.add_space(4.0);
}

View file

@ -1040,6 +1040,22 @@ const ROWS: &[[&str; 6]] = &[
"Materiale insufficiente",
],
// Whole-game analysis
[
"Report: show or hide the evaluation graph and the report (Shift+A)",
"Отчёт: показать или скрыть график оценки и отчёт (Shift+A)",
"Rapport : afficher ou masquer le graphique d'évaluation et le rapport (Maj+A)",
"Bericht: Bewertungsgrafik und Bericht ein- oder ausblenden (Umschalt+A)",
"Informe: mostrar u ocultar el gráfico de evaluación y el informe (Mayús+A)",
"Resoconto: mostra o nascondi il grafico di valutazione e il resoconto (Maiusc+A)",
],
[
"Analyse game: accuracy, inaccuracies, mistakes, blunders (Shift+A)",
"Анализ партии: точность, неточности, ошибки, зевки (Shift+A)",
"Analyser la partie : précision, imprécisions, erreurs, gaffes (Maj+A)",
"Partie analysieren: Genauigkeit, Ungenauigkeiten, Fehler, grobe Fehler (Umschalt+A)",
"Analizar la partida: precisión, imprecisiones, errores, errores graves (Mayús+A)",
"Analizza la partita: precisione, imprecisioni, errori, svarioni (Maiusc+A)",
],
[
"Every position is already evaluated",
"Все позиции уже оценены",
@ -1064,38 +1080,6 @@ const ROWS: &[[&str; 6]] = &[
"Análisis de la partida",
"Analisi della partita",
],
[
"📈 Report",
"📈 Отчёт",
"📈 Rapport",
"📈 Bericht",
"📈 Informe",
"📈 Resoconto",
],
[
"Show or hide the evaluation graph and the report (Shift+A)",
"Показать или скрыть график оценки и отчёт (Shift+A)",
"Afficher ou masquer le graphique d'évaluation et le rapport (Maj+A)",
"Bewertungsgrafik und Bericht ein- oder ausblenden (Umschalt+A)",
"Mostrar u ocultar el gráfico de evaluación y el informe (Mayús+A)",
"Mostra o nascondi il grafico di valutazione e il resoconto (Maiusc+A)",
],
[
"📈 Analyse game",
"📈 Анализ партии",
"📈 Analyser la partie",
"📈 Partie analysieren",
"📈 Analizar partida",
"📈 Analizza partita",
],
[
"Evaluate every move: accuracy, inaccuracies, mistakes, blunders (Shift+A)",
"Оценить каждый ход: точность, неточности, ошибки, зевки (Shift+A)",
"Évaluer chaque coup : précision, imprécisions, erreurs, gaffes (Maj+A)",
"Jeden Zug bewerten: Genauigkeit, Ungenauigkeiten, Fehler, grobe Fehler (Umschalt+A)",
"Evaluar cada jugada: precisión, imprecisiones, errores, errores graves (Mayús+A)",
"Valuta ogni mossa: precisione, imprecisioni, errori, svarioni (Maiusc+A)",
],
[
"Notation",
"Нотация",