157 lines
3.7 KiB
Plaintext
157 lines
3.7 KiB
Plaintext
using Gtk 4.0;
|
|
using Adw 1;
|
|
|
|
menu primary_menu {
|
|
section {
|
|
item {
|
|
label: _("_Preferences");
|
|
action: "app.preferences";
|
|
}
|
|
|
|
item {
|
|
label: _("_Keyboard Shortcuts");
|
|
action: "win.show-help-overlay";
|
|
}
|
|
|
|
item {
|
|
label: _("_About Notify");
|
|
action: "app.about";
|
|
}
|
|
}
|
|
}
|
|
|
|
menu subscription_menu {
|
|
section {
|
|
item {
|
|
label: _("_Subscription Info");
|
|
action: "win.show-subscription-info";
|
|
}
|
|
}
|
|
section {
|
|
item {
|
|
label: _("_Clear all notifications");
|
|
action: "win.clear-notifications";
|
|
}
|
|
|
|
item {
|
|
label: _("_Unsubscribe");
|
|
action: "win.unsubscribe";
|
|
}
|
|
}
|
|
}
|
|
|
|
template $NotifyWindow : Adw.ApplicationWindow {
|
|
width-request: 240;
|
|
height-request: 360;
|
|
Adw.Breakpoint {
|
|
condition ("max-width: 640sp")
|
|
setters {
|
|
navigation_split_view.collapsed: true;
|
|
}
|
|
}
|
|
Adw.ToastOverlay toast_overlay {
|
|
Adw.NavigationSplitView navigation_split_view {
|
|
sidebar: Adw.NavigationPage {
|
|
title: "Topics";
|
|
child: Adw.ToolbarView {
|
|
[top]
|
|
Adw.HeaderBar {
|
|
[start]
|
|
Button {
|
|
icon-name: "list-add-symbolic";
|
|
clicked => $show_add_topic() swapped;
|
|
}
|
|
[end]
|
|
MenuButton appmenu_button {
|
|
icon-name: "open-menu-symbolic";
|
|
menu-model: primary_menu;
|
|
primary: true;
|
|
tooltip-text: _("Main Menu");
|
|
}
|
|
}
|
|
|
|
Gtk.Stack stack {
|
|
Adw.StatusPage welcome_view {
|
|
title: "Notify";
|
|
description: "Subscribe to one topic and start listening for notifications";
|
|
child: Gtk.Button {
|
|
label: "Subscribe To Topic";
|
|
clicked => $show_add_topic() swapped;
|
|
halign: center;
|
|
styles [
|
|
"suggested-action",
|
|
"pill"
|
|
]
|
|
};
|
|
}
|
|
ScrolledWindow list_view {
|
|
propagate-natural-height: true;
|
|
ListBox subscription_list {
|
|
styles [
|
|
"navigation-sidebar"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
content: Adw.NavigationPage {
|
|
title: "Notifications";
|
|
Adw.ToolbarView subscription_view {
|
|
[top]
|
|
Adw.HeaderBar headerbar {
|
|
[end]
|
|
MenuButton subscription_menu_btn {
|
|
icon-name: "view-more-symbolic";
|
|
menu-model: subscription_menu;
|
|
tooltip-text: _("Subscription Menu");
|
|
}
|
|
}
|
|
[top]
|
|
Adw.Banner banner {
|
|
title: "Reconnecting...";
|
|
}
|
|
|
|
content: ScrolledWindow message_scroll {
|
|
propagate-natural-height: true;
|
|
vexpand: true;
|
|
Adw.Clamp {
|
|
ListBox message_list {
|
|
selection-mode: none;
|
|
show-separators: true;
|
|
styles [
|
|
"background"
|
|
]
|
|
}
|
|
}
|
|
};
|
|
[bottom]
|
|
Adw.Bin {
|
|
margin-top: 8;
|
|
margin-bottom: 8;
|
|
margin-start: 8;
|
|
margin-end: 8;
|
|
Adw.Clamp {
|
|
Gtk.Box {
|
|
spacing: 8;
|
|
Entry entry {
|
|
placeholder-text: "Message...";
|
|
hexpand: true;
|
|
}
|
|
Gtk.Button send_btn {
|
|
styles [
|
|
"circular",
|
|
"suggested-action"
|
|
]
|
|
icon-name: "paper-plane-symbolic";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|