Bavarder/data/ui/window.blp
2023-05-16 22:14:50 +02:00

247 lines
6.3 KiB
Text

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: "<primary>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-top: 0;
margin-bottom: 24;
margin-start: 24;
margin-end: 24;
spacing: 12;
Adw.PreferencesGroup prompt_group {
title: _("Message");
Box {
orientation: vertical;
hexpand: true;
vexpand: true;
styles ["card", "text-box"]
ScrolledWindow {
margin-top: 12;
margin-bottom: 0;
margin-start: 12;
margin-end: 12;
styles ["scrolled-window"]
TextView prompt_text_view {
wrap-mode: word_char;
hexpand: true;
vexpand: true;
buffer: TextBuffer { };
//key-press => on_key_press_event();
}
}
Box {
hexpand: true;
halign: end;
styles ["toolbar"]
Button {
sensitive: false;
icon-name: "edit-copy-symbolic";
tooltip-text: _("Copy to Clipboard");
action-name: "app.copy_prompt";
}
// Button listen {
// action-name: "app.listen";
// tooltip-text: _("Listen");
// icon-name: "audio-input-microphone-symbolic";
// }
// Button listen_wait {
// visible: false;
// sensitive: false;
// tooltip-text: _("Listening");
// Spinner listen_spinner {
// margin-top: 8;
// margin-bottom: 8;
// margin-start: 8;
// margin-end: 8;
// }
// }
Button ask_button {
visible: true;
sensitive: false;
icon-name: "paper-plane-symbolic";
tooltip-text: _("Ask");
hexpand: true;
halign: end;
action-name: "app.ask";
styles ["suggested-action", "circular"]
}
Button wait_button {
visible: false;
sensitive: false;
tooltip-text: _("Wait");
styles ["suggested-action", "circular"]
Spinner spinner {
margin-top: 8;
margin-bottom: 8;
margin-start: 8;
margin-end: 8;
styles ["suggested-action", "circular"]
}
}
}
}
}
Adw.PreferencesGroup bot_group {
title: _("Response");
Box {
orientation: vertical;
hexpand: true;
vexpand: true;
styles ["card", "text-box"]
ScrolledWindow scrolled_response_window {
margin-top: 12;
margin-bottom: 0;
margin-start: 12;
margin-end: 12;
styles ["scrolled-window"]
Gtk.Stack response_stack {
vexpand: true;
hexpand: true;
Gtk.StackPage {
name: "page_response";
child: TextView bot_text_view {
wrap-mode: word_char;
hexpand: true;
vexpand: true;
editable: false;
};
}
// Gtk.StackPage {
// name: "page_offline";
// child: Adw.StatusPage {
// //icon-name: "network-wireless-offline-symbolic";
// title: _("Offline");
// };
// }
}
}
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"]
}
}
}
}
}
}
}
}
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";
}
}
}