feat(client): add RU/EN localization and native capture preview
This commit is contained in:
parent
8e5ab56611
commit
8460fb28fd
43 changed files with 4103 additions and 275 deletions
|
|
@ -37,10 +37,10 @@ export component AvatarCropper inherits Rectangle {
|
|||
VerticalLayout {
|
||||
padding: 18px; spacing: 8px; alignment: start;
|
||||
HorizontalLayout {
|
||||
Text { text: "Выбрать область фото"; color: Theme.text-primary; font-size: Theme.font-size + 5px; font-weight: 600; horizontal-stretch: 1; vertical-alignment: center; }
|
||||
Text { text: @tr("Crop photo"); color: Theme.text-primary; font-size: Theme.font-size + 5px; font-weight: 600; horizontal-stretch: 1; vertical-alignment: center; }
|
||||
ActionButton { text: "×"; width: 30px; quiet: true; clicked => { root.cancel(); } }
|
||||
}
|
||||
Text { text: "Перетащи фото и выбери масштаб."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); }
|
||||
Text { text: @tr("Drag the photo and adjust the zoom."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); }
|
||||
Rectangle { height: 4px; }
|
||||
HorizontalLayout {
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
|
|
@ -48,7 +48,7 @@ export component AvatarCropper inherits Rectangle {
|
|||
width: root.frame-size; height: root.frame-size;
|
||||
clip: true; background: Theme.bg-surface;
|
||||
accessible-role: image;
|
||||
accessible-label: "Область фото. Перетаскивай изображение, чтобы изменить кадрирование.";
|
||||
accessible-label: @tr("Photo crop area. Drag the image to adjust the crop.");
|
||||
Image {
|
||||
source: root.avatar-source;
|
||||
width: root.source-width * root.cover-scale * 1px;
|
||||
|
|
@ -100,16 +100,16 @@ export component AvatarCropper inherits Rectangle {
|
|||
ActionButton { text: "+"; width: 32px; clicked => { root.set-zoom(root.zoom + 0.1); } }
|
||||
}
|
||||
HorizontalLayout {
|
||||
Text { text: "Масштаб " + Math.round(root.zoom * 100) + "%"; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 4px, 11px); vertical-alignment: center; horizontal-stretch: 1; }
|
||||
ActionButton { text: "Сбросить кадр"; quiet: true; clicked => { root.crop-moved(0,0); root.set-zoom(1); } }
|
||||
Text { text: @tr("Zoom {}%", Math.round(root.zoom * 100)); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 4px, 11px); vertical-alignment: center; horizontal-stretch: 1; }
|
||||
ActionButton { text: @tr("Reset crop"); quiet: true; clicked => { root.crop-moved(0,0); root.set-zoom(1); } }
|
||||
}
|
||||
if root.error != "" : Text { text: root.error; color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Отмена"; quiet: true; clicked => { root.cancel(); } }
|
||||
ActionButton { text: @tr("Cancel"); quiet: true; clicked => { root.cancel(); } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: "Использовать фото"; active: true; clicked => { root.confirm(); } }
|
||||
ActionButton { text: @tr("Use photo"); active: true; clicked => { root.confirm(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ component MessageRow inherits Rectangle {
|
|||
if root.message.show_author : HorizontalLayout {
|
||||
spacing: 9px;
|
||||
Text { text: root.message.sender_name; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.875); font-weight: 600; overflow: elide; }
|
||||
Text { text: root.message.timestamp + (root.message.edited ? " · изменено" : ""); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); }
|
||||
Text { text: root.message.timestamp + (root.message.edited ? @tr(" · edited") : ""); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
Text { text: root.message.content; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); wrap: word-wrap; }
|
||||
|
|
@ -57,9 +57,9 @@ component MessageRow inherits Rectangle {
|
|||
HorizontalLayout {
|
||||
spacing: 3px;
|
||||
ActionButton { text: "👍"; quiet: true; clicked => { root.react(root.message.message_id, "👍"); } }
|
||||
ActionButton { text: "Ответить"; quiet: true; clicked => { root.reply-to-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: "Править"; quiet: true; clicked => { root.edit-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: "Удалить"; danger: true; quiet: true; clicked => { root.delete-msg(root.message.message_id); } }
|
||||
ActionButton { text: @tr("Reply"); quiet: true; clicked => { root.reply-to-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: @tr("Edit"); quiet: true; clicked => { root.edit-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: @tr("Delete"); danger: true; quiet: true; clicked => { root.delete-msg(root.message.message_id); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -97,9 +97,9 @@ export component ChatPanel inherits Rectangle {
|
|||
padding-left: 22px; padding-right: 16px; spacing: 12px;
|
||||
Text { text: root.is-dm ? "@" : "#"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 1.4375); width: 20px; vertical-alignment: center; }
|
||||
Text { text: root.is-dm ? root.dm-partner-name : root.active-channel-name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; overflow: elide; vertical-alignment: center; }
|
||||
if root.e2ee-enabled : Text { text: "Сквозное шифрование"; color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.6875); }
|
||||
if root.e2ee-enabled : Text { text: @tr("End-to-end encrypted"); color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.6875); }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
if !root.is-dm : ActionButton { text: "Участники"; active: root.members-visible; clicked => { root.toggle-members(); } }
|
||||
if !root.is-dm : ActionButton { text: @tr("Members"); active: root.members-visible; clicked => { root.toggle-members(); } }
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
|
|
@ -111,7 +111,7 @@ export component ChatPanel inherits Rectangle {
|
|||
VerticalLayout {
|
||||
spacing: 0;
|
||||
if root.messages.length == 0 : Text {
|
||||
text: root.is-dm ? "Сообщений пока нет. Напиши первым." : "В этом канале пока нет сообщений.";
|
||||
text: root.is-dm ? @tr("No messages yet. Say hello.") : @tr("No messages in this channel yet.");
|
||||
color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); wrap: word-wrap;
|
||||
}
|
||||
for msg in root.messages: MessageRow {
|
||||
|
|
@ -131,7 +131,7 @@ export component ChatPanel inherits Rectangle {
|
|||
height: 34px; background: Theme.bg-elevated;
|
||||
HorizontalLayout {
|
||||
padding-left: 16px; padding-right: 16px; spacing: 9px;
|
||||
Text { text: "Ответ " + root.replying-to-sender; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: @tr("Reply to {}", root.replying-to-sender); color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: root.replying-to-content; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-stretch: 1; overflow: elide; }
|
||||
ActionButton { text: "×"; quiet: true; width: 28px; clicked => { root.cancel-reply(); } }
|
||||
}
|
||||
|
|
@ -160,12 +160,12 @@ export component ChatPanel inherits Rectangle {
|
|||
}
|
||||
}
|
||||
ActionButton {
|
||||
text: "Отправить";
|
||||
text: @tr("Send");
|
||||
clicked => { root.send-message(root.is-dm ? "" : root.active-channel-id, root.input-text); }
|
||||
}
|
||||
}
|
||||
}
|
||||
Text { text: "Enter — отправить · Shift+Enter — новая строка"; color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.6875); height: 18px; }
|
||||
Text { text: @tr("Enter to send · Shift+Enter for a new line"); color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.6875); height: 18px; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ export component ChatPanel inherits Rectangle {
|
|||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
padding: 16px; spacing: 12px;
|
||||
Text { text: "Участники — " + root.members.length; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 28px; }
|
||||
Text { text: @tr("Members — {}", root.members.length); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 28px; }
|
||||
for member in root.members: HorizontalLayout {
|
||||
height: 38px; spacing: 9px;
|
||||
Rectangle { width: 28px; height: 28px; background: Theme.avatar-bg; border-radius: 11px; Text { text: member.avatar_text; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.6875); horizontal-alignment: center; vertical-alignment: center; } }
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export component ConnectScreen inherits Rectangle {
|
|||
Image { source: @image-url("assets/vnox-mark.svg"); width: 32px; height: 32px; image-fit: contain; }
|
||||
Text { text: "Vnox"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.1875); font-weight: 700; }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: "Настройки"; quiet: true; clicked => { root.open-settings(); } }
|
||||
ActionButton { text: @tr("Settings"); quiet: true; clicked => { root.open-settings(); } }
|
||||
}
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
HorizontalLayout {
|
||||
|
|
@ -33,9 +33,9 @@ export component ConnectScreen inherits Rectangle {
|
|||
background: Theme.bg-surface; border-radius: 14px;
|
||||
VerticalLayout {
|
||||
padding: 28px; spacing: 15px;
|
||||
Text { text: "Подключиться к серверу"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.5); font-weight: 600; }
|
||||
Text { text: "Введи адрес своего сервера или выбери сохранённый."; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; }
|
||||
Text { text: "Адрес сервера"; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: @tr("Connect to a server"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.5); font-weight: 600; }
|
||||
Text { text: @tr("Enter your server address or choose a saved server."); color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; }
|
||||
Text { text: @tr("Server address"); color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
Rectangle {
|
||||
|
|
@ -51,23 +51,23 @@ export component ConnectScreen inherits Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
if !root.connecting : ActionButton { text: "Подключиться"; height: 40px; clicked => { root.connect(root.address-input); } }
|
||||
if root.connecting : ActionButton { text: "Отмена"; height: 40px; clicked => { root.disconnect(); } }
|
||||
if !root.connecting : ActionButton { text: @tr("Connect"); height: 40px; clicked => { root.connect(root.address-input); } }
|
||||
if root.connecting : ActionButton { text: @tr("Cancel"); height: 40px; clicked => { root.disconnect(); } }
|
||||
}
|
||||
HorizontalLayout {
|
||||
ActionButton { text: root.auto-reconnect ? "✓" : "○"; width: 30px; quiet: true; clicked => { root.auto-reconnect = !root.auto-reconnect; root.auto-reconnect-changed(root.auto-reconnect); } }
|
||||
Text { text: "Переподключаться при потере связи"; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: @tr("Reconnect automatically"); color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
if root.connecting : Text { text: "Подключение…"; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.8125); }
|
||||
if root.connecting : Text { text: @tr("Connecting…"); color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.8125); }
|
||||
if root.status-text != "" : Text { text: root.status-text; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
HorizontalLayout {
|
||||
Text { text: "Сохранённые серверы"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); font-weight: 600; }
|
||||
Text { text: @tr("Saved servers"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); font-weight: 600; }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: "+ Сохранить адрес"; quiet: true; clicked => { root.add-bookmark(root.address-input); } }
|
||||
ActionButton { text: @tr("+ Save address"); quiet: true; clicked => { root.add-bookmark(root.address-input); } }
|
||||
}
|
||||
if root.bookmarks.length == 0 : Text { text: "Сохранённых серверов пока нет."; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
if root.bookmarks.length == 0 : Text { text: @tr("No saved servers yet."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
for server in root.bookmarks: HorizontalLayout {
|
||||
height: 48px; spacing: 8px;
|
||||
VerticalLayout {
|
||||
|
|
@ -75,7 +75,7 @@ export component ConnectScreen inherits Rectangle {
|
|||
Text { text: server.name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); overflow: elide; }
|
||||
Text { text: server.address; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); overflow: elide; }
|
||||
}
|
||||
ActionButton { text: "Войти"; quiet: true; clicked => { if !root.connecting { root.connect(server.address); } } }
|
||||
ActionButton { text: @tr("Join"); quiet: true; clicked => { if !root.connecting { root.connect(server.address); } } }
|
||||
ActionButton { text: "×"; width: 28px; quiet: true; clicked => { root.remove-bookmark(server.address); } }
|
||||
}
|
||||
}
|
||||
|
|
@ -83,6 +83,6 @@ export component ConnectScreen inherits Rectangle {
|
|||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
Text { text: "Твой сервер. Твоё сообщество."; color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-alignment: center; }
|
||||
Text { text: @tr("Your server. Your community."); color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-alignment: center; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Theme, ActionButton } from "theme.slint";
|
||||
|
||||
export struct FriendItem { user_id: string, nickname: string, status: string }
|
||||
export struct FriendItem { user_id: string, nickname: string, status: string, status_label: string }
|
||||
|
||||
export component FriendsPanel inherits Rectangle {
|
||||
in-out property <[FriendItem]> friends;
|
||||
|
|
@ -22,11 +22,11 @@ export component FriendsPanel inherits Rectangle {
|
|||
height: 56px; border-width: 1px; border-color: Theme.border;
|
||||
HorizontalLayout {
|
||||
padding-left: 22px; padding-right: 16px; spacing: 10px;
|
||||
Text { text: "Друзья"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; }
|
||||
ActionButton { text: "В сети"; active: root.active-tab == "online"; quiet: true; clicked => { root.tab-changed("online"); } }
|
||||
ActionButton { text: "Все"; active: root.active-tab == "all"; quiet: true; clicked => { root.tab-changed("all"); } }
|
||||
ActionButton { text: "Запросы"; active: root.active-tab == "pending"; quiet: true; clicked => { root.tab-changed("pending"); } }
|
||||
ActionButton { text: "Блокировки"; active: root.active-tab == "blocked"; quiet: true; clicked => { root.tab-changed("blocked"); } }
|
||||
Text { text: @tr("Friends"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; }
|
||||
ActionButton { text: @tr("Online"); active: root.active-tab == "online"; quiet: true; clicked => { root.tab-changed("online"); } }
|
||||
ActionButton { text: @tr("All"); active: root.active-tab == "all"; quiet: true; clicked => { root.tab-changed("all"); } }
|
||||
ActionButton { text: @tr("Requests"); active: root.active-tab == "pending"; quiet: true; clicked => { root.tab-changed("pending"); } }
|
||||
ActionButton { text: @tr("Blocked"); active: root.active-tab == "blocked"; quiet: true; clicked => { root.tab-changed("blocked"); } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
|
|
@ -41,9 +41,9 @@ export component FriendsPanel inherits Rectangle {
|
|||
TextInput { text <=> root.add-friend-input; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); single-line: true; edited => { root.input-edited(self.text); } accepted => { root.add-friend(root.add-friend-input); } }
|
||||
}
|
||||
}
|
||||
ActionButton { text: "Добавить по ID"; height: 38px; clicked => { root.add-friend(root.add-friend-input); } }
|
||||
ActionButton { text: @tr("Add by ID"); height: 38px; clicked => { root.add-friend(root.add-friend-input); } }
|
||||
}
|
||||
Text { text: root.active-tab == "pending" ? "Входящие запросы" : root.active-tab == "blocked" ? "Заблокированные пользователи" : root.active-tab == "online" ? "Друзья в сети" : "Все друзья"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: root.active-tab == "pending" ? @tr("Incoming requests") : root.active-tab == "blocked" ? @tr("Blocked users") : root.active-tab == "online" ? @tr("Online friends") : @tr("All friends"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Flickable {
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
|
|
@ -59,10 +59,10 @@ export component FriendsPanel inherits Rectangle {
|
|||
VerticalLayout {
|
||||
spacing: 2px; horizontal-stretch: 1;
|
||||
Text { text: friend.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
Text { text: friend.status; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); }
|
||||
Text { text: friend.status_label; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); }
|
||||
}
|
||||
ActionButton { text: "Написать"; quiet: true; clicked => { root.start-dm(friend.user_id); } }
|
||||
ActionButton { text: "Удалить"; quiet: true; danger: true; clicked => { root.remove-friend(friend.user_id); } }
|
||||
ActionButton { text: @tr("Message"); quiet: true; clicked => { root.start-dm(friend.user_id); } }
|
||||
ActionButton { text: @tr("Delete"); quiet: true; danger: true; clicked => { root.remove-friend(friend.user_id); } }
|
||||
}
|
||||
}
|
||||
for friend in root.pending-requests: Rectangle {
|
||||
|
|
@ -71,8 +71,8 @@ export component FriendsPanel inherits Rectangle {
|
|||
HorizontalLayout {
|
||||
padding: 10px; spacing: 10px;
|
||||
Text { text: friend.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-stretch: 1; }
|
||||
ActionButton { text: "Принять"; clicked => { root.accept-friend(friend.user_id); } }
|
||||
ActionButton { text: "Отклонить"; danger: true; quiet: true; clicked => { root.decline-friend(friend.user_id); } }
|
||||
ActionButton { text: @tr("Accept"); clicked => { root.accept-friend(friend.user_id); } }
|
||||
ActionButton { text: @tr("Decline"); danger: true; quiet: true; clicked => { root.decline-friend(friend.user_id); } }
|
||||
}
|
||||
}
|
||||
for user in root.blocked-users: Rectangle {
|
||||
|
|
@ -80,9 +80,9 @@ export component FriendsPanel inherits Rectangle {
|
|||
height: 40px;
|
||||
Text { text: user; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); overflow: elide; }
|
||||
}
|
||||
if root.friends.length == 0 && (root.active-tab == "all" || root.active-tab == "online") : Text { text: "Список друзей пока пуст. Добавь друга по его ID."; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); wrap: word-wrap; }
|
||||
if root.pending-requests.length == 0 && root.active-tab == "pending" : Text { text: "Новых запросов нет."; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
if root.blocked-users.length == 0 && root.active-tab == "blocked" : Text { text: "Список блокировок пуст."; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
if root.friends.length == 0 && (root.active-tab == "all" || root.active-tab == "online") : Text { text: @tr("No friends yet. Add someone using their ID."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); wrap: word-wrap; }
|
||||
if root.pending-requests.length == 0 && root.active-tab == "pending" : Text { text: @tr("No new requests."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
if root.blocked-users.length == 0 && root.active-tab == "blocked" : Text { text: @tr("No blocked users."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
export { ScreenShareWindow } from "screen-share.slint";
|
||||
export { UnlockWindow } from "unlock.slint";
|
||||
export { Theme } from "theme.slint";
|
||||
import { Theme, ActionButton } from "theme.slint";
|
||||
|
|
@ -77,6 +78,8 @@ export component MainWindow inherits Window {
|
|||
in-out property <float> voice-bitrate: 64.0;
|
||||
in-out property <int> vad-mode: 0;
|
||||
in-out property <float> volume: 100.0;
|
||||
in-out property <string> language-choice: "system";
|
||||
callback language-selected(string);
|
||||
in-out property <string> theme-mode: "dark";
|
||||
in-out property <string> theme-css;
|
||||
in-out property <string> theme-file-path;
|
||||
|
|
@ -124,6 +127,7 @@ export component MainWindow inherits Window {
|
|||
callback friends-tab-changed(string);
|
||||
callback friend-input-edited(string);
|
||||
callback open-settings();
|
||||
callback open-screen-share();
|
||||
callback show-voice-view();
|
||||
callback show-friends-view();
|
||||
callback audio-settings-changed(int, int, float, int, float);
|
||||
|
|
@ -258,6 +262,7 @@ export component MainWindow inherits Window {
|
|||
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;
|
||||
|
|
@ -273,6 +278,8 @@ export component MainWindow inherits Window {
|
|||
}
|
||||
}
|
||||
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;
|
||||
|
|
@ -338,11 +345,11 @@ export component MainWindow inherits Window {
|
|||
background: Theme.bg-surface; border-radius: 10px;
|
||||
VerticalLayout {
|
||||
padding: 22px; spacing: 12px;
|
||||
Text { text: "Удалить сообщение?"; font-size: Math.max(11px, Theme.font-size * 1.1875); color: Theme.text-primary; }
|
||||
Text { text: "Это действие нельзя отменить."; font-size: Math.max(11px, Theme.font-size * 0.8125); color: Theme.text-muted; }
|
||||
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: "Отмена"; clicked => { root.pending-delete-id = ""; } }
|
||||
ActionButton { text: "Удалить"; danger: true; clicked => { root.delete-msg(root.pending-delete-id); root.pending-delete-id = ""; } }
|
||||
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 = ""; } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
58
src/ui/slint/screen-share.slint
Normal file
58
src/ui/slint/screen-share.slint
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { DeviceSelect } from "controls.slint";
|
||||
import { Theme, ActionButton } from "theme.slint";
|
||||
|
||||
export component ScreenShareWindow inherits Window {
|
||||
title: @tr("Screen preview");
|
||||
preferred-width: 820px; preferred-height: 740px; min-width: 640px; min-height: 650px;
|
||||
background: Theme.bg-base;
|
||||
in-out property <image> preview;
|
||||
in-out property <bool> has-frame;
|
||||
in-out property <bool> capable;
|
||||
in-out property <bool> busy;
|
||||
in-out property <bool> running;
|
||||
in-out property <string> error;
|
||||
in-out property <[string]> audio-sources;
|
||||
in-out property <int> source-index;
|
||||
in-out property <int> audio-mode;
|
||||
in-out property <float> audio-level;
|
||||
callback refresh-audio();
|
||||
callback choose-source();
|
||||
callback stop-capture();
|
||||
callback audio-mode-changed();
|
||||
VerticalLayout {
|
||||
padding: 28px; spacing: 14px;
|
||||
Text { text: @tr("Choose what you share"); color: Theme.text-primary; font-size: 24px; font-weight: 600; }
|
||||
Text { text: @tr("Video, application audio and your microphone stay separate."); color: Theme.text-secondary; wrap: word-wrap; }
|
||||
Rectangle {
|
||||
min-height: 270px; vertical-stretch: 1; background: Theme.bg-rail; border-radius: 10px;
|
||||
Image { visible: root.has-frame; source: root.preview; image-fit: contain; }
|
||||
if !root.has-frame : Text { text: root.busy ? @tr("Choose a screen or window in the system dialog…") : @tr("Your preview appears here after you choose a source."); color: Theme.text-muted; wrap: word-wrap; horizontal-alignment: center; vertical-alignment: center; }
|
||||
if root.running : Rectangle {
|
||||
x: 12px; y: 12px; width: 132px; height: 28px; border-radius: 5px; background: Theme.bg-surface;
|
||||
Text { text: @tr("LOCAL PREVIEW"); color: Theme.accent; font-size: 11px; horizontal-alignment: center; vertical-alignment: center; }
|
||||
}
|
||||
}
|
||||
Text { text: @tr("Share audio"); color: Theme.text-primary; font-weight: 600; }
|
||||
if root.capable && !root.running && !root.busy : HorizontalLayout {
|
||||
mode := DeviceSelect { model: [@tr("No audio"), @tr("One application"), @tr("System output")]; current-index <=> root.audio-mode; selected => { root.audio-mode-changed(); } }
|
||||
source := DeviceSelect { visible: root.audio-mode > 0; model: root.audio-sources; current-index <=> root.source-index; horizontal-stretch: 1; }
|
||||
ActionButton { text: @tr("Refresh"); clicked => { root.refresh-audio(); } }
|
||||
}
|
||||
if root.audio-mode == 2 : Text { text: @tr("System output includes notifications and other applications. Select it only if you intend to share all of that output."); color: Theme.danger; wrap: word-wrap; }
|
||||
if root.audio-mode == 1 : Text { text: @tr("Only a currently playing application can be selected. If it closes, capture stops without switching sources."); color: Theme.text-muted; wrap: word-wrap; }
|
||||
if root.running && root.audio-mode > 0 : Rectangle {
|
||||
height: 5px; background: Theme.bg-interactive; border-radius: 2px;
|
||||
Rectangle { width: parent.width * root.audio-level; background: Theme.success; border-radius: 2px; }
|
||||
}
|
||||
Text { text: @tr("Microphone uses your existing voice controls. This preview never enables or mixes it."); color: Theme.text-secondary; wrap: word-wrap; }
|
||||
Rectangle {
|
||||
height: note.preferred-height + 24px; background: Theme.bg-surface; border-radius: 8px;
|
||||
note := Text { x: 12px; y: 12px; width: parent.width - 24px; text: root.capable ? @tr("Local capture is available. Broadcasting to other members is not available until the media transport is connected.") : @tr("Screen capture is not available in this build."); color: Theme.text-muted; wrap: word-wrap; }
|
||||
}
|
||||
if root.error != "" : Text { text: root.error; color: Theme.danger; wrap: word-wrap; }
|
||||
HorizontalLayout {
|
||||
Text { text: root.running && root.has-frame ? @tr("Preview active · not broadcasting") : @tr("Nothing is being broadcast"); color: Theme.text-muted; vertical-alignment: center; horizontal-stretch: 1; }
|
||||
if root.capable : ActionButton { text: root.running || root.busy ? @tr("Stop") : @tr("Choose screen or window"); clicked => { if root.running || root.busy { root.stop-capture(); } else { root.choose-source(); } } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -60,6 +60,8 @@ export component SettingsWindow inherits Rectangle {
|
|||
in-out property <string> import-keyfile-input;
|
||||
in-out property <string> import-pass-input;
|
||||
in-out property <string> import-error;
|
||||
in-out property <string> language-choice: "system";
|
||||
callback language-selected(string);
|
||||
in-out property <string> theme-mode;
|
||||
in-out property <string> theme-css;
|
||||
in-out property <string> theme-file-path;
|
||||
|
|
@ -88,15 +90,15 @@ export component SettingsWindow inherits Rectangle {
|
|||
width: 236px; background: Theme.bg-surface;
|
||||
VerticalLayout {
|
||||
padding-left: 16px; padding-right: 16px; padding-top: 32px; padding-bottom: 20px; spacing: 7px;
|
||||
Text { text: "Настройки"; color: Theme.text-primary; font-size: Theme.font-size + 6px; font-weight: 700; height: 46px; }
|
||||
SettingsNav { label: "Звук и микрофон"; detail: "Устройства и передача"; mark: "◖"; active: root.active-tab == "audio"; clicked => { root.active-tab = "audio"; } }
|
||||
SettingsNav { label: "Внешний вид"; detail: "Темы, цвета и текст"; mark: "Aa"; active: root.active-tab == "appearance"; clicked => { root.active-tab = "appearance"; } }
|
||||
SettingsNav { label: "Профиль и ключи"; detail: "Защита и резервная копия"; mark: "◇"; active: root.active-tab == "identity"; clicked => { root.active-tab = "identity"; } }
|
||||
Text { text: @tr("Settings"); color: Theme.text-primary; font-size: Theme.font-size + 6px; font-weight: 700; height: 46px; }
|
||||
SettingsNav { label: @tr("Audio & microphone"); detail: @tr("Devices and voice input"); mark: "◖"; active: root.active-tab == "audio"; clicked => { root.active-tab = "audio"; } }
|
||||
SettingsNav { label: @tr("Appearance"); detail: @tr("Themes, colours and text"); mark: "Aa"; active: root.active-tab == "appearance"; clicked => { root.active-tab = "appearance"; } }
|
||||
SettingsNav { label: @tr("Profile and keys"); detail: @tr("Security and backup"); mark: "◇"; active: root.active-tab == "identity"; clicked => { root.active-tab = "identity"; } }
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Text { text: "VNOX"; color: Theme.text-secondary; font-size: Math.max(Theme.font-size - 3px, 11px); font-weight: 700; height: 30px; vertical-alignment: bottom; }
|
||||
Text { text: "Настройки этого устройства"; color: Theme.text-disabled; font-size: Math.max(Theme.font-size - 5px, 11px); }
|
||||
ActionButton { text: "Вернуться в приложение"; quiet: true; clicked => { root.close(); } }
|
||||
Text { text: @tr("Settings for this device"); color: Theme.text-disabled; font-size: Math.max(Theme.font-size - 5px, 11px); }
|
||||
ActionButton { text: @tr("Back to the app"); quiet: true; clicked => { root.close(); } }
|
||||
}
|
||||
}
|
||||
Rectangle { width: 1px; background: Theme.border; }
|
||||
|
|
@ -108,8 +110,8 @@ export component SettingsWindow inherits Rectangle {
|
|||
padding-left: 34px; padding-right: 28px; padding-top: 29px; padding-bottom: 20px; spacing: 18px;
|
||||
VerticalLayout {
|
||||
spacing: 6px;
|
||||
Text { text: root.active-tab == "appearance" ? "Внешний вид" : root.active-tab == "identity" ? "Профиль и ключи" : "Звук и микрофон"; color: Theme.text-primary; font-size: Theme.font-size + 12px; font-weight: 700; }
|
||||
Text { text: root.active-tab == "appearance" ? "Сделай Vnox своим." : root.active-tab == "identity" ? "Твой профиль и его сохранность." : "Голос должен звучать так, как тебе удобно."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); }
|
||||
Text { text: root.active-tab == "appearance" ? @tr("Appearance") : root.active-tab == "identity" ? @tr("Profile and keys") : @tr("Audio & microphone"); color: Theme.text-primary; font-size: Theme.font-size + 12px; font-weight: 700; }
|
||||
Text { text: root.active-tab == "appearance" ? @tr("Make Vnox yours.") : root.active-tab == "identity" ? @tr("Your profile, kept safe.") : @tr("Make yourself heard, your way."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); }
|
||||
}
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: "×"; width: 34px; text-size: 21px; quiet: true; clicked => { root.close(); } }
|
||||
|
|
@ -131,6 +133,8 @@ export component SettingsWindow inherits Rectangle {
|
|||
audio-changed => { root.audio-changed(); }
|
||||
}
|
||||
if root.active-tab == "appearance" : AppearanceSettings {
|
||||
language-choice <=> root.language-choice;
|
||||
language-selected(choice) => { root.language-selected(choice); }
|
||||
theme-mode <=> root.theme-mode;
|
||||
theme-css <=> root.theme-css;
|
||||
theme-file-path <=> root.theme-file-path;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ component ThemeChoice inherits Rectangle {
|
|||
}
|
||||
|
||||
export component AppearanceSettings inherits Rectangle {
|
||||
in-out property <string> language-choice: "system";
|
||||
callback language-selected(string);
|
||||
in-out property <string> theme-mode;
|
||||
in-out property <string> theme-css;
|
||||
in-out property <string> theme-file-path;
|
||||
|
|
@ -51,55 +53,66 @@ export component AppearanceSettings inherits Rectangle {
|
|||
callback export-theme(string);
|
||||
VerticalLayout {
|
||||
spacing: 0; alignment: start;
|
||||
Text { text: "Тема приложения"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: "Один выбор для чата, комнат и настроек. Можно изменить в любой момент."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Language"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("Choose your language. Changes apply immediately."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 10px; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: @tr("System default"); active: root.language-choice == "system"; clicked => { root.language-selected("system"); } }
|
||||
ActionButton { text: "Русский"; active: root.language-choice == "ru"; clicked => { root.language-selected("ru"); } }
|
||||
ActionButton { text: "English"; active: root.language-choice == "en"; clicked => { root.language-selected("en"); } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
Rectangle { height: 24px; }
|
||||
Text { text: @tr("App theme"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("One theme for chat, rooms and settings. Change it at any time."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 20px; }
|
||||
HorizontalLayout {
|
||||
spacing: 12px;
|
||||
ThemeChoice { label: "Светлая"; selected: root.theme-mode == "light"; preview-background: #f5f4f2; preview-sidebar: #e6e4e0; preview-ink: #353330; clicked => { root.theme-selected("light"); } }
|
||||
ThemeChoice { label: "Тёмная"; selected: root.theme-mode == "dark"; preview-background: #272729; preview-sidebar: #202022; preview-ink: #e9e7e4; clicked => { root.theme-selected("dark"); } }
|
||||
ThemeChoice { label: "Мега-тёмная"; selected: root.theme-mode == "black"; preview-background: #080808; preview-sidebar: #131313; preview-ink: #dedbd5; clicked => { root.theme-selected("black"); } }
|
||||
ThemeChoice { label: "Своя тема"; selected: root.theme-mode == "custom"; preview-background: Theme.bg-base; preview-sidebar: Theme.bg-surface; preview-ink: Theme.accent; clicked => { root.theme-selected("custom"); } }
|
||||
ThemeChoice { label: @tr("Light"); selected: root.theme-mode == "light"; preview-background: #f5f4f2; preview-sidebar: #e6e4e0; preview-ink: #353330; clicked => { root.theme-selected("light"); } }
|
||||
ThemeChoice { label: @tr("Dark"); selected: root.theme-mode == "dark"; preview-background: #272729; preview-sidebar: #202022; preview-ink: #e9e7e4; clicked => { root.theme-selected("dark"); } }
|
||||
ThemeChoice { label: @tr("Extra dark"); selected: root.theme-mode == "black"; preview-background: #080808; preview-sidebar: #131313; preview-ink: #dedbd5; clicked => { root.theme-selected("black"); } }
|
||||
ThemeChoice { label: @tr("Custom"); selected: root.theme-mode == "custom"; preview-background: Theme.bg-base; preview-sidebar: Theme.bg-surface; preview-ink: Theme.accent; clicked => { root.theme-selected("custom"); } }
|
||||
}
|
||||
Rectangle { height: 29px; }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 24px; }
|
||||
HorizontalLayout {
|
||||
Text { text: "Размер текста"; color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: @tr("Text size"); color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: Math.round(root.text-size) + " px"; color: Theme.text-secondary; font-size: Math.max(Theme.font-size - 2px, 11px); horizontal-alignment: right; }
|
||||
}
|
||||
Rectangle { height: 9px; }
|
||||
AudioSlider { minimum: 12; maximum: 22; value <=> root.text-size; changed(value) => { root.text-size-changed(value); } }
|
||||
Text { text: "Меняет масштаб текста во всём приложении."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Adjust text size throughout the app."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 29px; }
|
||||
if root.theme-mode == "custom" : VerticalLayout {
|
||||
spacing: 12px; alignment: start;
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 8px; }
|
||||
HorizontalLayout {
|
||||
Text { text: "Редактор темы"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; horizontal-stretch: 1; }
|
||||
if root.theme-preview : Text { text: "Предпросмотр"; color: Theme.accent; font-size: Math.max(Theme.font-size - 3px, 11px); }
|
||||
Text { text: @tr("Theme editor"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; horizontal-stretch: 1; }
|
||||
if root.theme-preview : Text { text: @tr("Preview"); color: Theme.accent; font-size: Math.max(Theme.font-size - 3px, 11px); }
|
||||
}
|
||||
Text { text: "CSS-переменные в блоке :root меняют цвета и размер текста. Обычные CSS-селекторы, стили размещения и внешние ресурсы не поддерживаются."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("CSS variables in :root control colours and text size. CSS selectors, layout rules and external resources are not supported."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
ThemeEditor { text <=> root.theme-css; height: 220px; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Предпросмотр"; clicked => { root.preview-theme(root.theme-css); } }
|
||||
ActionButton { text: "Применить"; active: true; clicked => { root.apply-theme(root.theme-css); } }
|
||||
ActionButton { text: @tr("Preview"); clicked => { root.preview-theme(root.theme-css); } }
|
||||
ActionButton { text: @tr("Apply"); active: true; clicked => { root.apply-theme(root.theme-css); } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: "Сбросить"; quiet: true; clicked => { root.reset-theme(); } }
|
||||
ActionButton { text: @tr("Reset"); quiet: true; clicked => { root.reset-theme(); } }
|
||||
}
|
||||
Text { text: "Основные переменные: --vnox-bg, --vnox-surface, --vnox-text, --vnox-accent, --vnox-font-size. Полный список описан в документации тем."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 4px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Main variables: --vnox-bg, --vnox-surface, --vnox-text, --vnox-accent, --vnox-font-size. See the theme documentation for the full list."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 4px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 8px; }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 8px; }
|
||||
Text { text: "Файл темы"; color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; }
|
||||
Text { text: "Введи локальный путь к .css, чтобы импортировать тему или сохранить её в файл."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
ThemeInput { text <=> root.theme-file-path; placeholder-text: "Например: /home/user/themes/my-vnox.css"; accepted => { root.import-theme(root.theme-file-path); } }
|
||||
Text { text: @tr("Theme file"); color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; }
|
||||
Text { text: @tr("Enter a local .css path to import or export a theme."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
ThemeInput { text <=> root.theme-file-path; placeholder-text: @tr("For example: /home/user/themes/my-vnox.css"); accepted => { root.import-theme(root.theme-file-path); } }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Импортировать"; clicked => { root.import-theme(root.theme-file-path); } }
|
||||
ActionButton { text: "Экспортировать"; clicked => { root.export-theme(root.theme-file-path); } }
|
||||
ActionButton { text: @tr("Import"); clicked => { root.import-theme(root.theme-file-path); } }
|
||||
ActionButton { text: @tr("Export"); clicked => { root.export-theme(root.theme-file-path); } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ export component AudioSettings inherits Rectangle {
|
|||
VerticalLayout {
|
||||
spacing: 0;
|
||||
alignment: start;
|
||||
Text { text: "Устройства"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: "Выбери, откуда брать голос и куда выводить звук."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Devices"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("Choose your microphone and audio output."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 24px; }
|
||||
Text { text: "Микрофон"; color: Theme.text-primary; font-size: Math.max(Theme.font-size - 2px, 11px); }
|
||||
Text { text: @tr("Microphone"); color: Theme.text-primary; font-size: Math.max(Theme.font-size - 2px, 11px); }
|
||||
Rectangle { height: 9px; }
|
||||
DeviceSelect {
|
||||
model: root.input-devices;
|
||||
|
|
@ -24,7 +24,7 @@ export component AudioSettings inherits Rectangle {
|
|||
selected(value) => { root.audio-changed(); }
|
||||
}
|
||||
Rectangle { height: 19px; }
|
||||
Text { text: "Наушники или колонки"; color: Theme.text-primary; font-size: Math.max(Theme.font-size - 2px, 11px); }
|
||||
Text { text: @tr("Headphones or speakers"); color: Theme.text-primary; font-size: Math.max(Theme.font-size - 2px, 11px); }
|
||||
Rectangle { height: 9px; }
|
||||
DeviceSelect {
|
||||
model: root.output-devices;
|
||||
|
|
@ -36,36 +36,36 @@ export component AudioSettings inherits Rectangle {
|
|||
Rectangle { height: 26px; }
|
||||
HorizontalLayout {
|
||||
spacing: 20px;
|
||||
Text { text: "Громкость"; color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: @tr("Volume"); color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: Math.round(root.volume) + "%"; color: Theme.text-secondary; font-size: Math.max(Theme.font-size - 2px, 11px); horizontal-alignment: right; }
|
||||
}
|
||||
Text { text: "Общий уровень воспроизведения голосовых комнат."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Playback volume for voice rooms."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 10px; }
|
||||
AudioSlider { minimum: 0; maximum: 100; value <=> root.volume; changed(value) => { root.audio-changed(); } }
|
||||
Rectangle { height: 25px; }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 26px; }
|
||||
Text { text: "Передача голоса"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: "Определи, когда тебя слышат остальные."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Voice input"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("Choose when others can hear you."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 18px; }
|
||||
DeviceSelect {
|
||||
model: ["Нажми и говори", "Активация голосом", "Открытый микрофон"];
|
||||
model: [@tr("Push to talk"), @tr("Voice activation"), @tr("Open microphone")];
|
||||
current-index <=> root.vad-mode;
|
||||
selected(value) => { root.audio-changed(); }
|
||||
}
|
||||
Rectangle { height: 10px; }
|
||||
Text {
|
||||
text: root.vad-mode == 0 ? "Удерживай кнопку разговора в голосовой комнате. Отпусти — микрофон перестанет передавать звук." : root.vad-mode == 1 ? "Микрофон передаёт звук, когда обнаружен голос." : "Звук передаётся постоянно, пока микрофон включён.";
|
||||
text: root.vad-mode == 0 ? @tr("Hold the talk button in a voice room. Release it to stop transmitting.") : root.vad-mode == 1 ? @tr("Your microphone transmits when speech is detected.") : @tr("Audio transmits continuously while the microphone is enabled.");
|
||||
color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap;
|
||||
}
|
||||
Rectangle { height: 24px; }
|
||||
HorizontalLayout {
|
||||
Text { text: "Качество голоса"; color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: Math.round(root.voice-bitrate) + " кбит/с"; color: Theme.text-secondary; font-size: Math.max(Theme.font-size - 2px, 11px); horizontal-alignment: right; }
|
||||
Text { text: @tr("Voice quality"); color: Theme.text-primary; font-size: Theme.font-size - 1px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: @tr("{} kbps", Math.round(root.voice-bitrate)); color: Theme.text-secondary; font-size: Math.max(Theme.font-size - 2px, 11px); horizontal-alignment: right; }
|
||||
}
|
||||
Rectangle { height: 9px; }
|
||||
AudioSlider { minimum: 8; maximum: 128; value <=> root.voice-bitrate; changed(value) => { root.audio-changed(); } }
|
||||
Text { text: "Меньше трафика"; color: Theme.text-disabled; font-size: Math.max(Theme.font-size - 4px, 11px); }
|
||||
Text { text: @tr("Less bandwidth"); color: Theme.text-disabled; font-size: Math.max(Theme.font-size - 4px, 11px); }
|
||||
Rectangle { height: 26px; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,28 +30,28 @@ export component IdentitySettings inherits Rectangle {
|
|||
callback import-keyfile(string, string);
|
||||
VerticalLayout {
|
||||
spacing: 0; alignment: start;
|
||||
Text { text: "Фото профиля"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: "Выбери изображение и обрежь его под аватар."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Profile photo"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("Choose an image and crop it for your avatar."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 18px; }
|
||||
HorizontalLayout {
|
||||
spacing: 20px;
|
||||
AvatarView { width: 82px; height: 82px; source: root.own-avatar; has-source: root.has-avatar; initials: "Фото"; mask: Theme.bg-base; }
|
||||
AvatarView { width: 82px; height: 82px; source: root.own-avatar; has-source: root.has-avatar; initials: @tr("Photo"); mask: Theme.bg-base; }
|
||||
VerticalLayout {
|
||||
spacing: 9px; alignment: center;
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: root.has-avatar ? "Изменить фото" : "Выбрать фото"; clicked => { root.choose-avatar(); } }
|
||||
if root.has-avatar : ActionButton { text: "Удалить"; quiet: true; danger: true; clicked => { root.remove-avatar(); } }
|
||||
ActionButton { text: root.has-avatar ? @tr("Change photo") : @tr("Choose photo"); clicked => { root.choose-avatar(); } }
|
||||
if root.has-avatar : ActionButton { text: @tr("Delete"); quiet: true; danger: true; clicked => { root.remove-avatar(); } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
Text { text: "Пока хранится только на этом устройстве."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 4px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Currently stored only on this device."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 4px, 11px); wrap: word-wrap; }
|
||||
}
|
||||
}
|
||||
Rectangle { height: 26px; }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 24px; }
|
||||
Text { text: "Твой ключ"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: "Открытый ключ определяет твой профиль. Им можно поделиться; секретный ключ остаётся на устройстве."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Your key"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("Your public key identifies your profile. You can share it; your secret key stays on this device."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 16px; }
|
||||
ThemeEditor { text: root.identity-pubkey; read-only: true; height: 78px; }
|
||||
if root.avatar-error != "" : Text { text: root.avatar-error; color: Theme.danger; font-size: Math.max(11px, Theme.font-size - 3px); wrap: word-wrap; }
|
||||
|
|
@ -59,86 +59,86 @@ export component IdentitySettings inherits Rectangle {
|
|||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 24px; }
|
||||
HorizontalLayout {
|
||||
Text { text: "Защита на устройстве"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: root.vault-enabled ? "● Защищено паролем" : "Без пароля"; color: root.vault-enabled ? Theme.success : Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); vertical-alignment: center; }
|
||||
Text { text: @tr("Device security"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; horizontal-stretch: 1; }
|
||||
Text { text: root.vault-enabled ? @tr("● Passphrase protected") : @tr("No passphrase"); color: root.vault-enabled ? Theme.success : Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); vertical-alignment: center; }
|
||||
}
|
||||
Rectangle { height: 6px; }
|
||||
Text { text: root.vault-enabled ? "При запуске Vnox потребуется пароль для доступа к ключам." : "Добавь пароль, чтобы зашифровать сохранённый секретный ключ."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: root.vault-enabled ? @tr("Vnox will ask for your passphrase to unlock your keys on startup.") : @tr("Add a passphrase to encrypt your saved secret key."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 15px; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton {
|
||||
text: root.vault-enabled ? "Изменить пароль" : "Добавить пароль";
|
||||
text: root.vault-enabled ? @tr("Change passphrase") : @tr("Add passphrase");
|
||||
clicked => { root.passphrase-modal-open = !root.passphrase-modal-open; root.export-modal-open = false; root.import-modal-open = false; }
|
||||
}
|
||||
if root.vault-enabled : ActionButton { text: "Убрать пароль"; danger: true; quiet: true; clicked => { root.confirm-remove = true; } }
|
||||
if root.vault-enabled : ActionButton { text: @tr("Remove passphrase"); danger: true; quiet: true; clicked => { root.confirm-remove = true; } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
if root.confirm-remove : VerticalLayout {
|
||||
spacing: 10px; alignment: start;
|
||||
Text { text: "Ключ будет сохранён без шифрования. Убрать пароль?"; color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Your key will be stored without encryption. Remove the passphrase?"); color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Отмена"; quiet: true; clicked => { root.confirm-remove = false; } }
|
||||
ActionButton { text: "Убрать пароль"; danger: true; clicked => { root.remove-passphrase(); root.confirm-remove = false; } }
|
||||
ActionButton { text: @tr("Cancel"); quiet: true; clicked => { root.confirm-remove = false; } }
|
||||
ActionButton { text: @tr("Remove passphrase"); danger: true; clicked => { root.remove-passphrase(); root.confirm-remove = false; } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
if root.passphrase-modal-open : VerticalLayout {
|
||||
spacing: 10px; alignment: start;
|
||||
Rectangle { height: 8px; }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.passphrase-input; placeholder-text: "Новый пароль · минимум 8 символов"; }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.passphrase-confirm; placeholder-text: "Повтори пароль"; accepted => { root.set-passphrase(root.passphrase-input, root.passphrase-confirm); } }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.passphrase-input; placeholder-text: @tr("New passphrase · at least 8 characters"); }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.passphrase-confirm; placeholder-text: @tr("Repeat passphrase"); accepted => { root.set-passphrase(root.passphrase-input, root.passphrase-confirm); } }
|
||||
if root.passphrase-error != "" : Text { text: root.passphrase-error; color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Сохранить пароль"; active: true; clicked => { root.set-passphrase(root.passphrase-input, root.passphrase-confirm); } }
|
||||
ActionButton { text: "Свернуть"; quiet: true; clicked => { root.passphrase-modal-open = false; } }
|
||||
ActionButton { text: @tr("Save passphrase"); active: true; clicked => { root.set-passphrase(root.passphrase-input, root.passphrase-confirm); } }
|
||||
ActionButton { text: @tr("Collapse"); quiet: true; clicked => { root.passphrase-modal-open = false; } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
Rectangle { height: 28px; }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 24px; }
|
||||
Text { text: "Резервная копия"; color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: "Сохрани ключи в безопасном месте, чтобы восстановить профиль на другом устройстве."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Backup"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("Keep your keys in a safe place to restore your profile on another device."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Rectangle { height: 15px; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Экспортировать ключи"; clicked => { root.export-modal-open = !root.export-modal-open; root.passphrase-modal-open = false; root.import-modal-open = false; } }
|
||||
ActionButton { text: "Импортировать"; quiet: true; clicked => { root.import-modal-open = !root.import-modal-open; root.passphrase-modal-open = false; root.export-modal-open = false; } }
|
||||
ActionButton { text: @tr("Export keys"); clicked => { root.export-modal-open = !root.export-modal-open; root.passphrase-modal-open = false; root.import-modal-open = false; } }
|
||||
ActionButton { text: @tr("Import"); quiet: true; clicked => { root.import-modal-open = !root.import-modal-open; root.passphrase-modal-open = false; root.export-modal-open = false; } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
if root.export-modal-open : VerticalLayout {
|
||||
spacing: 10px; alignment: start;
|
||||
Rectangle { height: 8px; }
|
||||
Text { text: "Пароль резервной копии можно оставить пустым. Такая копия содержит секретный ключ без защиты."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.export-pass-input; placeholder-text: "Пароль копии · необязательно"; }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.export-pass-confirm; placeholder-text: "Повтори пароль копии"; }
|
||||
Text { text: @tr("The backup passphrase is optional. Without it, your backup contains an unprotected secret key."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.export-pass-input; placeholder-text: @tr("Backup passphrase · optional"); }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.export-pass-confirm; placeholder-text: @tr("Repeat backup passphrase"); }
|
||||
if root.export-error != "" : Text { text: root.export-error; color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Создать копию"; active: true; clicked => { root.export-keyfile(root.export-pass-input, root.export-pass-confirm); } }
|
||||
ActionButton { text: "Свернуть"; quiet: true; clicked => { root.export-modal-open = false; } }
|
||||
ActionButton { text: @tr("Create backup"); active: true; clicked => { root.export-keyfile(root.export-pass-input, root.export-pass-confirm); } }
|
||||
ActionButton { text: @tr("Collapse"); quiet: true; clicked => { root.export-modal-open = false; } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
if root.export-output != "" : VerticalLayout {
|
||||
spacing: 8px;
|
||||
Text { text: "Скопируй содержимое в файл и сохрани отдельно от устройства."; color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Copy this content into a file and keep it separately from this device."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
ThemeEditor { text: root.export-output; read-only: true; height: 180px; }
|
||||
}
|
||||
}
|
||||
if root.import-modal-open : VerticalLayout {
|
||||
spacing: 10px; alignment: start;
|
||||
Rectangle { height: 8px; }
|
||||
Text { text: "Импорт заменит сохранённый профиль. Сначала сделай резервную копию текущих ключей."; color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
Text { text: @tr("Importing replaces your saved profile. Back up your current keys first."); color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
ThemeEditor { text <=> root.import-keyfile-input; height: 150px; }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.import-pass-input; placeholder-text: "Пароль резервной копии, если он задан"; }
|
||||
ThemeInput { input-type: InputType.password; text <=> root.import-pass-input; placeholder-text: @tr("Backup passphrase, if set"); }
|
||||
if root.import-error != "" : Text { text: root.import-error; color: Theme.danger; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; }
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ActionButton { text: "Импортировать и заменить"; danger: true; clicked => { root.import-keyfile(root.import-keyfile-input, root.import-pass-input); } }
|
||||
ActionButton { text: "Свернуть"; quiet: true; clicked => { root.import-modal-open = false; } }
|
||||
ActionButton { text: @tr("Import and replace"); danger: true; clicked => { root.import-keyfile(root.import-keyfile-input, root.import-pass-input); } }
|
||||
ActionButton { text: @tr("Collapse"); quiet: true; clicked => { root.import-modal-open = false; } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export component Sidebar inherits Rectangle {
|
|||
background: Theme.bg-rail;
|
||||
VerticalLayout {
|
||||
padding: 9px; spacing: 11px;
|
||||
ActionButton { text: "Личные сообщения"; icon: "home"; height: 44px; text-size: 20px; active: root.show-dms; clicked => { root.show-friends(); } }
|
||||
ActionButton { text: @tr("Direct messages"); icon: "home"; height: 44px; text-size: 20px; active: root.show-dms; clicked => { root.show-friends(); } }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
ActionButton { text: "V"; height: 44px; text-size: 19px; active: !root.show-dms && root.active-guild-idx < 0; clicked => { root.guild-selected(-1); } }
|
||||
for guild[index] in root.guilds: ActionButton {
|
||||
|
|
@ -79,7 +79,7 @@ export component Sidebar inherits Rectangle {
|
|||
clicked => { root.guild-selected(index); }
|
||||
}
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
ActionButton { text: "Настройки"; icon: "settings"; quiet: true; text-size: 19px; clicked => { root.open-settings(); } }
|
||||
ActionButton { text: @tr("Settings"); icon: "settings"; quiet: true; text-size: 19px; clicked => { root.open-settings(); } }
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
|
|
@ -91,31 +91,31 @@ export component Sidebar inherits Rectangle {
|
|||
border-width: 1px; border-color: Theme.border;
|
||||
HorizontalLayout {
|
||||
padding-left: 17px; padding-right: 10px; spacing: 8px;
|
||||
Text { text: root.show-dms ? "Личные сообщения" : root.active-guild-idx >= 0 && root.active-guild-idx < root.guilds.length ? root.guilds[root.active-guild-idx].name : root.node-name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; overflow: elide; horizontal-stretch: 1; vertical-alignment: center; }
|
||||
ActionButton { text: "Отключиться"; icon: "power"; width: 30px; quiet: true; clicked => { root.disconnect(); } }
|
||||
Text { text: root.show-dms ? @tr("Direct messages") : root.active-guild-idx >= 0 && root.active-guild-idx < root.guilds.length ? root.guilds[root.active-guild-idx].name : root.node-name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; overflow: elide; horizontal-stretch: 1; vertical-alignment: center; }
|
||||
ActionButton { text: @tr("Disconnect"); icon: "power"; width: 30px; quiet: true; clicked => { root.disconnect(); } }
|
||||
}
|
||||
}
|
||||
Flickable {
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
padding: 10px; spacing: 3px;
|
||||
if root.show-dms : NavRow { label: "Друзья"; symbol: "@"; clicked => { root.show-friends(); } }
|
||||
if root.show-dms : Text { text: "Личные сообщения"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 32px; vertical-alignment: bottom; }
|
||||
if root.show-dms && root.dm-conversations.length == 0 : Text { text: "Открой профиль друга, чтобы написать ему."; wrap: word-wrap; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
if root.show-dms : NavRow { label: @tr("Friends"); symbol: "@"; clicked => { root.show-friends(); } }
|
||||
if root.show-dms : Text { text: @tr("Direct messages"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 32px; vertical-alignment: bottom; }
|
||||
if root.show-dms && root.dm-conversations.length == 0 : Text { text: @tr("Open a friend's profile to send a message."); wrap: word-wrap; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
for dm in root.dm-conversations: NavRow {
|
||||
visible: root.show-dms;
|
||||
label: dm.name; symbol: "@"; unread: dm.unread;
|
||||
selected: root.active-dm-id == dm.dm_id;
|
||||
clicked => { root.dm-selected(dm.dm_id); }
|
||||
}
|
||||
if !root.show-dms : Text { text: "Текстовые каналы"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 32px; vertical-alignment: bottom; }
|
||||
if !root.show-dms : Text { text: @tr("Text channels"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 32px; vertical-alignment: bottom; }
|
||||
for ch in root.channels: NavRow {
|
||||
visible: !root.show-dms && ch.kind != "voice";
|
||||
label: ch.name;
|
||||
selected: root.active-channel-id == ch.channel_id;
|
||||
clicked => { root.channel-selected(ch.channel_id); }
|
||||
}
|
||||
if !root.show-dms : Text { text: "Голосовые комнаты"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 40px; vertical-alignment: bottom; }
|
||||
if !root.show-dms : Text { text: @tr("Voice rooms"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 40px; vertical-alignment: bottom; }
|
||||
for ch in root.channels: NavRow {
|
||||
visible: !root.show-dms && ch.kind == "voice";
|
||||
label: ch.name; symbol: "◖";
|
||||
|
|
@ -132,12 +132,12 @@ export component Sidebar inherits Rectangle {
|
|||
border-width: 1px; border-color: Theme.border;
|
||||
VerticalLayout {
|
||||
padding: 10px; spacing: 5px;
|
||||
Text { text: "● Голос подключён"; color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; }
|
||||
Text { text: @tr("● Voice connected"); color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; }
|
||||
Text { text: root.voice-channel-name; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.6875); overflow: elide; }
|
||||
HorizontalLayout {
|
||||
spacing: 6px;
|
||||
ActionButton { text: "Открыть"; clicked => { root.show-voice(); } }
|
||||
ActionButton { text: "Выйти"; danger: true; clicked => { root.leave-voice(); } }
|
||||
ActionButton { text: @tr("Open"); clicked => { root.show-voice(); } }
|
||||
ActionButton { text: @tr("Leave"); danger: true; clicked => { root.leave-voice(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -152,9 +152,9 @@ export component Sidebar inherits Rectangle {
|
|||
Text { text: root.username; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; overflow: elide; }
|
||||
Text { text: root.user-status; color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.625); overflow: elide; }
|
||||
}
|
||||
ActionButton { text: root.mic-enabled ? "Выключить микрофон" : "Включить микрофон"; icon: "mic"; width: 30px; danger: !root.mic-enabled; quiet: true; clicked => { root.toggle-mic(); } }
|
||||
ActionButton { text: root.deafened ? "Включить звук" : "Выключить звук"; icon: "headphones"; width: 30px; danger: root.deafened; quiet: true; clicked => { root.toggle-deafen(); } }
|
||||
ActionButton { text: "Настройки"; icon: "settings"; width: 30px; quiet: true; clicked => { root.open-settings(); } }
|
||||
ActionButton { text: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); icon: "mic"; width: 30px; danger: !root.mic-enabled; quiet: true; clicked => { root.toggle-mic(); } }
|
||||
ActionButton { text: root.deafened ? @tr("Undeafen") : @tr("Deafen"); icon: "headphones"; width: 30px; danger: root.deafened; quiet: true; clicked => { root.toggle-deafen(); } }
|
||||
ActionButton { text: @tr("Settings"); icon: "settings"; width: 30px; quiet: true; clicked => { root.open-settings(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Theme, ActionButton } from "theme.slint";
|
|||
import { ThemeInput } from "controls.slint";
|
||||
|
||||
export component UnlockWindow inherits Window {
|
||||
title: "Vnox — разблокировка";
|
||||
title: @tr("Vnox — unlock");
|
||||
icon: @image-url("assets/vnox-mark.svg");
|
||||
preferred-width: 480px;
|
||||
preferred-height: 300px;
|
||||
|
|
@ -12,14 +12,14 @@ export component UnlockWindow inherits Window {
|
|||
|
||||
VerticalLayout {
|
||||
padding: 30px; spacing: 14px; alignment: start;
|
||||
Text { text: "Разблокировать профиль"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.375); font-weight: 600; }
|
||||
Text { text: "Ключи на этом устройстве защищены паролем."; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; }
|
||||
Text { text: @tr("Unlock profile"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.375); font-weight: 600; }
|
||||
Text { text: @tr("Your keys on this device are protected by a passphrase."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; }
|
||||
password := ThemeInput {
|
||||
input-type: InputType.password;
|
||||
placeholder-text: "Пароль профиля";
|
||||
placeholder-text: @tr("Profile passphrase");
|
||||
accepted => { root.unlock(self.text); }
|
||||
}
|
||||
if root.error != "" : Text { text: root.error; color: Theme.danger; font-size: Math.max(11px, Theme.font-size * 0.75); wrap: word-wrap; }
|
||||
ActionButton { text: "Разблокировать"; clicked => { root.unlock(password.text); } }
|
||||
ActionButton { text: @tr("Unlock"); clicked => { root.unlock(password.text); } }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ export component VoicePanel inherits Rectangle {
|
|||
in-out property <string> channel-name;
|
||||
in-out property <string> activity-banner;
|
||||
in-out property <bool> push-to-talk;
|
||||
callback preview-screen();
|
||||
callback ptt-held(bool);
|
||||
callback toggle-mic();
|
||||
callback toggle-deafen();
|
||||
|
|
@ -23,11 +24,12 @@ export component VoicePanel inherits Rectangle {
|
|||
Text { text: "◖"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 1.4375); width: 20px; vertical-alignment: center; }
|
||||
Text { text: root.channel-name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; vertical-alignment: center; }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: @tr("Screen preview"); clicked => { root.preview-screen(); } }
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
padding: 24px; spacing: 16px;
|
||||
Text { text: root.members.length + " участников"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); }
|
||||
Text { text: @tr("{n} participant" | "{n} participants" % root.members.length); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); }
|
||||
Flickable {
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
|
|
@ -46,20 +48,20 @@ export component VoicePanel inherits Rectangle {
|
|||
VerticalLayout {
|
||||
spacing: 5px;
|
||||
Text { text: member.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0625); }
|
||||
Text { text: member.speaking ? "Говорит" : "В голосовой комнате"; color: member.speaking ? Theme.success : Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
Text { text: member.speaking ? @tr("Speaking") : @tr("In voice"); color: member.speaking ? Theme.success : Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); }
|
||||
}
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
if root.members.length == 0 : Text { text: "Подключение к голосовой комнате…"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
if root.members.length == 0 : Text { text: @tr("Joining voice…"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
}
|
||||
}
|
||||
if root.push-to-talk : Rectangle {
|
||||
height: 46px; background: ptt-area.pressed ? Theme.voice-bg : Theme.bg-interactive;
|
||||
border-radius: 8px; border-width: ptt-focus.has-focus ? 1px : 0px; border-color: Theme.accent;
|
||||
accessible-role: button; accessible-label: "Удерживать для разговора";
|
||||
Text { text: ptt-area.pressed ? "Микрофон передаёт звук" : "Удерживай здесь, чтобы говорить"; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-alignment: center; vertical-alignment: center; }
|
||||
accessible-role: button; accessible-label: @tr("Push to talk");
|
||||
Text { text: ptt-area.pressed ? @tr("Microphone is transmitting") : @tr("Hold here to talk"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-alignment: center; vertical-alignment: center; }
|
||||
ptt-area := TouchArea {
|
||||
clicked => { ptt-focus.focus(); }
|
||||
changed pressed => { root.ptt-held(self.pressed); }
|
||||
|
|
@ -74,9 +76,9 @@ export component VoicePanel inherits Rectangle {
|
|||
HorizontalLayout {
|
||||
spacing: 10px;
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: root.mic-enabled ? "Выключить микрофон" : "Включить микрофон"; danger: !root.mic-enabled; clicked => { root.toggle-mic(); } }
|
||||
ActionButton { text: root.deafened ? "Включить звук" : "Выключить звук"; danger: root.deafened; clicked => { root.toggle-deafen(); } }
|
||||
ActionButton { text: "Покинуть комнату"; danger: true; clicked => { root.leave-voice(); } }
|
||||
ActionButton { text: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); danger: !root.mic-enabled; clicked => { root.toggle-mic(); } }
|
||||
ActionButton { text: root.deafened ? @tr("Undeafen") : @tr("Deafen"); danger: root.deafened; clicked => { root.toggle-deafen(); } }
|
||||
ActionButton { text: @tr("Leave room"); danger: true; clicked => { root.leave-voice(); } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue