Add visual format cards, per-image remove, shortcuts dialog, wire threads
Convert step: replace ComboRow with visual format card grid showing icon, name, and description for each format. Much more beginner-friendly. Images step: add per-image remove button on each file row so users can exclude individual images from the batch. Shortcuts: use adw::Dialog with structured layout since GtkShortcutsWindow is deprecated in GTK 4.18+. Add file management and undo shortcuts. Settings: wire thread count selection to actually save/restore the ThreadCount config value instead of always defaulting to Auto.
This commit is contained in:
@@ -1762,31 +1762,49 @@ fn walk_widgets(widget: &Option<gtk::Widget>, f: &dyn Fn(>k::Widget)) {
|
||||
|
||||
|
||||
fn show_shortcuts_window(window: &adw::ApplicationWindow) {
|
||||
let dialog = adw::AlertDialog::builder()
|
||||
.heading("Keyboard Shortcuts")
|
||||
let dialog = adw::Dialog::builder()
|
||||
.title("Keyboard Shortcuts")
|
||||
.content_width(400)
|
||||
.content_height(500)
|
||||
.build();
|
||||
|
||||
let toolbar_view = adw::ToolbarView::new();
|
||||
let header = adw::HeaderBar::new();
|
||||
toolbar_view.add_top_bar(&header);
|
||||
|
||||
let scrolled = gtk::ScrolledWindow::builder()
|
||||
.hscrollbar_policy(gtk::PolicyType::Never)
|
||||
.vexpand(true)
|
||||
.build();
|
||||
|
||||
let content = gtk::Box::builder()
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.spacing(12)
|
||||
.spacing(0)
|
||||
.margin_start(12)
|
||||
.margin_end(12)
|
||||
.margin_top(12)
|
||||
.margin_bottom(12)
|
||||
.build();
|
||||
|
||||
let sections: &[(&str, &[(&str, &str)])] = &[
|
||||
("Wizard Navigation", &[
|
||||
("Alt+Right", "Next step"),
|
||||
("Alt+Left", "Previous step"),
|
||||
("Alt+1..9", "Jump to step"),
|
||||
("Ctrl+Enter", "Process images"),
|
||||
("Alt + Right", "Next step"),
|
||||
("Alt + Left", "Previous step"),
|
||||
("Alt + 1...9", "Jump to step by number"),
|
||||
("Ctrl + Enter", "Process images"),
|
||||
("Escape", "Cancel or go back"),
|
||||
]),
|
||||
("File Management", &[
|
||||
("Ctrl+O", "Add files"),
|
||||
("Ctrl + O", "Add files"),
|
||||
("Ctrl + A", "Select all images"),
|
||||
("Ctrl + Shift + A", "Deselect all images"),
|
||||
("Delete", "Remove selected images"),
|
||||
]),
|
||||
("Application", &[
|
||||
("Ctrl+,", "Settings"),
|
||||
("Ctrl+? / F1", "Keyboard shortcuts"),
|
||||
("Ctrl+Q", "Quit"),
|
||||
("Ctrl + ,", "Settings"),
|
||||
("F1", "Keyboard shortcuts"),
|
||||
("Ctrl + Z", "Undo last batch"),
|
||||
("Ctrl + Q", "Quit"),
|
||||
]),
|
||||
];
|
||||
|
||||
@@ -1802,6 +1820,7 @@ fn show_shortcuts_window(window: &adw::ApplicationWindow) {
|
||||
let label = gtk::Label::builder()
|
||||
.label(*accel)
|
||||
.css_classes(["monospace", "dim-label"])
|
||||
.valign(gtk::Align::Center)
|
||||
.build();
|
||||
row.add_suffix(&label);
|
||||
group.add(&row);
|
||||
@@ -1810,9 +1829,9 @@ fn show_shortcuts_window(window: &adw::ApplicationWindow) {
|
||||
content.append(&group);
|
||||
}
|
||||
|
||||
dialog.set_extra_child(Some(&content));
|
||||
dialog.add_response("close", "Close");
|
||||
dialog.set_default_response(Some("close"));
|
||||
scrolled.set_child(Some(&content));
|
||||
toolbar_view.set_content(Some(&scrolled));
|
||||
dialog.set_child(Some(&toolbar_view));
|
||||
dialog.present(Some(window));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user