export { WebhookWindow, WebhookRow } from "webhooks.slint"; export { ScreenShareWindow, ScreenViewerWindow } from "screen-share.slint"; export { UnlockWindow } from "unlock.slint"; export { Theme } from "theme.slint"; export { UpdateUi } from "settings/updates.slint"; export { EmojiCatalog, EmojiItem } from "emoji-picker.slint"; import { Theme, ActionButton } from "theme.slint"; import { Sidebar, ChannelItem, GuildItem, DmItem } from "sidebar.slint"; import { ChatPanel, MessageItem, MemberItem } from "chat.slint"; import { ForumPanel, ForumTopicItem } from "forum.slint"; import { FriendsPanel, FriendItem } from "friends.slint"; import { VoicePanel, VoiceMemberItem } from "voice.slint"; import { BookmarkItem, ConnectScreen } from "connect.slint"; import { SettingsWindow } from "settings.slint"; import { AvatarCropper } from "avatar-cropper.slint"; import { AccountAuth } from "account-auth.slint"; import { ChannelAdminDialog } from "channel-admin.slint"; import { ServerSettingsDialog } from "server-settings.slint"; import { ManagementMenu, ManagementAction } from "management-menu.slint"; export component MainWindow inherits Window { in-out property show-forum; in-out property forum-channel-name; in-out property <[ForumTopicItem]> forum-topics; in-out property <[MessageItem]> forum-replies; in-out property forum-topic-title; in-out property forum-topic-open; in-out property forum-creating; in-out property forum-loading; in-out property forum-busy; in-out property forum-supported; in-out property forum-more-topics; in-out property forum-more-replies; in-out property forum-error; in-out property forum-title-draft; in-out property forum-body-draft; in-out property forum-reply-draft; callback forum-refresh(); callback forum-create(); callback forum-cancel-create(); callback forum-open-topic(string); callback forum-back(); callback forum-submit-topic(); callback forum-submit-reply(); callback forum-load-more-topics(); callback forum-load-more-replies(); callback forum-title-edited(string); callback forum-body-edited(string); callback forum-reply-edited(string); in-out property account-authenticated; in-out property account-name; in-out property profile-display-name; in-out property profile-saving; in-out property profile-initials; in-out property profile-error; callback save-profile-name(string); in-out property account-status; in-out property account-signing-in; in-out property account-public-key; callback account-sign-in(); callback account-sign-out(); callback account-cancel(); callback account-open-browser(); in-out property management-menu-open; in-out property management-menu-x; in-out property management-menu-y; in-out property <[ManagementAction]> management-actions; callback open-node-menu(float,float); callback open-channel-menu(string,float,float); callback management-menu-chosen(string); callback management-menu-close(); callback toggle-category(string); in-out property node-structure; in-out property node-forums; in-out property <[string]> channel-admin-parent-names; in-out property channel-admin-parent-index; callback channel-admin-parent-selected(int); in-out property server-settings-open; in-out property server-settings-busy; in-out property server-settings-loaded; in-out property server-settings-error; in-out property server-name-draft; in-out property server-description-draft; callback open-server-settings(); callback server-settings-save(); callback server-settings-reload(); callback server-settings-close(); callback server-name-edited(string); callback server-description-edited(string); in-out property node-admin; in-out property channel-admin-open; in-out property channel-admin-operation; in-out property channel-admin-kind; in-out property channel-admin-name; in-out property channel-admin-busy; in-out property channel-admin-error; callback create-global-channel(string); callback rename-global-channel(string); callback delete-global-channel(string); callback channel-admin-name-edited(string); callback channel-admin-submit(); callback channel-admin-cancel(); in-out property <[ChannelItem]> channels; in-out property <[GuildItem]> guilds; in-out property <[DmItem]> dm-conversations; in-out property username; in-out property user-status; in-out property own-initials; in-out property active-channel-id; in-out property active-guild-idx; in-out property show-dms; in-out property own-avatar; in-out property has-avatar; in-out property avatar-crop-open; in-out property avatar-source; in-out property avatar-source-width: 1; in-out property avatar-source-height: 1; in-out property avatar-zoom: 1; in-out property avatar-offset-x; in-out property avatar-offset-y; in-out property avatar-error; in-out property avatar-saving; private property pending-delete-id; in-out property active-dm-id; in-out property voice-connected; in-out property voice-joining; in-out property members-visible: true; in-out property <[string]> input-devices; in-out property <[string]> output-devices; in-out property input-device-index; in-out property output-device-index; in-out property active-channel-name; in-out property <[MessageItem]> messages; in-out property <[MemberItem]> members; in-out property input-text; in-out property is-dm; in-out property e2ee-enabled; in-out property dm-partner-name; in-out property show-chat; in-out property show-friends; in-out property show-voice; in-out property replying-to-message; in-out property replying-to-sender; in-out property replying-to-content; in-out property <[FriendItem]> friends; in-out property <[FriendItem]> pending-requests; in-out property <[string]> blocked-users; in-out property friends-active-tab; in-out property friends-online-count: -1; in-out property add-friend-input; in-out property <[VoiceMemberItem]> voice-members; in-out property mic-enabled; in-out property deafened; in-out property voice-channel-name; in-out property activity-banner; in-out property <[BookmarkItem]> bookmarks: []; in-out property address-input: ""; in-out property status-text: ""; in-out property connecting: false; in-out property auto-reconnect: false; in-out property node-name: ""; // 0 none, 1 first use, 2 certificate fingerprint changed, 3 server identity changed in-out property trust-kind: 0; in-out property trust-address: ""; in-out property trust-received: ""; in-out property trust-expected: ""; in-out property identity-pubkey: ""; in-out property vault-enabled: false; in-out property voice-input-device: ""; in-out property voice-output-device: ""; in-out property noise-suppress; in property noise-suppress-available; in property mic-test-running; in property mic-test-level; in property mic-test-error; callback toggle-microphone-test(); callback noise-suppression-changed(bool); in-out property voice-bitrate: 64.0; in-out property vad-mode: 1; in-out property volume: 100.0; in-out property sounds-enabled: true; in-out property sounds-volume: 60; in-out property sounds-voice-room: true; in-out property sounds-messages: true; in-out property sounds-mentions: true; callback sound-settings-changed(bool, float, bool, bool, bool); callback preview-sound(); in-out property language-choice: "system"; callback language-selected(string); in-out property theme-mode: "black"; in-out property theme-css; in-out property theme-file-path; in-out property text-size: 16; in-out property theme-error; in-out property theme-status; in-out property theme-preview; in-out property active-tab: "audio"; in-out property settings-open; in-out property passphrase-modal-open; in-out property passphrase-input; in-out property passphrase-confirm; in-out property passphrase-error; in-out property export-modal-open; in-out property export-pass-input; in-out property export-pass-confirm; in-out property export-output; in-out property export-error; in-out property import-modal-open; in-out property import-keyfile-input; in-out property import-pass-input; in-out property import-error; callback choose-avatar(); callback remove-avatar(); callback avatar-crop-moved(float, float); callback avatar-zoom-changed(float); callback confirm-avatar(); callback cancel-avatar(); callback theme-selected(string); callback text-size-changed(float); callback preview-theme(string); callback apply-theme(string); callback reset-theme(); callback import-theme(string); callback export-theme(string); callback dismiss-status(); callback ptt-held(bool); callback input-edited(string); callback address-edited(string); callback auto-reconnect-changed(bool); callback friends-tab-changed(string); callback friend-input-edited(string); callback open-settings(); callback open-screen-share(); callback open-webhooks(); callback show-voice-view(); callback show-friends-view(); in-out property local-speaking; callback refresh-audio-devices(); callback device-selected(int, int); callback audio-settings-changed(int, int, float, int, float); callback channel-selected(string); callback guild-selected(int); callback dm-selected(string); callback disconnect(); in-out property pending-image; in-out property has-pending-image; in-out property image-uploading; in-out property image-status; callback paste-image() -> bool; callback cancel-image(); callback send-image(); callback send-message(string, string); callback load-more(string); callback react(string, string); callback reply-to-msg(string); callback edit-msg(string); callback delete-msg(string); callback cancel-reply(); callback add-friend(string); callback accept-friend(string); callback decline-friend(string); callback remove-friend(string); callback start-dm(string); callback toggle-mic(); callback toggle-deafen(); callback leave-voice(); callback connect(string); callback remove-bookmark(string); callback add-bookmark(string); callback trust-accept(); callback trust-forget(); callback trust-dismiss(); callback close-settings(); callback set-passphrase(string, string); callback remove-passphrase(); callback export-keyfile(string, string); callback import-keyfile(string, string); preferred-width: 1280px; preferred-height: 800px; min-width: 920px; min-height: 640px; title: "Vnox"; icon: @image-url("assets/vnox-mark.svg"); background: Theme.bg-base; if !root.account-authenticated : AccountAuth { signing-in: root.account-signing-in; status: root.account-status; public-key: root.account-public-key; sign-in => { root.account-sign-in(); } cancel => { root.account-cancel(); } open-browser => { root.account-open-browser(); } settings => { root.open-settings(); } } if node-name == "" && root.account-authenticated : ConnectScreen { bookmarks: root.bookmarks; address-input <=> root.address-input; status-text: root.status-text; connecting: root.connecting; auto-reconnect <=> root.auto-reconnect; node-name: root.node-name; account-name: root.account-name; sign-out => { root.account-sign-out(); } trust-kind: root.trust-kind; trust-address: root.trust-address; trust-received: root.trust-received; trust-expected: root.trust-expected; trust-accept => { root.trust-accept(); } trust-forget => { root.trust-forget(); } trust-dismiss => { root.trust-dismiss(); } open-settings => { root.open-settings(); } address-edited(text) => { root.address-edited(text); } auto-reconnect-changed(value) => { root.auto-reconnect-changed(value); } connect(address) => { root.connect(address); } disconnect => { root.disconnect(); } remove-bookmark(address) => { root.remove-bookmark(address); } add-bookmark(address) => { root.add-bookmark(address); } } if node-name != "" && root.account-authenticated : HorizontalLayout { sidebar := Sidebar { local-speaking: root.local-speaking; input-devices: root.input-devices; output-devices: root.output-devices; input-device-index: root.input-device-index; output-device-index: root.output-device-index; refresh-devices => { root.refresh-audio-devices(); } device-selected(input, output) => { root.device-selected(input, output); } channels: root.channels; guilds: root.guilds; dm-conversations: root.dm-conversations; node-name: root.node-name; node-admin: root.node-admin; open-node-menu(x,y) => {root.open-node-menu(x,y);} open-channel-menu(id,x,y) => {root.open-channel-menu(id,x,y);} toggle-category(id) => {root.toggle-category(id);} create-global-channel(kind) => { root.create-global-channel(kind); } rename-global-channel(id) => { root.rename-global-channel(id); } delete-global-channel(id) => { root.delete-global-channel(id); } active-dm-id: root.active-dm-id; voice-connected: root.voice-connected; voice-channel-name: root.voice-channel-name; mic-enabled: root.mic-enabled; deafened: root.deafened; open-settings => { root.open-settings(); } toggle-mic => { root.toggle-mic(); } toggle-deafen => { root.toggle-deafen(); } leave-voice => { root.leave-voice(); } show-voice => { root.show-voice-view(); } show-friends => { root.show-friends-view(); } own-avatar: root.own-avatar; has-avatar: root.has-avatar; own-initials: root.own-initials; username: root.username; user-status: root.user-status; active-channel-id: root.active-channel-id; active-guild-idx: root.active-guild-idx; show-dms: root.show-dms; channel-selected(id) => { root.channel-selected(id); } guild-selected(idx) => { root.guild-selected(idx); } dm-selected(id) => { root.dm-selected(id); } disconnect => { root.disconnect(); } } VerticalLayout { spacing: 0; if root.status-text != "" : Rectangle { height: 42px; background: Theme.bg-elevated; HorizontalLayout { padding-left: 16px; padding-right: 10px; spacing: 12px; Text { text: root.status-text; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); wrap: word-wrap; vertical-alignment: center; horizontal-stretch: 1; } VerticalLayout { alignment: center; ActionButton { text: @tr("Dismiss"); icon: "x"; width: 28px; quiet: true; clicked => { root.dismiss-status(); } } } } } if root.show-forum : ForumPanel { channel-name: root.forum-channel-name; topics: root.forum-topics; replies: root.forum-replies; topic-title: root.forum-topic-title; topic-open: root.forum-topic-open; creating: root.forum-creating; loading: root.forum-loading; busy: root.forum-busy; supported: root.forum-supported; more-topics: root.forum-more-topics; more-replies: root.forum-more-replies; error: root.forum-error; title-draft <=> root.forum-title-draft; body-draft <=> root.forum-body-draft; reply-draft <=> root.forum-reply-draft; refresh => { root.forum-refresh(); } create => { root.forum-create(); } cancel-create => { root.forum-cancel-create(); } open-topic(id) => { root.forum-open-topic(id); } back => { root.forum-back(); } submit-topic => { root.forum-submit-topic(); } submit-reply => { root.forum-submit-reply(); } load-more-topics => { root.forum-load-more-topics(); } load-more-replies => { root.forum-load-more-replies(); } title-edited(value) => { root.forum-title-edited(value); } body-edited(value) => { root.forum-body-edited(value); } reply-edited(value) => { root.forum-reply-edited(value); } } if root.show-chat && !root.show-forum : ChatPanel { pending-image: root.pending-image; has-pending-image: root.has-pending-image; image-uploading: root.image-uploading; image-status: root.image-status; paste-image => { return root.paste-image(); } cancel-image => { root.cancel-image(); } send-image => { root.send-image(); } own-avatar: root.own-avatar; has-own-avatar: root.has-avatar; active-channel-id: root.is-dm ? "" : root.active-channel-id; active-channel-name: root.active-channel-name; messages: root.messages; members: root.members; input-text <=> root.input-text; members-visible: root.members-visible && root.width > 1100px; open-webhooks => { root.open-webhooks(); } toggle-members => { root.members-visible = !root.members-visible; } input-edited(text) => { root.input-edited(text); } is-dm: root.is-dm; e2ee-enabled: root.e2ee-enabled; dm-partner-name: root.dm-partner-name; replying-to-message: root.replying-to-message; replying-to-sender: root.replying-to-sender; replying-to-content: root.replying-to-content; send-message(id, text) => { root.send-message(id, text); } load-more(id) => { root.load-more(id); } react(id, emoji) => { root.react(id, emoji); } reply-to-msg(id) => { root.reply-to-msg(id); } edit-msg(id) => { root.edit-msg(id); } delete-msg(id) => { root.pending-delete-id = id; } cancel-reply => { root.cancel-reply(); } } if root.show-friends : FriendsPanel { friends: root.friends; online-count: root.friends-online-count; pending-requests: root.pending-requests; blocked-users: root.blocked-users; active-tab <=> root.friends-active-tab; add-friend-input <=> root.add-friend-input; tab-changed(tab) => { root.friends-tab-changed(tab); } input-edited(text) => { root.friend-input-edited(text); } add-friend(id) => { root.add-friend(id); } accept-friend(id) => { root.accept-friend(id); } decline-friend(id) => { root.decline-friend(id); } remove-friend(id) => { root.remove-friend(id); } start-dm(id) => { root.start-dm(id); } } if root.show-voice : VoicePanel { preview-screen => { root.open-screen-share(); } members: root.voice-members; mic-enabled: root.mic-enabled; deafened: root.deafened; channel-name: root.voice-channel-name; activity-banner: root.activity-banner; joining: root.voice-joining; own-avatar: root.own-avatar; has-own-avatar: root.has-avatar; push-to-talk: root.vad-mode == 0; ptt-held(held) => { root.ptt-held(held); } toggle-mic => { root.toggle-mic(); } toggle-deafen => { root.toggle-deafen(); } leave-voice => { root.leave-voice(); } } } } if root.settings-open : SettingsWindow { language-choice <=> root.language-choice; language-selected(choice) => { root.language-selected(choice); } own-avatar: root.own-avatar; has-avatar: root.has-avatar; avatar-error: root.avatar-error; avatar-saving: root.avatar-saving; account-name: root.account-name; central-authenticated: root.account-authenticated; profile-display-name <=> root.profile-display-name; profile-saving: root.profile-saving; profile-initials: root.profile-initials; profile-error: root.profile-error; save-profile-name(name) => { root.save-profile-name(name); } account-sign-out => { root.account-sign-out(); root.close-settings(); } choose-avatar => { root.choose-avatar(); } remove-avatar => { root.remove-avatar(); } theme-mode <=> root.theme-mode; theme-css <=> root.theme-css; theme-file-path <=> root.theme-file-path; text-size <=> root.text-size; theme-error: root.theme-error; theme-status: root.theme-status; theme-preview: root.theme-preview; theme-selected(mode) => { root.theme-selected(mode); } text-size-changed(size) => { root.text-size-changed(size); } preview-theme(css) => { root.preview-theme(css); } apply-theme(css) => { root.apply-theme(css); } reset-theme => { root.reset-theme(); } import-theme(path) => { root.import-theme(path); } export-theme(path) => { root.export-theme(path); } input-devices: root.input-devices; output-devices: root.output-devices; input-device-index <=> root.input-device-index; output-device-index <=> root.output-device-index; audio-changed => { root.audio-settings-changed(root.input-device-index, root.output-device-index, root.voice-bitrate, root.vad-mode, root.volume); } identity-pubkey: root.identity-pubkey; vault-enabled: root.vault-enabled; voice-input-device: root.voice-input-device; voice-output-device: root.voice-output-device; noise-suppress <=> root.noise-suppress; noise-suppress-available: root.noise-suppress-available; mic-test-running: root.mic-test-running; mic-test-level: root.mic-test-level; mic-test-error: root.mic-test-error; toggle-microphone-test => { root.toggle-microphone-test(); } noise-suppression-changed(enabled) => { root.noise-suppression-changed(enabled); } voice-bitrate <=> root.voice-bitrate; vad-mode <=> root.vad-mode; volume <=> root.volume; sounds-enabled <=> root.sounds-enabled; sounds-volume <=> root.sounds-volume; sounds-voice-room <=> root.sounds-voice-room; sounds-messages <=> root.sounds-messages; sounds-mentions <=> root.sounds-mentions; sounds-changed => { root.sound-settings-changed(root.sounds-enabled, root.sounds-volume, root.sounds-voice-room, root.sounds-messages, root.sounds-mentions); } preview-sound => { root.preview-sound(); } active-tab <=> root.active-tab; passphrase-modal-open <=> root.passphrase-modal-open; passphrase-input <=> root.passphrase-input; passphrase-confirm <=> root.passphrase-confirm; passphrase-error: root.passphrase-error; export-modal-open <=> root.export-modal-open; export-pass-input <=> root.export-pass-input; export-pass-confirm <=> root.export-pass-confirm; export-output: root.export-output; export-error: root.export-error; import-modal-open <=> root.import-modal-open; import-keyfile-input <=> root.import-keyfile-input; import-pass-input <=> root.import-pass-input; import-error: root.import-error; close => { root.close-settings(); } set-passphrase(pass, confirm) => { root.set-passphrase(pass, confirm); } remove-passphrase => { root.remove-passphrase(); } export-keyfile(pass, confirm) => { root.export-keyfile(pass, confirm); } import-keyfile(input, pass) => { root.import-keyfile(input, pass); } } if root.pending-delete-id != "" : Rectangle { background: Theme.overlay; TouchArea { } Rectangle { width: 420px; height: 170px; x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; background: Theme.bg-surface; border-radius: 10px; VerticalLayout { padding: 22px; spacing: 12px; Text { text: @tr("Delete message?"); font-size: Math.max(11px, Theme.font-size * 1.1875); color: Theme.text-primary; } Text { text: @tr("This cannot be undone."); font-size: Math.max(11px, Theme.font-size * 0.8125); color: Theme.text-muted; } HorizontalLayout { ActionButton { text: @tr("Cancel"); clicked => { root.pending-delete-id = ""; } } ActionButton { text: @tr("Delete"); danger: true; clicked => { root.delete-msg(root.pending-delete-id); root.pending-delete-id = ""; } } } } } } if root.avatar-crop-open : AvatarCropper { avatar-source: root.avatar-source; source-width: root.avatar-source-width; source-height: root.avatar-source-height; zoom <=> root.avatar-zoom; offset-x: root.avatar-offset-x; offset-y: root.avatar-offset-y; error: root.avatar-error; saving: root.avatar-saving; crop-moved(x,y) => { root.avatar-crop-moved(x,y); } zoom-changed(value) => { root.avatar-zoom-changed(value); } confirm => { root.confirm-avatar(); } cancel => { root.cancel-avatar(); } } if root.server-settings-open && root.node-admin && root.account-authenticated : ServerSettingsDialog { width:parent.width;height:parent.height; name <=>root.server-name-draft;description <=>root.server-description-draft; busy:root.server-settings-busy;loaded:root.server-settings-loaded;error:root.server-settings-error; channels:root.channels;structure:root.node-structure;forums:root.node-forums; name-edited(value)=>{root.server-name-edited(value);}description-edited(value)=>{root.server-description-edited(value);} save=>{root.server-settings-save();}reload=>{root.server-settings-reload();}close=>{root.server-settings-close();} create(kind)=>{root.create-global-channel(kind);}rename(id)=>{root.rename-global-channel(id);}remove(id)=>{root.delete-global-channel(id);} } if root.channel-admin-open && root.node-admin && root.account-authenticated : ChannelAdminDialog { width: parent.width; height: parent.height; parent-names:root.channel-admin-parent-names;parent-index <=>root.channel-admin-parent-index;parent-selected(index)=>{root.channel-admin-parent-selected(index);} operation: root.channel-admin-operation; kind: root.channel-admin-kind; name <=> root.channel-admin-name; busy: root.channel-admin-busy; error: root.channel-admin-error; name-edited(value) => { root.channel-admin-name-edited(value); } submit => { root.channel-admin-submit(); } cancel => { root.channel-admin-cancel(); } } if root.management-menu-open :ManagementMenu { width:parent.width;height:parent.height; actions:root.management-actions;anchor-x:root.management-menu-x;anchor-y:root.management-menu-y; chosen(action)=>{root.management-menu-chosen(action);}dismiss=>{root.management-menu-close();} } }