Files
cartridges/cartridges/ui/collection-details.blp
2025-12-27 17:00:43 +01:00

80 lines
1.7 KiB
Plaintext

using Gtk 4.0;
using Adw 1;
template $CollectionDetails: Adw.Dialog {
title: bind $_or(template.collection as <$Collection>.name, _("New Collection")) as <string>;
content-width: 360;
default-widget: apply_button;
focus-widget: name_entry;
ShortcutController {
Shortcut {
trigger: "Delete|KP_Delete";
action: "action(collection.remove)";
}
}
child: Adw.ToolbarView {
[top]
Adw.HeaderBar {
show-start-title-buttons: false;
show-end-title-buttons: false;
[start]
Button {
action-name: "window.close";
icon-name: "cancel-symbolic";
tooltip-text: _("Cancel");
}
[end]
Button apply_button {
action-name: "details.apply";
icon-name: "apply-symbolic";
tooltip-text: bind $_if_else(template.collection as <$Collection>.in-model, _("Apply"), _("Add")) as <string>;
styles [
"suggested-action",
]
}
}
content: Adw.PreferencesPage {
Adw.PreferencesGroup {
Adw.EntryRow name_entry {
title: _("Name");
text: bind template.collection as <$Collection>.name;
activates-default: true;
}
}
Adw.PreferencesGroup {
FlowBox icons_box {
min-children-per-line: 7;
styles [
"navigation-sidebar",
]
}
styles [
"card",
]
}
Adw.PreferencesGroup {
visible: bind remove_row.sensitive;
Adw.ButtonRow remove_row {
title: _("Remove");
action-name: "collection.remove";
styles [
"destructive-action",
]
}
}
};
};
}