Library: New game and Paste PGN first in the title row; the chooser's search only for a long list
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-25 01:59:34 +03:00
parent 863c957947
commit b1e3b6eab7
3 changed files with 11 additions and 7 deletions

View file

@ -664,9 +664,9 @@ impl Library {
if let Some(p) = pick {
self.select_db(&p, ui.ctx());
}
self.shelf_actions(ui, true, actions);
ui.add_space(GROUP_GAP - ui.spacing().item_spacing.x);
self.game_buttons(ui, icons, actions);
ui.add_space(GROUP_GAP - ui.spacing().item_spacing.x);
self.shelf_actions(ui, true, actions);
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
self.app_buttons(ui, icons, actions);
});
@ -691,7 +691,7 @@ impl Library {
}
}
/// "♟ New game · 📋 Paste PGN" after the database actions: what to put in, together.
/// "♟ New game · 📋 Paste PGN" before the database actions: what to put in, together.
fn game_buttons(&self, ui: &mut Ui, icons: bool, actions: &mut Vec<LibraryAction>) {
let label = |full: &'static str, icon: &'static str| if icons { icon } else { full };
let hint = |full: &str, hint: &str| shelf_hint(icons, full, hint);
@ -720,7 +720,8 @@ impl Library {
fn shelf(&mut self, ui: &mut Ui, databases: &[PathBuf], actions: &mut Vec<LibraryAction>) {
ui.add_space(8.0);
// The title row (library-layout.md §1.4): «Databases», then what to put in — the
// database actions and, apart, the game ones; the program's on the right.
// game ones first (used daily), then, apart, the database actions; the program's
// on the right.
// Narrowing: the database actions fold to «+ ▾ 🌐» first (databases are added
// seldom), then the other buttons show icons, then the title goes.
let avail = ui.available_width();
@ -744,9 +745,9 @@ impl Library {
ui.heading(tr("Databases"));
ui.add_space(16.0 - ui.spacing().item_spacing.x);
}
self.shelf_actions(ui, folded, actions);
ui.add_space(GROUP_GAP - ui.spacing().item_spacing.x);
self.game_buttons(ui, icons, actions);
ui.add_space(GROUP_GAP - ui.spacing().item_spacing.x);
self.shelf_actions(ui, folded, actions);
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
self.app_buttons(ui, icons, actions);
});

View file

@ -315,7 +315,9 @@ impl Chooser {
ui.label(RichText::new(&self.title).weak());
}
ui.add_space(6.0);
let many = self.rows.len() > 8;
// The field that narrows the list, for a long list only (of the databases
// offered, not of the whole shelf).
let many = self.rows.iter().filter(|r| r.block.is_none()).count() > 8;
if many {
let edit = ui.add(
egui::TextEdit::singleline(&mut self.search)

View file

@ -392,3 +392,4 @@
- 2026-10-25: первая версия.
- 2026-10-25: по решению владельца «♟ Новая партия» и «📋 Вставить PGN» стоят слева, после действий с базами (через промежуток 16): слева всё, чем наполняют библиотеку; справа — только программа: «⚙ Настройки» и кнопка обновления. В пустой базе «+ Партия» одна — главная кнопка посередине (в шапке её нет). В «Новой базе» «Изменить папку…» — отдельной строкой под «Файл:».
- 2026-10-25: по решению владельца порядок слева: «♟ Новая партия», «📋 Вставить PGN», промежуток, затем действия с базами. Поле «Найти базу» в «Добавить в базу» — только когда предлагаемых баз больше восьми.