Bavarder/data/ui/window.blp

245 lines
6.3 KiB
Plaintext
Raw Normal View History

2023-04-26 18:22:27 +05:30
using Gtk 4.0;
using Adw 1;
using WebKit 6.0;
2023-04-26 18:22:27 +05:30
2023-05-17 01:44:50 +05:30
template $BavarderWindow : Adw.ApplicationWindow {
2023-04-26 18:22:27 +05:30
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 menu {
2023-04-27 04:02:45 +05:30
primary: true;
menu-model: main-menu;
icon-name: "open-menu-symbolic";
tooltip-text: _("Main Menu");
}
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 {
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-start: 24;
margin-end: 24;
spacing: 12;
2023-05-28 06:48:54 +05:30
Adw.Bin {
vexpand: true;
hexpand: true;
2023-04-27 04:02:45 +05:30
Box {
orientation: vertical;
2023-04-26 18:22:27 +05:30
2023-05-28 06:48:54 +05:30
Stack stack {
transition-type: crossfade;
2023-04-26 18:22:27 +05:30
2023-05-28 06:48:54 +05:30
Gtk.StackPage {
name: "page_content";
child: Overlay overlay {
2023-04-26 18:22:27 +05:30
2023-05-28 06:48:54 +05:30
Adw.PreferencesGroup bot_group {
title: _("Response");
2023-04-26 18:22:27 +05:30
2023-05-28 06:48:54 +05:30
Box {
orientation: vertical;
hexpand: true;
vexpand: true;
2023-05-28 13:26:30 +05:30
styles [ "text-box"]
2023-05-28 06:48:54 +05:30
ScrolledWindow scrolled_response_window {
margin-top: 12;
margin-bottom: 0;
margin-start: 12;
margin-end: 12;
2023-05-28 13:26:30 +05:30
TextView bot_text_view {
wrap-mode: word_char;
2023-05-28 06:48:54 +05:30
hexpand: true;
2023-05-28 13:26:30 +05:30
vexpand: true;
editable: false;
2023-05-28 06:48:54 +05:30
}
}
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"]
}
}
}
}
};
2023-04-27 04:02:45 +05:30
}
2023-05-28 06:48:54 +05:30
Gtk.StackPage {
name: "page_loading";
child: Spinner {
valign: center;
halign: center;
vexpand: true;
};
2023-04-27 17:17:31 +05:30
}
2023-05-28 06:48:54 +05:30
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"]
}
};
}
2023-04-27 04:02:45 +05:30
}
2023-04-26 18:22:27 +05:30
2023-05-28 06:48:54 +05:30
Separator {}
2023-04-26 18:22:27 +05:30
2023-05-28 06:48:54 +05:30
Adw.Clamp {
vexpand: false;
hexpand: true;
maximum-size: 750;
tightening-threshold: 550;
2023-04-27 17:17:31 +05:30
2023-05-28 06:48:54 +05:30
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 {
2023-04-27 17:54:21 +05:30
hexpand: true;
2023-05-28 06:48:54 +05:30
accepts-tab: false;
top-margin: 7;
bottom-margin: 7;
wrap-mode: word;
buffer: TextBuffer { };
}
2023-04-27 17:54:21 +05:30
}
2023-05-28 06:48:54 +05:30
Button ask_button {
valign: end;
2023-04-27 17:54:21 +05:30
2023-05-28 06:48:54 +05:30
icon-name: "paper-plane-symbolic";
tooltip-text: _("Ask");
halign: end;
action-name: "app.ask";
styles ["suggested-action", "circular"]
}
2023-05-11 03:59:16 +05:30
}
2023-04-26 18:22:27 +05:30
}
}
2023-05-28 06:48:54 +05:30
}
2023-04-26 18:22:27 +05:30
}
}
}
}
menu main-menu {
2023-05-13 18:16:03 +05:30
section {
item {
label: _("New window");
action: "app.new";
}
}
2023-04-26 18:22:27 +05:30
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-05-13 18:16:03 +05:30
2023-04-26 18:22:27 +05:30
item {
label: _("About Bavarder");
action: "app.about";
}
}
}