// SPDX-FileCopyrightText: 2022 Bruce Cowan <bruce@bcowan.me.uk> // // SPDX-License-Identifier: GPL-3.0-or-later using Gtk 4.0; using Adw 1; template RugbyAppWindow : Adw.ApplicationWindow { title: "Rugby"; default-height: 600; default-width: 400; Box { orientation: vertical; Adw.HeaderBar { SpinButton scorespin { adjustment: Adjustment { step-increment: 1; upper: 200; }; focusable: true; tooltip-text: "Score"; } ToggleButton filter_toggle { icon-name: "funnel"; tooltip-text: "Show Try Filter"; toggled => filter_toggle_toggled_cb(); } [end] MenuButton { direction: none; primary: true; menu-model: app_menu; tooltip-text: "Main Menu"; } } Adw.Clamp { maximum-size: 600; Box { orientation: vertical; Revealer { halign: center; margin-top: 6; reveal-child: bind filter_toggle.active; transition-type: swing_down; SpinButton tryspin { adjustment: Adjustment { step-increment: 1; lower: 0; upper: 40; }; focusable: true; tooltip-text: "Tries"; value-changed => try_spin_value_changed_cb(); } } Stack stack { StackPage { child: Adw.StatusPage empty_page { title: "No possibilities"; }; } StackPage { child: ScrolledWindow list_page { vexpand: true; ListView listview { styles ["rich-list"] factory: BuilderListItemFactory { resource: "/uk/me/bcowan/Rugby/gtk/score-item.ui"; }; model: NoSelection { model: FilterListModel { filter: CustomFilter try_filter {}; model: .RugbyListStore list_store { score: bind scorespin.value; }; items-changed => list_store_items_changed_cb(); }; }; } }; } } } } } } menu app_menu { section { item ("_Preferences", "app.prefs") item ("_Keyboard Shortcuts", "win.show-help-overlay") item ("_About Rugby", "app.about") } }