Library: New game and Paste PGN first in the title row; the chooser's search only for a long list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
863c957947
commit
b1e3b6eab7
3 changed files with 11 additions and 7 deletions
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue