2023-04-26 18:22:27 +05:30
|
|
|
using Gtk 4.0;
|
|
|
|
using Adw 1;
|
|
|
|
|
|
|
|
template BavarderWindow : Adw.ApplicationWindow {
|
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
title: _("Bavarder");
|
2023-04-27 05:41:40 +05:30
|
|
|
default-width: 350;
|
|
|
|
default-height: 500;
|
2023-04-27 04:02:45 +05:30
|
|
|
|
2023-04-26 18:22:27 +05:30
|
|
|
ShortcutController {
|
|
|
|
Shortcut {
|
|
|
|
trigger: "<primary>q";
|
|
|
|
action: "action(window.close)";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Adw.ToastOverlay toast_overlay {
|
2023-04-27 04:02:45 +05:30
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
|
|
|
vexpand: true;
|
|
|
|
hexpand: true;
|
|
|
|
Adw.HeaderBar {
|
|
|
|
MenuButton {
|
|
|
|
primary: true;
|
|
|
|
menu-model: main-menu;
|
|
|
|
icon-name: "open-menu-symbolic";
|
|
|
|
tooltip-text: _("Main Menu");
|
|
|
|
}
|
2023-04-30 20:01:54 +05:30
|
|
|
DropDown provider_selector {
|
|
|
|
styles ["flat"]
|
|
|
|
}
|
2023-04-27 05:41:40 +05:30
|
|
|
styles ["flat"]
|
2023-04-27 04:02:45 +05:30
|
|
|
}
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 17:54:21 +05:30
|
|
|
Adw.Banner banner {
|
2023-04-27 22:48:42 +05:30
|
|
|
title: _("No network connection");
|
2023-04-27 17:54:21 +05:30
|
|
|
revealed: false;
|
|
|
|
}
|
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
Box main {
|
2023-04-26 18:22:27 +05:30
|
|
|
orientation: vertical;
|
2023-04-27 04:02:45 +05:30
|
|
|
vexpand: true;
|
|
|
|
hexpand: true;
|
|
|
|
margin-top: 0;
|
|
|
|
margin-bottom: 24;
|
|
|
|
margin-start: 24;
|
|
|
|
margin-end: 24;
|
|
|
|
spacing: 12;
|
|
|
|
|
|
|
|
Adw.PreferencesGroup prompt_group {
|
2023-04-27 05:41:40 +05:30
|
|
|
title: _("Message");
|
2023-04-27 04:02:45 +05:30
|
|
|
|
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
|
|
|
hexpand: true;
|
|
|
|
vexpand: true;
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
styles ["card", "text-box"]
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
ScrolledWindow {
|
|
|
|
margin-top:12;
|
|
|
|
margin-bottom:0;
|
|
|
|
margin-start:12;
|
|
|
|
margin-end:12;
|
2023-04-27 05:41:40 +05:30
|
|
|
styles ["scrolled-window"]
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
TextView prompt_text_view {
|
2023-04-27 05:41:40 +05:30
|
|
|
wrap-mode: word_char;
|
2023-04-27 04:02:45 +05:30
|
|
|
hexpand: true;
|
|
|
|
vexpand: true;
|
|
|
|
buffer: TextBuffer { };
|
2023-04-27 17:17:31 +05:30
|
|
|
//key-press => on_key_press_event();
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
Box {
|
|
|
|
hexpand: true;
|
|
|
|
halign: end;
|
|
|
|
|
|
|
|
styles ["toolbar"]
|
|
|
|
Button {
|
|
|
|
sensitive: false;
|
2023-04-27 05:41:40 +05:30
|
|
|
icon-name: "edit-copy-symbolic";
|
|
|
|
tooltip-text: _("Copy to Clipboard");
|
|
|
|
action-name: "app.copy_prompt";
|
2023-04-27 04:02:45 +05:30
|
|
|
}
|
2023-05-04 17:31:05 +05:30
|
|
|
// 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;
|
|
|
|
// }
|
|
|
|
// }
|
2023-04-27 17:17:31 +05:30
|
|
|
Button ask_button {
|
|
|
|
visible: true;
|
2023-04-27 04:02:45 +05:30
|
|
|
sensitive: false;
|
2023-04-27 05:41:40 +05:30
|
|
|
icon-name: "paper-plane-symbolic";
|
|
|
|
tooltip-text: _("Ask");
|
2023-04-27 04:02:45 +05:30
|
|
|
hexpand: true;
|
|
|
|
halign: end;
|
2023-04-27 05:41:40 +05:30
|
|
|
action-name: "app.ask";
|
|
|
|
styles ["suggested-action", "circular"]
|
2023-04-27 04:02:45 +05:30
|
|
|
}
|
2023-04-27 17:54:21 +05:30
|
|
|
Button wait_button {
|
2023-04-27 17:17:31 +05:30
|
|
|
visible: false;
|
2023-04-27 17:54:21 +05:30
|
|
|
sensitive: false;
|
|
|
|
tooltip-text: _("Wait");
|
|
|
|
styles ["suggested-action", "circular"]
|
|
|
|
Spinner spinner {
|
2023-04-27 23:13:14 +05:30
|
|
|
margin-top: 8;
|
|
|
|
margin-bottom: 8;
|
|
|
|
margin-start: 8;
|
|
|
|
margin-end: 8;
|
2023-04-27 17:54:21 +05:30
|
|
|
styles ["suggested-action", "circular"]
|
|
|
|
}
|
2023-04-27 17:17:31 +05:30
|
|
|
}
|
2023-04-27 04:02:45 +05:30
|
|
|
}
|
|
|
|
}
|
2023-04-26 18:22:27 +05:30
|
|
|
}
|
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
Adw.PreferencesGroup bot_group {
|
2023-04-27 05:41:40 +05:30
|
|
|
title: _("Response");
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 17:17:31 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
2023-04-26 18:22:27 +05:30
|
|
|
hexpand: true;
|
2023-04-27 04:02:45 +05:30
|
|
|
vexpand: true;
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
styles ["card", "text-box"]
|
2023-04-26 18:22:27 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
ScrolledWindow {
|
|
|
|
margin-top:12;
|
|
|
|
margin-bottom:0;
|
|
|
|
margin-start:12;
|
|
|
|
margin-end:12;
|
2023-04-27 05:41:40 +05:30
|
|
|
styles ["scrolled-window"]
|
2023-04-27 17:17:31 +05:30
|
|
|
|
2023-04-27 17:54:21 +05:30
|
|
|
Gtk.Stack response_stack {
|
|
|
|
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");
|
|
|
|
// };
|
|
|
|
// }
|
2023-04-27 04:02:45 +05:30
|
|
|
}
|
2023-04-27 17:54:21 +05:30
|
|
|
|
2023-04-26 18:22:27 +05:30
|
|
|
}
|
2023-04-27 17:54:21 +05:30
|
|
|
|
2023-04-27 04:02:45 +05:30
|
|
|
Box {
|
|
|
|
hexpand: true;
|
|
|
|
halign: end;
|
|
|
|
|
|
|
|
styles ["toolbar"]
|
|
|
|
|
2023-05-04 17:31:05 +05:30
|
|
|
// 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;
|
|
|
|
// }
|
|
|
|
// }
|
2023-04-29 14:46:50 +05:30
|
|
|
|
|
|
|
Button copy_bot {
|
2023-04-27 04:02:45 +05:30
|
|
|
sensitive: false;
|
|
|
|
icon-name: "edit-copy-symbolic";
|
|
|
|
tooltip-text: _("Copy to Clipboard");
|
|
|
|
hexpand: true;
|
|
|
|
halign: end;
|
|
|
|
action-name: "app.copy_bot";
|
|
|
|
}
|
2023-04-26 18:22:27 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
menu main-menu {
|
|
|
|
section {
|
|
|
|
item {
|
|
|
|
label: _("Preferences");
|
|
|
|
action: "app.preferences";
|
|
|
|
}
|
|
|
|
|
2023-04-27 18:26:28 +05:30
|
|
|
item {
|
|
|
|
label: _("Keyboard Shortcuts");
|
|
|
|
action: "win.show-help-overlay";
|
|
|
|
}
|
|
|
|
|
2023-04-26 18:22:27 +05:30
|
|
|
item {
|
|
|
|
label: _("About Bavarder");
|
|
|
|
action: "app.about";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|