Daudix_UFO
f15696e470
For keyboard users there are shortcut, for mouse users there are close button :)
230 lines
5.8 KiB
Text
230 lines
5.8 KiB
Text
using Gtk 4.0;
|
|
using Adw 1;
|
|
|
|
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 {
|
|
primary: true;
|
|
menu-model: main-menu;
|
|
icon-name: "open-menu-symbolic";
|
|
tooltip-text: _("Main Menu");
|
|
}
|
|
DropDown provider_selector {
|
|
styles ["flat"]
|
|
}
|
|
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 {
|
|
margin-top:12;
|
|
margin-bottom:0;
|
|
margin-start:12;
|
|
margin-end:12;
|
|
styles ["scrolled-window"]
|
|
|
|
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");
|
|
// };
|
|
// }
|
|
}
|
|
|
|
}
|
|
|
|
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";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
menu main-menu {
|
|
section {
|
|
item {
|
|
label: _("Preferences");
|
|
action: "app.preferences";
|
|
}
|
|
|
|
item {
|
|
label: _("Keyboard Shortcuts");
|
|
action: "win.show-help-overlay";
|
|
}
|
|
|
|
item {
|
|
label: _("About Bavarder");
|
|
action: "app.about";
|
|
}
|
|
}
|
|
}
|