using Gtk 4.0; using Adw 1; using WebKit 6.0; template $BavarderWindow : Adw.ApplicationWindow { title: _("Bavarder"); default-width: 350; default-height: 500; ShortcutController { Shortcut { trigger: "q"; action: "action(window.close)"; } } Adw.ToastOverlay toast_overlay { Box { orientation: vertical; vexpand: true; hexpand: true; Adw.HeaderBar { MenuButton menu { primary: true; menu-model: main-menu; icon-name: "open-menu-symbolic"; tooltip-text: _("Main Menu"); } styles ["flat"] } Adw.Banner banner { title: _("No network connection"); revealed: false; } Box main { orientation: vertical; vexpand: true; hexpand: true; margin-start: 24; margin-end: 24; spacing: 12; Adw.Bin { vexpand: true; hexpand: true; Box { orientation: vertical; Stack stack { transition-type: crossfade; Gtk.StackPage { name: "page_content"; child: Overlay overlay { Adw.PreferencesGroup bot_group { title: _("Response"); Box { orientation: vertical; hexpand: true; vexpand: true; styles [ "text-box"] ScrolledWindow scrolled_response_window { margin-top: 12; margin-bottom: 0; margin-start: 12; margin-end: 12; TextView bot_text_view { wrap-mode: word_char; hexpand: true; vexpand: true; editable: false; } } Box { hexpand: true; halign: end; styles ["toolbar"] // Button speak { // action-name: "app.speak"; // tooltip-text: _("Speak"); // icon-name: "audio-speakers-symbolic"; // } // Button speak_wait { // visible: false; // sensitive: false; // tooltip-text: _("Speaking"); // Spinner speak_spinner { // margin-top: 8; // margin-bottom: 8; // margin-start: 8; // margin-end: 8; // } // } Button copy_bot { sensitive: false; icon-name: "edit-copy-symbolic"; tooltip-text: _("Copy to Clipboard"); hexpand: true; halign: end; action-name: "app.copy_bot"; } Button stop_button { visible: false; sensitive: false; icon-name: "x-circular-symbolic"; tooltip-text: _("Stop"); hexpand: true; halign: end; action-name: "app.stop"; styles ["suggested-action", "circular"] } } } } }; } Gtk.StackPage { name: "page_loading"; child: Spinner { valign: center; halign: center; vexpand: true; }; } Gtk.StackPage { name: "page_error"; child: Adw.StatusPage error { visible: true; vexpand: true; icon-name: "dialog-error-symbolic"; title: _("ERROR"); description: _("DESCRIPTION"); Button { label: _("Try Again"); halign: center; styles ["pill"] } }; } } Separator {} Adw.Clamp { vexpand: false; hexpand: true; maximum-size: 750; tightening-threshold: 550; Box { styles [ "toolbar" ] Button { valign: end; icon-name: "mail-attachment-symbolic"; } ScrolledWindow { vexpand: true; hexpand: true; vscrollbar-policy: external; max-content-height: 200; propagate-natural-height: true; styles ["scrolled-window"] TextView prompt_text_view { hexpand: true; accepts-tab: false; top-margin: 7; bottom-margin: 7; wrap-mode: word; buffer: TextBuffer { }; } } Button ask_button { valign: end; icon-name: "paper-plane-symbolic"; tooltip-text: _("Ask"); halign: end; action-name: "app.ask"; styles ["suggested-action", "circular"] } } } } } } } } } menu main-menu { section { item { label: _("New window"); action: "app.new"; } } section { item { label: _("Preferences"); action: "app.preferences"; } item { label: _("Keyboard Shortcuts"); action: "win.show-help-overlay"; } item { label: _("About Bavarder"); action: "app.about"; } } }