feat(client): polish connect, settings, chat, voice and friends UI; finish forums UI
All checks were successful
ci / check (push) Successful in 6m19s
All checks were successful
ci / check (push) Successful in 6m19s
- connect: remove the empty account plate overlay, align header controls, make Connect the primary action - settings: centered wider column, narrower nav, themed scrollbar, empty device lists state - chat/sidebar: neutral borders, stronger separators and avatars, channel welcome state, consistent icon sizes - voice: adaptive participant grid, single control dock - friends: per-tab empty states, ID hints; wire online count - forum: compact topic rows, grammatical reply count, bounded editors; add headless snapshots - i18n: translate image/forum errors at display time, server texts via catalogue, re-render image status on language switch
This commit is contained in:
parent
66e0b2726c
commit
ed065de4aa
24 changed files with 891 additions and 224 deletions
4
TODO.md
4
TODO.md
|
|
@ -15,11 +15,11 @@
|
|||
история и ответы; capability старого gateway, права узла/сообщества и лимиты.
|
||||
- [x] Добавить сетевые команды/события и состояние форума с защитой от устаревших
|
||||
ответов после смены сервера/канала и понятными состояниями загрузки/ошибки.
|
||||
- [ ] Показывать настоящий список тем, создание темы с первым сообщением,
|
||||
- [x] Показывать настоящий список тем, создание темы с первым сообщением,
|
||||
открытие истории и ответы, подтверждённые gateway; не подменять форум плоским чатом.
|
||||
- [x] Сохранить безопасное поведение аудио: форум и категория никогда не
|
||||
инициируют voice join или захват микрофона; старый gateway не получает новые пакеты.
|
||||
- [ ] Проверить wire/state регрессии, отсутствие ложного успеха при отказе,
|
||||
- [x] Проверить wire/state регрессии, отсутствие ложного успеха при отказе,
|
||||
контекст узла/сообщества и headless UI только в виртуальном display/профиле.
|
||||
|
||||
### Дополнение: профили, присутствие, темы и виртуальная QA
|
||||
|
|
|
|||
|
|
@ -374,6 +374,8 @@ fn sync_friends(window: &MainWindow, state: &UiState) {
|
|||
),
|
||||
})
|
||||
.collect();
|
||||
let online_count = friends.iter().filter(|f| f.status != "offline").count();
|
||||
window.set_friends_online_count(i32::try_from(online_count).unwrap_or(i32::MAX));
|
||||
replace_model(window.get_friends(), friends, |model| {
|
||||
window.set_friends(model)
|
||||
});
|
||||
|
|
|
|||
|
|
@ -15,6 +15,101 @@ const MAX_PIXELS: u64 = 4 * 1024 * 1024;
|
|||
const MAX_SIDE: u32 = 4096;
|
||||
const MAX_FRAMES: usize = 120;
|
||||
|
||||
const IMAGE_DIMENSIONS: &str = "Image dimensions exceed the 4096 px / 4 megapixel limit";
|
||||
const IMAGE_TOO_LARGE_ENCODED: &str = "Image must be no larger than 16 MiB";
|
||||
const UNSUPPORTED_IMAGE: &str = "Unsupported image";
|
||||
const USE_SUPPORTED_FORMAT: &str = "Use PNG, JPEG, WebP or GIF";
|
||||
const INVALID_IMAGE_HEADER: &str = "Invalid image header";
|
||||
const GIF_LIMIT: &str =
|
||||
"GIF exceeds the animation limit (120 frames / 64 MiB preview / 128 megapixels decoded)";
|
||||
const INVALID_GIF_FRAME: &str = "Invalid GIF frame";
|
||||
const GIF_NO_FRAMES: &str = "GIF has no frames";
|
||||
const INVALID_IMAGE_DATA: &str = "Invalid image data";
|
||||
const ONLY_PUBLIC_HTTPS: &str = "Only public HTTPS image URLs on port 443 are allowed";
|
||||
const PRIVATE_ADDRESS_BLOCKED: &str = "Private or reserved image address is blocked";
|
||||
const DOWNLOAD_TIMED_OUT: &str = "Image download timed out";
|
||||
const INVALID_IMAGE_URL: &str = "Invalid image URL";
|
||||
const URL_NO_HOSTNAME: &str = "Image URL has no hostname";
|
||||
const DNS_TIMED_OUT: &str = "Image DNS lookup timed out";
|
||||
const TOO_MANY_REDIRECTS: &str = "Too many image redirects";
|
||||
const REDIRECT_NO_LOCATION: &str = "Image redirect has no location";
|
||||
const INVALID_REDIRECT: &str = "Invalid image redirect";
|
||||
const IMAGE_EXCEEDS_LIMIT: &str = "Image exceeds 16 MiB";
|
||||
const RESPONSE_EMPTY: &str = "Image response is empty";
|
||||
const CANNOT_OPEN_CLIPBOARD: &str = "Cannot open clipboard";
|
||||
const CLIPBOARD_NO_IMAGE: &str = "Clipboard has no image";
|
||||
const INVALID_CLIPBOARD_DATA: &str = "Invalid clipboard image data";
|
||||
const CLIPBOARD_TOO_LARGE: &str = "Clipboard image exceeds 3 MiB; choose a smaller image";
|
||||
|
||||
/// Every static failure above, so a failure can be rendered in the active language.
|
||||
const PROCESSING_FAILED: &str = "Could not process the image: {detail}";
|
||||
const KNOWN_ERRORS: &[&str] = &[
|
||||
IMAGE_DIMENSIONS,
|
||||
IMAGE_TOO_LARGE_ENCODED,
|
||||
UNSUPPORTED_IMAGE,
|
||||
USE_SUPPORTED_FORMAT,
|
||||
INVALID_IMAGE_HEADER,
|
||||
GIF_LIMIT,
|
||||
INVALID_GIF_FRAME,
|
||||
GIF_NO_FRAMES,
|
||||
INVALID_IMAGE_DATA,
|
||||
ONLY_PUBLIC_HTTPS,
|
||||
PRIVATE_ADDRESS_BLOCKED,
|
||||
DOWNLOAD_TIMED_OUT,
|
||||
INVALID_IMAGE_URL,
|
||||
URL_NO_HOSTNAME,
|
||||
DNS_TIMED_OUT,
|
||||
TOO_MANY_REDIRECTS,
|
||||
REDIRECT_NO_LOCATION,
|
||||
INVALID_REDIRECT,
|
||||
IMAGE_EXCEEDS_LIMIT,
|
||||
RESPONSE_EMPTY,
|
||||
CANNOT_OPEN_CLIPBOARD,
|
||||
CLIPBOARD_NO_IMAGE,
|
||||
INVALID_CLIPBOARD_DATA,
|
||||
CLIPBOARD_TOO_LARGE,
|
||||
];
|
||||
|
||||
/// Source message for a non-success image HTTP status.
|
||||
pub const SERVER_RETURNED: &str = "Image server returned {status}";
|
||||
|
||||
/// Non-success HTTP status; kept typed so its message can be translated at display time.
|
||||
#[derive(Debug)]
|
||||
struct ServerStatus(String);
|
||||
impl std::fmt::Display for ServerStatus {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str(&super::i18n::format_in(
|
||||
super::i18n::Language::English,
|
||||
SERVER_RETURNED,
|
||||
&[("status", self.0.clone())],
|
||||
))
|
||||
}
|
||||
}
|
||||
impl std::error::Error for ServerStatus {}
|
||||
|
||||
/// Map a failure to its semantic message; unknown (library) errors stay raw.
|
||||
pub fn describe(error: &anyhow::Error) -> super::i18n::Message {
|
||||
use super::i18n::Message;
|
||||
if let Some(status) = error.downcast_ref::<ServerStatus>() {
|
||||
return Message::with(SERVER_RETURNED, vec![("status", status.0.clone())]);
|
||||
}
|
||||
let text = error.to_string();
|
||||
match KNOWN_ERRORS.iter().find(|known| **known == text) {
|
||||
Some(known) => Message::from(*known),
|
||||
// Library errors have no source string: the frame is translated, the detail stays as is.
|
||||
None => Message::with(PROCESSING_FAILED, vec![("detail", text)]),
|
||||
}
|
||||
}
|
||||
|
||||
/// Every source string this module can produce, for catalogue tests.
|
||||
#[cfg(test)]
|
||||
pub fn catalogue_sources() -> Vec<&'static str> {
|
||||
let mut all = KNOWN_ERRORS.to_vec();
|
||||
all.push(SERVER_RETURNED);
|
||||
all.push(PROCESSING_FAILED);
|
||||
all
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ImageFrame {
|
||||
pub rgba: Vec<u8>,
|
||||
|
|
@ -35,7 +130,7 @@ fn dimensions(width: u32, height: u32) -> Result<()> {
|
|||
&& width <= MAX_SIDE
|
||||
&& height <= MAX_SIDE
|
||||
&& u64::from(width) * u64::from(height) <= MAX_PIXELS,
|
||||
"Image dimensions exceed the 4096 px / 4 megapixel limit"
|
||||
IMAGE_DIMENSIONS
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -52,19 +147,19 @@ fn limits() -> image::Limits {
|
|||
pub fn decode(bytes: &[u8]) -> Result<DecodedImage> {
|
||||
ensure!(
|
||||
!bytes.is_empty() && bytes.len() <= MAX_REMOTE_ENCODED_BYTES,
|
||||
"Image must be no larger than 16 MiB"
|
||||
IMAGE_TOO_LARGE_ENCODED
|
||||
);
|
||||
let format = image::guess_format(bytes).context("Unsupported image")?;
|
||||
let format = image::guess_format(bytes).context(UNSUPPORTED_IMAGE)?;
|
||||
ensure!(
|
||||
matches!(
|
||||
format,
|
||||
ImageFormat::Png | ImageFormat::Jpeg | ImageFormat::WebP | ImageFormat::Gif
|
||||
),
|
||||
"Use PNG, JPEG, WebP or GIF"
|
||||
USE_SUPPORTED_FORMAT
|
||||
);
|
||||
let (mut width, mut height) = image::ImageReader::with_format(Cursor::new(bytes), format)
|
||||
.into_dimensions()
|
||||
.context("Invalid image header")?;
|
||||
.context(INVALID_IMAGE_HEADER)?;
|
||||
dimensions(width, height)?;
|
||||
let mut frames = Vec::new();
|
||||
if format == ImageFormat::Gif {
|
||||
|
|
@ -82,9 +177,9 @@ pub fn decode(bytes: &[u8]) -> Result<DecodedImage> {
|
|||
frames.len() < MAX_FRAMES
|
||||
&& (frames.len() + 1) * frame_bytes <= MAX_RGBA_BYTES
|
||||
&& (frames.len() as u64 + 1) * source_pixels <= MAX_SOURCE_PIXELS,
|
||||
"GIF exceeds the animation limit (120 frames / 64 MiB preview / 128 megapixels decoded)"
|
||||
GIF_LIMIT
|
||||
);
|
||||
let frame = frame.context("Invalid GIF frame")?;
|
||||
let frame = frame.context(INVALID_GIF_FRAME)?;
|
||||
let (numerator, denominator) = frame.delay().numer_denom_ms();
|
||||
let delay_ms = (numerator / denominator.max(1)).clamp(20, 10_000);
|
||||
let original = frame.into_buffer();
|
||||
|
|
@ -103,11 +198,11 @@ pub fn decode(bytes: &[u8]) -> Result<DecodedImage> {
|
|||
delay_ms,
|
||||
});
|
||||
}
|
||||
ensure!(!frames.is_empty(), "GIF has no frames");
|
||||
ensure!(!frames.is_empty(), GIF_NO_FRAMES);
|
||||
} else {
|
||||
let mut reader = image::ImageReader::with_format(Cursor::new(bytes), format);
|
||||
reader.limits(limits());
|
||||
let image = reader.decode().context("Invalid image data")?.into_rgba8();
|
||||
let image = reader.decode().context(INVALID_IMAGE_DATA)?.into_rgba8();
|
||||
frames.push(ImageFrame {
|
||||
rgba: image.into_raw(),
|
||||
delay_ms: 100,
|
||||
|
|
@ -146,7 +241,7 @@ fn validate_url(url: &reqwest::Url) -> Result<()> {
|
|||
&& url.port_or_known_default() == Some(443)
|
||||
&& url.username().is_empty()
|
||||
&& url.password().is_none(),
|
||||
"Only public HTTPS image URLs on port 443 are allowed"
|
||||
ONLY_PUBLIC_HTTPS
|
||||
);
|
||||
if let Ok(address) = url
|
||||
.host_str()
|
||||
|
|
@ -154,10 +249,7 @@ fn validate_url(url: &reqwest::Url) -> Result<()> {
|
|||
.trim_matches(['[', ']'])
|
||||
.parse::<IpAddr>()
|
||||
{
|
||||
ensure!(
|
||||
public_ip(address),
|
||||
"Private or reserved image address is blocked"
|
||||
);
|
||||
ensure!(public_ip(address), PRIVATE_ADDRESS_BLOCKED);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -194,27 +286,27 @@ fn public_ip(address: IpAddr) -> bool {
|
|||
pub async fn fetch(url: &str) -> Result<Vec<u8>> {
|
||||
tokio::time::timeout(Duration::from_secs(30), fetch_inner(url))
|
||||
.await
|
||||
.context("Image download timed out")?
|
||||
.context(DOWNLOAD_TIMED_OUT)?
|
||||
}
|
||||
|
||||
async fn fetch_inner(url: &str) -> Result<Vec<u8>> {
|
||||
let mut url = reqwest::Url::parse(url).context("Invalid image URL")?;
|
||||
let mut url = reqwest::Url::parse(url).context(INVALID_IMAGE_URL)?;
|
||||
for redirect in 0..=3 {
|
||||
validate_url(&url)?;
|
||||
let host = url
|
||||
.host_str()
|
||||
.context("Image URL has no hostname")?
|
||||
.context(URL_NO_HOSTNAME)?
|
||||
.trim_matches(['[', ']']);
|
||||
let addresses: Vec<_> =
|
||||
tokio::time::timeout(Duration::from_secs(5), tokio::net::lookup_host((host, 443)))
|
||||
.await
|
||||
.context("Image DNS lookup timed out")??
|
||||
.context(DNS_TIMED_OUT)??
|
||||
.collect();
|
||||
ensure!(
|
||||
!addresses.is_empty()
|
||||
&& addresses.len() <= 32
|
||||
&& addresses.iter().all(|a| public_ip(a.ip())),
|
||||
"Private or reserved image address is blocked"
|
||||
PRIVATE_ADDRESS_BLOCKED
|
||||
);
|
||||
let client = reqwest::Client::builder()
|
||||
.no_proxy()
|
||||
|
|
@ -232,45 +324,44 @@ async fn fetch_inner(url: &str) -> Result<Vec<u8>> {
|
|||
.send()
|
||||
.await?;
|
||||
if response.status().is_redirection() {
|
||||
ensure!(redirect < 3, "Too many image redirects");
|
||||
ensure!(redirect < 3, TOO_MANY_REDIRECTS);
|
||||
let location = response
|
||||
.headers()
|
||||
.get(reqwest::header::LOCATION)
|
||||
.context("Image redirect has no location")?
|
||||
.context(REDIRECT_NO_LOCATION)?
|
||||
.to_str()?;
|
||||
url = url.join(location).context("Invalid image redirect")?;
|
||||
url = url.join(location).context(INVALID_REDIRECT)?;
|
||||
continue;
|
||||
}
|
||||
ensure!(
|
||||
response.status().is_success(),
|
||||
"Image server returned {}",
|
||||
response.status()
|
||||
ServerStatus(response.status().to_string())
|
||||
);
|
||||
ensure!(
|
||||
response
|
||||
.content_length()
|
||||
.is_none_or(|length| length <= MAX_REMOTE_ENCODED_BYTES as u64),
|
||||
"Image exceeds 16 MiB"
|
||||
IMAGE_EXCEEDS_LIMIT
|
||||
);
|
||||
let mut bytes = Vec::new();
|
||||
while let Some(chunk) = response.chunk().await? {
|
||||
ensure!(
|
||||
bytes.len().saturating_add(chunk.len()) <= MAX_REMOTE_ENCODED_BYTES,
|
||||
"Image exceeds 16 MiB"
|
||||
IMAGE_EXCEEDS_LIMIT
|
||||
);
|
||||
bytes.extend_from_slice(&chunk);
|
||||
}
|
||||
ensure!(!bytes.is_empty(), "Image response is empty");
|
||||
ensure!(!bytes.is_empty(), RESPONSE_EMPTY);
|
||||
return Ok(bytes);
|
||||
}
|
||||
bail!("Too many image redirects")
|
||||
bail!(TOO_MANY_REDIRECTS)
|
||||
}
|
||||
|
||||
/// Read an explicitly requested native clipboard image. This can block on the
|
||||
/// clipboard owner; prefer a worker even when PNG encoding is split off.
|
||||
pub fn clipboard_image() -> Result<arboard::ImageData<'static>> {
|
||||
let mut clipboard = arboard::Clipboard::new().context("Cannot open clipboard")?;
|
||||
let image = clipboard.get_image().context("Clipboard has no image")?;
|
||||
let mut clipboard = arboard::Clipboard::new().context(CANNOT_OPEN_CLIPBOARD)?;
|
||||
let image = clipboard.get_image().context(CLIPBOARD_NO_IMAGE)?;
|
||||
// Validation belongs to the preview worker so image errors are shown instead of
|
||||
// falling through to ordinary text paste.
|
||||
Ok(image)
|
||||
|
|
@ -283,7 +374,7 @@ pub fn encode_clipboard_png(image: arboard::ImageData<'_>) -> Result<Vec<u8>> {
|
|||
dimensions(width, height)?;
|
||||
ensure!(
|
||||
image.bytes.len() == width as usize * height as usize * 4,
|
||||
"Invalid clipboard image data"
|
||||
INVALID_CLIPBOARD_DATA
|
||||
);
|
||||
let mut bytes = Vec::new();
|
||||
image::codecs::png::PngEncoder::new(&mut bytes).write_image(
|
||||
|
|
@ -292,10 +383,7 @@ pub fn encode_clipboard_png(image: arboard::ImageData<'_>) -> Result<Vec<u8>> {
|
|||
height,
|
||||
image::ExtendedColorType::Rgba8,
|
||||
)?;
|
||||
ensure!(
|
||||
bytes.len() <= MAX_ENCODED_BYTES,
|
||||
"Clipboard image exceeds 3 MiB; choose a smaller image"
|
||||
);
|
||||
ensure!(bytes.len() <= MAX_ENCODED_BYTES, CLIPBOARD_TOO_LARGE);
|
||||
Ok(bytes)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
//! Native chat image presentation. Network/decode work runs away from the event loop.
|
||||
use super::{chat_images, slint::MainWindow};
|
||||
use super::{
|
||||
chat_images,
|
||||
i18n::{self, Message},
|
||||
slint::MainWindow,
|
||||
};
|
||||
use slint::{ComponentHandle, Model, SharedPixelBuffer};
|
||||
use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::mpsc, time::Instant};
|
||||
use vnox_client::net::NetCommand;
|
||||
|
|
@ -45,14 +49,56 @@ impl Animation {
|
|||
self.frames[0].0.clone()
|
||||
}
|
||||
}
|
||||
/// English source of the in-flight sentinel; compared on the source, translated only for display.
|
||||
const LOADING_IMAGE: &str = "Loading image…";
|
||||
const DECODING_IMAGE: &str = "Decoding image…";
|
||||
const PREVIEW_CACHE_FULL: &str = "Preview cache is full. Open another channel to release images.";
|
||||
const IMAGE_UNAVAILABLE: &str = "Image unavailable: {error}";
|
||||
const IMAGE_TIMED_OUT: &str = "Image request timed out";
|
||||
const IMAGE_QUEUE_FULL: &str = "Image queue is full";
|
||||
const CANNOT_PASTE: &str = "Cannot paste image: {error}";
|
||||
const WAIT_FOR_OPERATION: &str = "Wait for the current image operation to finish.";
|
||||
const ATTACHMENTS_IN_CHANNELS: &str =
|
||||
"Image attachments are available in channels. You can send an HTTPS image link here.";
|
||||
const PREPARING_IMAGE: &str = "Preparing image…";
|
||||
const SELECT_ORIGINAL_CHANNEL: &str =
|
||||
"Select the original channel and connect before sending this image.";
|
||||
const SENDING_IMAGE: &str = "Sending image…";
|
||||
const IMAGE_READY: &str = "Image ready. Send it to this channel or cancel.";
|
||||
const DELIVERY_UNCONFIRMED: &str =
|
||||
"Image delivery could not be confirmed. Check the channel before retrying.";
|
||||
|
||||
struct Entry {
|
||||
image: Option<Animation>,
|
||||
error: String,
|
||||
/// Semantic status; `LOADING_IMAGE` is the in-flight sentinel.
|
||||
error: Message,
|
||||
/// Failure reason shown inside `error` when it is parametrised.
|
||||
cause: Option<Message>,
|
||||
started: Instant,
|
||||
}
|
||||
impl Entry {
|
||||
fn new(error: impl Into<Message>) -> Self {
|
||||
Self {
|
||||
image: None,
|
||||
error: error.into(),
|
||||
cause: None,
|
||||
started: Instant::now(),
|
||||
}
|
||||
}
|
||||
fn loading(&self) -> bool {
|
||||
matches!(&self.error, Message::App(source, _) if *source == LOADING_IMAGE)
|
||||
}
|
||||
/// Render in the active language; the cause is translated separately, never re-parsed.
|
||||
fn status(&self) -> String {
|
||||
match &self.cause {
|
||||
Some(cause) => i18n::format(IMAGE_UNAVAILABLE, &[("error", cause.to_string())]),
|
||||
None => self.error.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
struct Ready {
|
||||
key: String,
|
||||
result: Result<chat_images::DecodedImage, String>,
|
||||
result: Result<chat_images::DecodedImage, Message>,
|
||||
clipboard: Option<Vec<u8>>,
|
||||
}
|
||||
struct Pending {
|
||||
|
|
@ -86,23 +132,86 @@ impl Default for Media {
|
|||
}
|
||||
}
|
||||
}
|
||||
thread_local! { static STATUS: RefCell<Message> = const { RefCell::new(Message::Raw(String::new())) }; }
|
||||
|
||||
/// Shows an image status and remembers its semantic message so a language switch can re-render it.
|
||||
fn show_status(window: &MainWindow, message: Message) {
|
||||
window.set_image_status(message.to_string().into());
|
||||
STATUS.with(|status| *status.borrow_mut() = message);
|
||||
}
|
||||
|
||||
/// Re-renders the current image status in the active language.
|
||||
pub fn refresh_language(window: &MainWindow) {
|
||||
let text = STATUS.with(|status| status.borrow().to_string());
|
||||
window.set_image_status(text.into());
|
||||
}
|
||||
|
||||
thread_local! { static MEDIA: RefCell<Media> = RefCell::new(Media::default()); }
|
||||
|
||||
pub fn wire(window: &MainWindow, state: &Rc<RefCell<crate::AppState>>) {
|
||||
let weak = window.as_weak();
|
||||
let paste_state = state.clone();
|
||||
window.on_paste_image(move || {
|
||||
let Some(win)=weak.upgrade() else { return false };
|
||||
let Some(win) = weak.upgrade() else {
|
||||
return false;
|
||||
};
|
||||
let s = paste_state.borrow();
|
||||
// A failed image lookup must leave normal text paste to TextInput.
|
||||
let Ok(clipboard)=chat_images::clipboard_image() else { return false };
|
||||
if MEDIA.with(|m| {let m=m.borrow();m.workers+m.cache.iter().filter(|(key,entry)|key.starts_with("attachment:") && entry.error=="Loading image…").count()>=3 || m.pending.as_ref().is_some_and(|p|p.request.is_some())}) {win.set_image_status("Wait for the current image operation to finish.".into());return true;}
|
||||
if s.ui.active_dm_id.is_some() || s.ui.active_channel.is_none() { win.set_image_status("Image attachments are available in channels. You can send an HTTPS image link here.".into()); return true; }
|
||||
let channel=s.ui.active_channel.clone().unwrap_or_default(); let generation=s.connection_generation;
|
||||
MEDIA.with(|m| { let mut m=m.borrow_mut(); if m.pending.as_ref().is_some_and(|p|p.request.is_some()) {return} let tx=m.tx.clone(); m.workers+=1;let clipboard_key=format!("clipboard:{generation}:{channel}:{}",uuid::Uuid::new_v4());m.clipboard_key=Some(clipboard_key.clone());
|
||||
tokio::task::spawn_blocking(move || { let result=chat_images::encode_clipboard_png(clipboard).and_then(|bytes|chat_images::decode(&bytes).map(|image|(bytes,image))); match result {Ok((bytes,image))=>{let _=tx.send(Ready {key:clipboard_key,result:Ok(image),clipboard:Some(bytes)});},Err(error)=>{let _=tx.send(Ready {key:clipboard_key,result:Err(error.to_string()),clipboard:Some(Vec::new())});}} });
|
||||
let Ok(clipboard) = chat_images::clipboard_image() else {
|
||||
return false;
|
||||
};
|
||||
if MEDIA.with(|m| {
|
||||
let m = m.borrow();
|
||||
m.workers
|
||||
+ m.cache
|
||||
.iter()
|
||||
.filter(|(key, entry)| key.starts_with("attachment:") && entry.loading())
|
||||
.count()
|
||||
>= 3
|
||||
|| m.pending.as_ref().is_some_and(|p| p.request.is_some())
|
||||
}) {
|
||||
show_status(&win, Message::from(WAIT_FOR_OPERATION));
|
||||
return true;
|
||||
}
|
||||
if s.ui.active_dm_id.is_some() || s.ui.active_channel.is_none() {
|
||||
show_status(&win, Message::from(ATTACHMENTS_IN_CHANNELS));
|
||||
return true;
|
||||
}
|
||||
let channel = s.ui.active_channel.clone().unwrap_or_default();
|
||||
let generation = s.connection_generation;
|
||||
MEDIA.with(|m| {
|
||||
let mut m = m.borrow_mut();
|
||||
if m.pending.as_ref().is_some_and(|p| p.request.is_some()) {
|
||||
return;
|
||||
}
|
||||
let tx = m.tx.clone();
|
||||
m.workers += 1;
|
||||
let clipboard_key =
|
||||
format!("clipboard:{generation}:{channel}:{}", uuid::Uuid::new_v4());
|
||||
m.clipboard_key = Some(clipboard_key.clone());
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let result = chat_images::encode_clipboard_png(clipboard)
|
||||
.and_then(|bytes| chat_images::decode(&bytes).map(|image| (bytes, image)));
|
||||
match result {
|
||||
Ok((bytes, image)) => {
|
||||
let _ = tx.send(Ready {
|
||||
key: clipboard_key,
|
||||
result: Ok(image),
|
||||
clipboard: Some(bytes),
|
||||
});
|
||||
win.set_image_status("Preparing image…".into()); true
|
||||
}
|
||||
Err(error) => {
|
||||
let _ = tx.send(Ready {
|
||||
key: clipboard_key,
|
||||
result: Err(chat_images::describe(&error)),
|
||||
clipboard: Some(Vec::new()),
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
show_status(&win, Message::from(PREPARING_IMAGE));
|
||||
true
|
||||
});
|
||||
let weak = window.as_weak();
|
||||
window.on_cancel_image(move || {
|
||||
|
|
@ -120,7 +229,7 @@ pub fn wire(window: &MainWindow, state: &Rc<RefCell<crate::AppState>>) {
|
|||
}
|
||||
if let Some(w) = weak.upgrade() {
|
||||
w.set_has_pending_image(false);
|
||||
w.set_image_status("".into());
|
||||
show_status(&w, Message::Raw(String::new()));
|
||||
}
|
||||
});
|
||||
let state = state.clone();
|
||||
|
|
@ -140,9 +249,7 @@ pub fn wire(window: &MainWindow, state: &Rc<RefCell<crate::AppState>>) {
|
|||
|| !matches!(s.ui.conn, super::state::ConnState::Connected { .. })
|
||||
{
|
||||
if let Some(w) = weak.upgrade() {
|
||||
w.set_image_status(
|
||||
"Select the original channel and connect before sending this image.".into(),
|
||||
);
|
||||
show_status(&w, Message::from(SELECT_ORIGINAL_CHANNEL));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -161,7 +268,7 @@ pub fn wire(window: &MainWindow, state: &Rc<RefCell<crate::AppState>>) {
|
|||
});
|
||||
if let Some(w) = weak.upgrade() {
|
||||
w.set_image_uploading(true);
|
||||
w.set_image_status("Sending image…".into());
|
||||
show_status(&w, Message::from(SENDING_IMAGE));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -181,11 +288,8 @@ pub fn receive(result: vnox_client::net::wire::AttachmentResult) {
|
|||
// Display delivery state on the next UI tick.
|
||||
let _ = m.tx.send(Ready {
|
||||
key: "upload-status".into(),
|
||||
result: Err(if result.error.is_empty() {
|
||||
String::new()
|
||||
} else {
|
||||
result.error
|
||||
}),
|
||||
// Server-provided text is shown as received.
|
||||
result: Err(Message::Server(result.error)),
|
||||
clipboard: None,
|
||||
});
|
||||
return;
|
||||
|
|
@ -195,28 +299,23 @@ pub fn receive(result: vnox_client::net::wire::AttachmentResult) {
|
|||
"attachment:{}:{}:{}",
|
||||
m.generation, result.channel_id, result.attachment_id
|
||||
);
|
||||
if key != expected
|
||||
|| !m
|
||||
.cache
|
||||
.get(&key)
|
||||
.is_some_and(|entry| entry.error == "Loading image…")
|
||||
{
|
||||
if key != expected || !m.cache.get(&key).is_some_and(Entry::loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
if !result.error.is_empty() {
|
||||
if let Some(e) = m.cache.get_mut(&key) {
|
||||
e.error = result.error;
|
||||
e.error = Message::Server(result.error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if let Some(entry) = m.cache.get_mut(&key) {
|
||||
entry.error = "Decoding image…".into();
|
||||
entry.error = Message::from(DECODING_IMAGE);
|
||||
}
|
||||
let tx = m.tx.clone();
|
||||
m.workers += 1;
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let decoded = chat_images::decode(&result.data).map_err(|e| e.to_string());
|
||||
let decoded = chat_images::decode(&result.data).map_err(|e| chat_images::describe(&e));
|
||||
let _ = tx.send(Ready {
|
||||
key,
|
||||
result: decoded,
|
||||
|
|
@ -236,7 +335,7 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
m.generation = state.connection_generation;
|
||||
window.set_has_pending_image(false);
|
||||
window.set_image_uploading(false);
|
||||
window.set_image_status("".into());
|
||||
show_status(window, Message::Raw(String::new()));
|
||||
}
|
||||
let visible_model = if window.get_show_forum() {
|
||||
window.get_forum_replies()
|
||||
|
|
@ -251,7 +350,10 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
while let Ok(ready) = m.rx.try_recv() {
|
||||
if ready.key == "upload-status" {
|
||||
window.set_image_uploading(false);
|
||||
window.set_image_status(ready.result.err().unwrap_or_default().into());
|
||||
show_status(
|
||||
window,
|
||||
ready.result.err().unwrap_or(Message::Raw(String::new())),
|
||||
);
|
||||
window.set_has_pending_image(m.pending.is_some());
|
||||
continue;
|
||||
}
|
||||
|
|
@ -274,9 +376,7 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
let image = Animation::new(image);
|
||||
window.set_pending_image(image.frame());
|
||||
window.set_has_pending_image(true);
|
||||
window.set_image_status(
|
||||
"Image ready. Send it to this channel or cancel.".into(),
|
||||
);
|
||||
show_status(window, Message::from(IMAGE_READY));
|
||||
m.pending = Some(Pending {
|
||||
bytes,
|
||||
image,
|
||||
|
|
@ -286,7 +386,10 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
started: Instant::now(),
|
||||
});
|
||||
}
|
||||
Err(e) => window.set_image_status(format!("Cannot paste image: {e}").into()),
|
||||
Err(e) => show_status(
|
||||
window,
|
||||
Message::with(CANNOT_PASTE, vec![("error", e.to_string())]),
|
||||
),
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
@ -303,23 +406,15 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
.map(|a| a.bytes)
|
||||
.sum();
|
||||
if total + image.bytes > 64 * 1024 * 1024 {
|
||||
m.cache.insert(
|
||||
ready.key,
|
||||
Entry {
|
||||
image: None,
|
||||
error:
|
||||
"Preview cache is full. Open another channel to release images."
|
||||
.into(),
|
||||
started: Instant::now(),
|
||||
},
|
||||
);
|
||||
m.cache.insert(ready.key, Entry::new(PREVIEW_CACHE_FULL));
|
||||
continue;
|
||||
}
|
||||
m.cache.insert(
|
||||
ready.key,
|
||||
Entry {
|
||||
image: Some(image),
|
||||
error: String::new(),
|
||||
error: Message::Raw(String::new()),
|
||||
cause: None,
|
||||
started: Instant::now(),
|
||||
},
|
||||
);
|
||||
|
|
@ -328,9 +423,8 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
m.cache.insert(
|
||||
ready.key,
|
||||
Entry {
|
||||
image: None,
|
||||
error: format!("Image unavailable: {e}"),
|
||||
started: Instant::now(),
|
||||
cause: Some(e),
|
||||
..Entry::new(IMAGE_UNAVAILABLE)
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -340,27 +434,19 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
if p.request.is_some() && p.started.elapsed().as_secs() > 35 {
|
||||
p.request = None;
|
||||
window.set_image_uploading(false);
|
||||
window.set_image_status(
|
||||
"Image delivery could not be confirmed. Check the channel before retrying."
|
||||
.into(),
|
||||
);
|
||||
show_status(window, Message::from(DELIVERY_UNCONFIRMED));
|
||||
}
|
||||
window.set_pending_image(p.image.frame());
|
||||
}
|
||||
for entry in m.cache.values_mut() {
|
||||
if entry.image.is_none()
|
||||
&& entry.error == "Loading image…"
|
||||
&& entry.started.elapsed().as_secs() > 35
|
||||
{
|
||||
entry.error = "Image request timed out".into();
|
||||
if entry.image.is_none() && entry.loading() && entry.started.elapsed().as_secs() > 35 {
|
||||
entry.error = Message::from(IMAGE_TIMED_OUT);
|
||||
}
|
||||
}
|
||||
let pending_fetches = m
|
||||
.cache
|
||||
.iter()
|
||||
.filter(|(k, e)| {
|
||||
k.starts_with("attachment:") && e.image.is_none() && e.error == "Loading image…"
|
||||
})
|
||||
.filter(|(k, e)| k.starts_with("attachment:") && e.image.is_none() && e.loading())
|
||||
.count();
|
||||
let model = if window.get_show_forum() {
|
||||
window.get_forum_replies()
|
||||
|
|
@ -397,14 +483,7 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
};
|
||||
if !m.cache.contains_key(&key) && slots > 0 && m.cache.len() < 24 {
|
||||
slots -= 1;
|
||||
m.cache.insert(
|
||||
key.clone(),
|
||||
Entry {
|
||||
image: None,
|
||||
error: "Loading image…".into(),
|
||||
started: Instant::now(),
|
||||
},
|
||||
);
|
||||
m.cache.insert(key.clone(), Entry::new(LOADING_IMAGE));
|
||||
if let Some(attachment_id) = attachment {
|
||||
let net = state.net.clone();
|
||||
let channel_id = state.ui.active_channel.clone().unwrap_or_default();
|
||||
|
|
@ -428,7 +507,7 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
tokio::task::spawn_blocking(move || chat_images::decode(&bytes)).await?
|
||||
}
|
||||
.await
|
||||
.map_err(|e: anyhow::Error| e.to_string());
|
||||
.map_err(|e: anyhow::Error| chat_images::describe(&e));
|
||||
let _ = tx.send(Ready {
|
||||
key: request,
|
||||
result,
|
||||
|
|
@ -439,7 +518,7 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
}
|
||||
item.media_ready = false;
|
||||
item.media_image = Default::default();
|
||||
item.media_status = "Image queue is full".into();
|
||||
item.media_status = i18n::text(IMAGE_QUEUE_FULL).into();
|
||||
if let Some(entry) = m.cache.get(&key) {
|
||||
if let Some(image) = &entry.image {
|
||||
item.media_image = image.frame();
|
||||
|
|
@ -447,7 +526,7 @@ pub fn tick(window: &MainWindow, state: &crate::AppState) {
|
|||
item.media_ratio = image.ratio;
|
||||
item.media_status = "".into();
|
||||
} else {
|
||||
item.media_status = entry.error.as_str().into();
|
||||
item.media_status = entry.status().into();
|
||||
}
|
||||
}
|
||||
if attachment.is_some() {
|
||||
|
|
@ -483,3 +562,69 @@ fn source_key(source: &str, state: &crate::AppState) -> Option<String> {
|
|||
chat_images::image_url(source).map(|url| format!("url:{url}"))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::ui::i18n::{Language, text_in};
|
||||
|
||||
#[test]
|
||||
fn image_messages_resolve_to_russian() {
|
||||
let mut sources = chat_images::catalogue_sources();
|
||||
sources.extend([
|
||||
LOADING_IMAGE,
|
||||
DECODING_IMAGE,
|
||||
PREVIEW_CACHE_FULL,
|
||||
IMAGE_UNAVAILABLE,
|
||||
IMAGE_TIMED_OUT,
|
||||
IMAGE_QUEUE_FULL,
|
||||
CANNOT_PASTE,
|
||||
WAIT_FOR_OPERATION,
|
||||
ATTACHMENTS_IN_CHANNELS,
|
||||
PREPARING_IMAGE,
|
||||
SELECT_ORIGINAL_CHANNEL,
|
||||
SENDING_IMAGE,
|
||||
IMAGE_READY,
|
||||
DELIVERY_UNCONFIRMED,
|
||||
]);
|
||||
for source in sources {
|
||||
assert_ne!(text_in(Language::Russian, source), source, "{source}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn loading_sentinel_survives_translation() {
|
||||
let entry = Entry::new(LOADING_IMAGE);
|
||||
assert!(entry.loading());
|
||||
assert!(!Entry::new(IMAGE_TIMED_OUT).loading());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod server_text_tests {
|
||||
use super::*;
|
||||
use crate::ui::i18n::{Language, text_in};
|
||||
|
||||
/// Texts the gateway sends for forum and attachment failures (VNOX-Server handlers).
|
||||
const SERVER_TEXTS: &[&str] = &[
|
||||
"image attachments require a text channel",
|
||||
"guild membership required",
|
||||
"MESSAGE_SEND permission required",
|
||||
"image request rate limit reached",
|
||||
"image not found",
|
||||
"forum not found",
|
||||
"forum requests are too frequent",
|
||||
"topic not found in this forum",
|
||||
];
|
||||
|
||||
#[test]
|
||||
fn known_server_texts_translate_and_unknown_ones_are_shown_as_received() {
|
||||
for source in SERVER_TEXTS {
|
||||
assert_ne!(text_in(Language::Russian, source), *source, "{source}");
|
||||
}
|
||||
assert_eq!(
|
||||
Message::Server("something new from a newer server".into()).to_string(),
|
||||
"something new from a newer server"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -551,4 +551,18 @@ mod tests {
|
|||
assert_eq!(state.reply_draft, "Keep this");
|
||||
assert!(!state.error.is_empty());
|
||||
}
|
||||
#[test]
|
||||
fn forum_error_sources_have_russian_translations() {
|
||||
use crate::ui::i18n::{Language, text_in};
|
||||
for source in [
|
||||
"Enter a title (1–160 characters) and a first message (1–16000 characters).",
|
||||
"Enter a reply (1–16000 characters).",
|
||||
"The forum request timed out. Your draft has been kept; refresh or retry.",
|
||||
"The server refused this forum request.",
|
||||
"The server returned an invalid forum response.",
|
||||
"The server did not acknowledge this forum message.",
|
||||
] {
|
||||
assert_ne!(text_in(Language::Russian, source), source, "{source}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ pub fn format(source: &str, args: &[(&str, String)]) -> String {
|
|||
pub enum Message {
|
||||
App(&'static str, Vec<(&'static str, String)>),
|
||||
Raw(String),
|
||||
/// Text sent by a server: translated when the catalogue knows it, shown as received otherwise.
|
||||
Server(String),
|
||||
}
|
||||
impl Message {
|
||||
pub fn with(source: &'static str, args: Vec<(&'static str, String)>) -> Self {
|
||||
|
|
@ -163,6 +165,7 @@ impl std::fmt::Display for Message {
|
|||
match self {
|
||||
Self::App(source, args) => f.write_str(&format(source, args)),
|
||||
Self::Raw(value) => f.write_str(value),
|
||||
Self::Server(value) => f.write_str(&text(value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -198,6 +201,7 @@ pub fn wire(window: &super::slint::MainWindow, persist: bool) {
|
|||
window.set_theme_error("".into());
|
||||
window.set_theme_status("".into());
|
||||
window.set_avatar_error("".into());
|
||||
super::chat_media::refresh_language(&window);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -670,7 +670,7 @@ mod message_tests {
|
|||
fn render(language: Language, error: &str) -> String {
|
||||
match media_message(error) {
|
||||
Message::App(source, args) => format_in(language, source, &args),
|
||||
Message::Raw(_) => panic!("capture errors retain a semantic key"),
|
||||
Message::Raw(_) | Message::Server(_) => panic!("capture errors retain a semantic key"),
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -14,10 +14,12 @@ export component AvatarView inherits Rectangle {
|
|||
in property <bool> speaking;
|
||||
width: 34px; height: 34px;
|
||||
border-radius: self.width / 2;
|
||||
background: Theme.avatar-bg;
|
||||
background: Theme.avatar-fill;
|
||||
clip: true;
|
||||
border-width: 1px;
|
||||
border-color: Theme.avatar-ring;
|
||||
if root.has-source : Image { source: root.source; width: parent.width; height: parent.height; image-fit: cover; }
|
||||
if !root.has-source : Text { text: root.initials; color: Theme.accent; font-size: Math.max(11px, root.width * 0.38); font-weight: 600; horizontal-alignment: center; vertical-alignment: center; overflow: elide; }
|
||||
if !root.has-source : Text { text: root.initials; color: Theme.text-primary; font-size: Math.max(11px, root.width * 0.38); font-weight: 700; horizontal-alignment: center; vertical-alignment: center; overflow: elide; }
|
||||
// Explicit mask also works on software renderers that only clip rectangular bounds.
|
||||
Path {
|
||||
width: parent.width; height: parent.height;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ component ReactionChip inherits Rectangle {
|
|||
border-radius: 12px;
|
||||
background: root.reaction.mine ? Theme.accent.with-alpha(0.18) : touch.has-hover ? Theme.bg-hover : Theme.bg-interactive;
|
||||
border-width: 1px;
|
||||
border-color: root.reaction.mine ? Theme.accent : Theme.border;
|
||||
border-color: root.reaction.mine ? Theme.accent : Theme.line;
|
||||
accessible-role: button;
|
||||
accessible-label: root.reaction.emoji;
|
||||
content := HorizontalLayout {
|
||||
|
|
@ -113,19 +113,19 @@ export component MessageRow inherits Rectangle {
|
|||
}
|
||||
if root.actions-enabled && (row-touch.has-hover || row-focus.has-focus) : Rectangle {
|
||||
x: parent.width - self.width - 16px; y: 0px;
|
||||
width: bar.preferred-width; height: 34px;
|
||||
width: bar.preferred-width; height: 38px;
|
||||
background: Theme.bg-surface; border-radius: 8px;
|
||||
border-width: 1px; border-color: Theme.border;
|
||||
border-width: 1px; border-color: Theme.line;
|
||||
bar := HorizontalLayout {
|
||||
padding: 2px; spacing: 2px;
|
||||
QuickReaction { label: @tr("Like"); glyph: @image-url("assets/emoji/1f44d.png"); clicked => { root.react(root.message.message_id, "👍"); } }
|
||||
QuickReaction { label: @tr("Heart"); glyph: @image-url("assets/emoji/2764-fe0f.png"); clicked => { root.react(root.message.message_id, "❤️"); } }
|
||||
QuickReaction { label: @tr("Laugh"); glyph: @image-url("assets/emoji/1f602.png"); clicked => { root.react(root.message.message_id, "😂"); } }
|
||||
Rectangle { width: 1px; background: Theme.border; }
|
||||
ActionButton { text: @tr("Add reaction"); icon: "smile-plus"; quiet: true; width: 30px; height: 28px; clicked => { reaction-popup.show(); } }
|
||||
ActionButton { text: @tr("Reply"); icon: "reply"; quiet: true; width: 30px; height: 28px; clicked => { root.reply-to-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: @tr("Edit"); icon: "pencil"; quiet: true; width: 30px; height: 28px; clicked => { root.edit-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: @tr("Delete"); icon: "trash-2"; danger: true; quiet: true; width: 30px; height: 28px; clicked => { root.delete-msg(root.message.message_id); } }
|
||||
Rectangle { width: 1px; background: Theme.line; }
|
||||
ActionButton { text: @tr("Add reaction"); icon: "smile-plus"; quiet: true; width: Theme.hit-size; height: Theme.hit-size; clicked => { reaction-popup.show(); } }
|
||||
ActionButton { text: @tr("Reply"); icon: "reply"; quiet: true; width: Theme.hit-size; height: Theme.hit-size; clicked => { root.reply-to-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: @tr("Edit"); icon: "pencil"; quiet: true; width: Theme.hit-size; height: Theme.hit-size; clicked => { root.edit-msg(root.message.message_id); } }
|
||||
if root.message.is_own : ActionButton { text: @tr("Delete"); icon: "trash-2"; danger: true; quiet: true; width: Theme.hit-size; height: Theme.hit-size; clicked => { root.delete-msg(root.message.message_id); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -176,10 +176,11 @@ export component ChatPanel inherits Rectangle {
|
|||
VerticalLayout {
|
||||
spacing: 0;
|
||||
Rectangle {
|
||||
height: 56px; border-width: 1px; border-color: Theme.border;
|
||||
height: 56px;
|
||||
Rectangle { y: parent.height - 1px; height: 1px; background: Theme.line; }
|
||||
HorizontalLayout {
|
||||
padding-left: 22px; padding-right: 16px; spacing: 10px;
|
||||
Symbol { kind: root.is-dm ? "at-sign" : "hash"; ink: Theme.text-muted; width: 20px; height: 20px; y: (parent.height - self.height) / 2; }
|
||||
Symbol { kind: root.is-dm ? "at-sign" : "hash"; ink: Theme.text-muted; width: Theme.icon-size; height: Theme.icon-size; y: (parent.height - self.height) / 2; }
|
||||
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: @tr("End-to-end encrypted"); color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.6875); vertical-alignment: center; }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
|
|
@ -191,14 +192,35 @@ export component ChatPanel inherits Rectangle {
|
|||
spacing: 0;
|
||||
VerticalLayout {
|
||||
spacing: 0; horizontal-stretch: 1;
|
||||
Flickable {
|
||||
if root.messages.length == 0 : Rectangle {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
alignment: center; spacing: 12px; padding: 24px;
|
||||
Rectangle {
|
||||
height: 72px;
|
||||
Rectangle {
|
||||
width: 72px; height: 72px; x: (parent.width - self.width) / 2;
|
||||
border-radius: 36px; background: Theme.avatar-fill;
|
||||
border-width: 1px; border-color: Theme.avatar-ring;
|
||||
Symbol { kind: root.is-dm ? "at-sign" : "hash"; ink: Theme.text-primary; width: 36px; height: 36px; x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; }
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: root.is-dm ? root.dm-partner-name : @tr("Welcome to #{}", root.active-channel-name);
|
||||
color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.5); font-weight: 700;
|
||||
horizontal-alignment: center; wrap: word-wrap;
|
||||
}
|
||||
Text {
|
||||
text: root.is-dm ? @tr("No messages yet. Say hello.") : @tr("This is the start of the channel. Send the first message below.");
|
||||
color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.9375);
|
||||
horizontal-alignment: center; wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
if root.messages.length > 0 : Flickable {
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
spacing: 0;
|
||||
if root.messages.length == 0 : Text {
|
||||
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 {
|
||||
message: msg;
|
||||
own-avatar: root.own-avatar;
|
||||
|
|
@ -241,7 +263,7 @@ export component ChatPanel inherits Rectangle {
|
|||
width: parent.width - 40px;
|
||||
height: Math.min(150px, Math.max(48px, editor.preferred-height + 22px));
|
||||
background: Theme.bg-interactive; border-radius: 9px;
|
||||
border-width: 1px; border-color: editor.has-focus ? Theme.accent : Theme.border;
|
||||
border-width: 1px; border-color: editor.has-focus ? Theme.accent : Theme.line;
|
||||
HorizontalLayout {
|
||||
padding-left: 14px; padding-right: 8px; padding-top: 11px; padding-bottom: 11px; spacing: 6px;
|
||||
editor := TextInput {
|
||||
|
|
@ -264,15 +286,15 @@ export component ChatPanel inherits Rectangle {
|
|||
}
|
||||
VerticalLayout {
|
||||
alignment: end;
|
||||
ActionButton { text: @tr("Paste image"); icon: "image"; quiet: true; width: 32px; height: 30px; clicked => { root.paste-image(); } }
|
||||
ActionButton { text: @tr("Paste image"); icon: "image"; quiet: true; width: Theme.hit-size; height: Theme.hit-size; clicked => { root.paste-image(); } }
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: end;
|
||||
ActionButton { text: @tr("Emoji"); icon: "smile"; quiet: true; width: 32px; height: 30px; clicked => { emoji-popup.show(); } }
|
||||
ActionButton { text: @tr("Emoji"); icon: "smile"; quiet: true; width: Theme.hit-size; height: Theme.hit-size; clicked => { emoji-popup.show(); } }
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: end;
|
||||
ActionButton { text: @tr("Send"); icon: "send"; primary: true; width: 32px; height: 30px; clicked => { root.send-message(root.is-dm ? "" : root.active-channel-id, root.input-text); } }
|
||||
ActionButton { text: @tr("Send"); icon: "send"; primary: true; width: Theme.hit-size; height: Theme.hit-size; clicked => { root.send-message(root.is-dm ? "" : root.active-channel-id, root.input-text); } }
|
||||
}
|
||||
}
|
||||
Text {
|
||||
|
|
@ -299,12 +321,13 @@ export component ChatPanel inherits Rectangle {
|
|||
}
|
||||
}
|
||||
if root.members-visible && !root.is-dm : Rectangle {
|
||||
width: 210px; background: Theme.bg-surface;
|
||||
width: 211px; background: Theme.bg-surface;
|
||||
Rectangle { x: 0px; width: 1px; background: Theme.line; }
|
||||
Flickable {
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
padding: 16px; spacing: 10px;
|
||||
Text { text: @tr("{n} member" | "{n} members" % root.members.length); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 28px; }
|
||||
Text { text: @tr("{n} member" | "{n} members" % root.members.length); color: Theme.text-secondary; font-size: Math.max(12px, Theme.font-size * 0.8125); font-weight: 700; height: 28px; }
|
||||
for member in root.members: HorizontalLayout {
|
||||
height: 40px; spacing: 10px;
|
||||
Rectangle {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ export component ConnectScreen inherits Rectangle {
|
|||
callback remove-bookmark(string);
|
||||
callback add-bookmark(string);
|
||||
callback open-settings();
|
||||
// Account controls live in the header row so they share one aligned grid with the settings button.
|
||||
in property <string> account-name;
|
||||
callback sign-out();
|
||||
// 0 none, 1 first use, 2 certificate fingerprint changed, 3 server identity changed
|
||||
in property <int> trust-kind: 0;
|
||||
in property <string> trust-address;
|
||||
|
|
@ -32,7 +35,12 @@ 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; vertical-alignment: center; }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
VerticalLayout { alignment: center; ActionButton { text: @tr("Settings"); icon: "settings"; quiet: true; clicked => { root.open-settings(); } } }
|
||||
HorizontalLayout {
|
||||
spacing: 8px; alignment: end;
|
||||
if root.account-name != "" : Text { text: root.account-name; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); overflow: elide; vertical-alignment: center; max-width: 240px; }
|
||||
ActionButton { text: @tr("Sign out of Central"); icon: "log-out"; quiet: true; width: 32px; height: 32px; clicked => { root.sign-out(); } }
|
||||
ActionButton { text: @tr("Settings"); icon: "settings"; quiet: true; width: 32px; height: 32px; clicked => { root.open-settings(); } }
|
||||
}
|
||||
}
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
HorizontalLayout {
|
||||
|
|
@ -61,7 +69,7 @@ export component ConnectScreen inherits Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
if !root.connecting : ActionButton { text: @tr("Connect"); height: 40px; clicked => { root.connect(root.address-input); } }
|
||||
if !root.connecting : ActionButton { text: @tr("Connect"); primary: true; text-size: 14px; height: 40px; clicked => { root.connect(root.address-input); } }
|
||||
if root.connecting : ActionButton { text: @tr("Cancel"); height: 40px; clicked => { root.disconnect(); } }
|
||||
}
|
||||
Rectangle {
|
||||
|
|
@ -93,7 +101,11 @@ export component ConnectScreen inherits Rectangle {
|
|||
Rectangle { horizontal-stretch: 1; }
|
||||
ActionButton { text: @tr("Save address"); icon: "plus"; labeled: true; quiet: true; clicked => { root.add-bookmark(root.address-input); } }
|
||||
}
|
||||
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); }
|
||||
if root.bookmarks.length == 0 : VerticalLayout {
|
||||
padding-top: 8px; padding-bottom: 8px; spacing: 4px; alignment: center;
|
||||
Text { text: @tr("No saved servers yet."); color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; horizontal-alignment: center; }
|
||||
Text { text: @tr("Type an address above and choose Save address to keep it here for next time."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-alignment: center; wrap: word-wrap; }
|
||||
}
|
||||
for server in root.bookmarks: HorizontalLayout {
|
||||
height: 48px; spacing: 8px;
|
||||
VerticalLayout {
|
||||
|
|
@ -148,7 +160,7 @@ export component ConnectScreen inherits Rectangle {
|
|||
spacing: 9px; alignment: end;
|
||||
if root.trust-kind != 1 : ActionButton { text: @tr("Forget this server"); danger: true; clicked => { root.trust-forget(); } }
|
||||
ActionButton { text: root.trust-kind == 1 ? @tr("Cancel") : @tr("Close"); clicked => { root.trust-dismiss(); } }
|
||||
if root.trust-kind == 1 : ActionButton { text: @tr("Trust and connect"); active: true; clicked => { root.trust-accept(); } }
|
||||
if root.trust-kind == 1 : ActionButton { text: @tr("Trust and connect"); primary: true; clicked => { root.trust-accept(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,11 +60,14 @@ export component ForumPanel inherits Rectangle {
|
|||
if root.error != "" : Text { text: root.error; color: Theme.danger; font-size: Theme.font-size - 1px; wrap: word-wrap; }
|
||||
if root.loading : Text { text: @tr("Loading…"); color: Theme.text-muted; font-size: Theme.font-size - 1px; }
|
||||
if root.creating : VerticalLayout {
|
||||
spacing: 12px;
|
||||
alignment: start; spacing: 12px;
|
||||
Text { text: @tr("Create topic"); color: Theme.text-primary; font-size: Theme.font-size + 5px; font-weight: 600; }
|
||||
ThemeInput { text <=> root.title-draft; placeholder-text: @tr("Topic title"); read-only: root.busy; edited(value) => { root.title-edited(value); } }
|
||||
Text { text: @tr("First message"); color: Theme.text-secondary; font-size: Theme.font-size - 2px; }
|
||||
Rectangle {
|
||||
height: 180px;
|
||||
ThemeEditor { text <=> root.body-draft; monospace: false; read-only: root.busy; edited(value) => { root.body-edited(value); } }
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: end; spacing: 10px;
|
||||
ActionButton { text: @tr("Cancel"); clicked => { if !root.busy { root.cancel-create(); } } }
|
||||
|
|
@ -77,20 +80,21 @@ export component ForumPanel inherits Rectangle {
|
|||
text: @tr("No topics yet. Start the first discussion."); color: Theme.text-secondary; font-size: Theme.font-size; wrap: word-wrap;
|
||||
}
|
||||
Flickable {
|
||||
vertical-stretch: 1;
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
spacing: 0;
|
||||
alignment: start; spacing: 0;
|
||||
for topic in root.topics : Rectangle {
|
||||
height: 105px; background: touch.has-hover ? Theme.bg-hover : transparent;
|
||||
height: topic.excerpt == "" ? 76px : 100px; background: touch.has-hover ? Theme.bg-hover : transparent;
|
||||
accessible-role: button; accessible-label: topic.title;
|
||||
VerticalLayout {
|
||||
padding-top: 12px; padding-bottom: 12px; padding-left: 12px; padding-right: 12px; spacing: 6px;
|
||||
Text { text: topic.title; color: Theme.text-primary; font-weight: 600; font-size: Theme.font-size + 1px; overflow: elide; }
|
||||
Text { text: topic.excerpt; color: Theme.text-secondary; font-size: Theme.font-size - 1px; overflow: elide; }
|
||||
if topic.excerpt != "" : Text { text: topic.excerpt; color: Theme.text-secondary; font-size: Theme.font-size - 1px; overflow: elide; }
|
||||
HorizontalLayout {
|
||||
spacing: 12px;
|
||||
Text { text: topic.author; color: Theme.text-muted; font-size: Theme.font-size - 3px; horizontal-stretch: 1; overflow: elide; }
|
||||
Text { text: @tr("{} replies", topic.replies); color: Theme.text-muted; font-size: Theme.font-size - 3px; }
|
||||
Text { text: @tr("Replies: {}", topic.replies); color: Theme.text-muted; font-size: Theme.font-size - 3px; }
|
||||
Text { text: topic.updated; color: Theme.text-muted; font-size: Theme.font-size - 3px; }
|
||||
}
|
||||
}
|
||||
|
|
@ -107,15 +111,19 @@ export component ForumPanel inherits Rectangle {
|
|||
spacing: 14px;
|
||||
Text { text: root.topic-title; color: Theme.text-primary; font-size: Theme.font-size + 5px; font-weight: 600; wrap: word-wrap; }
|
||||
Flickable {
|
||||
vertical-stretch: 1;
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
spacing: 16px;
|
||||
alignment: start; spacing: 16px;
|
||||
for reply in root.replies : MessageRow { message: reply; actions-enabled: false; }
|
||||
}
|
||||
}
|
||||
if root.more-replies : ActionButton { text: @tr("More replies"); clicked => { if !root.loading && !root.busy { root.load-more-replies(); } } }
|
||||
Text { text: @tr("Your reply"); color: Theme.text-secondary; font-size: Theme.font-size - 2px; }
|
||||
ThemeEditor { text <=> root.reply-draft; monospace: false; preferred-height: 96px; read-only: root.busy; edited(value) => { root.reply-edited(value); } }
|
||||
Rectangle {
|
||||
height: 96px;
|
||||
ThemeEditor { text <=> root.reply-draft; monospace: false; read-only: root.busy; edited(value) => { root.reply-edited(value); } }
|
||||
}
|
||||
HorizontalLayout { alignment: end; ActionButton { text: root.busy ? @tr("Sending…") : @tr("Reply"); primary: true; clicked => { if !root.busy { root.submit-reply(); } } } }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,43 @@ import { AvatarView, PresenceDot } from "avatar-view.slint";
|
|||
|
||||
export struct FriendItem { user_id: string, nickname: string, status: string, status_label: string, avatar_text: string }
|
||||
|
||||
component FriendsEmptyState inherits Rectangle {
|
||||
in property <string> icon;
|
||||
in property <string> title;
|
||||
in property <string> hint;
|
||||
in property <string> action;
|
||||
callback action-clicked();
|
||||
height: content.preferred-height + 48px;
|
||||
content := VerticalLayout {
|
||||
padding-top: 24px; padding-bottom: 24px; spacing: 10px; alignment: center;
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Rectangle {
|
||||
width: 56px; height: 56px; border-radius: 28px; background: Theme.bg-elevated; border-width: 1px; border-color: Theme.border;
|
||||
Symbol { kind: root.icon; ink: Theme.text-muted; width: 26px; height: 26px; x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; }
|
||||
}
|
||||
}
|
||||
Text { text: root.title; color: Theme.text-primary; font-size: Math.max(13px, Theme.font-size * 1.0); font-weight: 600; horizontal-alignment: center; wrap: word-wrap; }
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Text { text: root.hint; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); horizontal-alignment: center; wrap: word-wrap; max-width: 420px; }
|
||||
}
|
||||
if root.action != "" : HorizontalLayout {
|
||||
alignment: center; padding-top: 6px;
|
||||
ActionButton { text: root.action; primary: true; clicked => { root.action-clicked(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export component FriendsPanel inherits Rectangle {
|
||||
in-out property <[FriendItem]> friends;
|
||||
in-out property <[FriendItem]> pending-requests;
|
||||
in-out property <[string]> blocked-users;
|
||||
in-out property <string> active-tab;
|
||||
in-out property <string> add-friend-input;
|
||||
// Number of friends that are not offline; -1 when the host does not provide it.
|
||||
in property <int> online-count: -1;
|
||||
property <bool> can-add: root.add-friend-input != "";
|
||||
callback tab-changed(string);
|
||||
callback input-edited(string);
|
||||
callback add-friend(string);
|
||||
|
|
@ -37,9 +68,10 @@ export component FriendsPanel inherits Rectangle {
|
|||
padding: 22px; spacing: 16px;
|
||||
HorizontalLayout {
|
||||
spacing: 9px;
|
||||
ThemeInput { text <=> root.add-friend-input; placeholder-text: @tr("Friend ID"); edited(text) => { root.input-edited(text); } accepted => { root.add-friend(root.add-friend-input); } }
|
||||
ActionButton { text: @tr("Add by ID"); height: 38px; clicked => { root.add-friend(root.add-friend-input); } }
|
||||
friend-input := ThemeInput { text <=> root.add-friend-input; placeholder-text: @tr("Paste a friend's ID"); accessible-role: text-input; accessible-label: @tr("Friend ID"); edited(text) => { root.input-edited(text); } accepted => { if root.can-add { root.add-friend(root.add-friend-input); } } }
|
||||
ActionButton { text: @tr("Add by ID"); height: 38px; primary: root.can-add; opacity: root.can-add ? 1.0 : 0.45; clicked => { if root.can-add { root.add-friend(root.add-friend-input); } } }
|
||||
}
|
||||
Text { text: @tr("Your own ID is in Settings > Profile and keys. Copy it and share it, or paste a friend's ID here."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); wrap: word-wrap; }
|
||||
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;
|
||||
|
|
@ -81,9 +113,25 @@ 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: @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); }
|
||||
if root.active-tab == "all" && root.friends.length == 0 : FriendsEmptyState {
|
||||
icon: "users"; title: @tr("No friends yet");
|
||||
hint: @tr("Friends are added by ID. Open Settings > Profile and keys, copy your own ID and share it, then paste a friend's ID above.");
|
||||
action: @tr("Enter a friend ID"); action-clicked => { friend-input.focus(); }
|
||||
}
|
||||
if root.active-tab == "online" && (root.friends.length == 0 || (root.online-count == 0)) : FriendsEmptyState {
|
||||
icon: "circle"; title: root.friends.length == 0 ? @tr("No friends yet") : @tr("Nobody is online");
|
||||
hint: root.friends.length == 0 ? @tr("Friends are added by ID. Open Settings > Profile and keys, copy your own ID and share it, then paste a friend's ID above.") : @tr("None of your friends are online right now. Check the All tab to message them anyway.");
|
||||
action: root.friends.length == 0 ? @tr("Enter a friend ID") : @tr("Show all friends");
|
||||
action-clicked => { if root.friends.length == 0 { friend-input.focus(); } else { root.tab-changed("all"); } }
|
||||
}
|
||||
if root.active-tab == "pending" && root.pending-requests.length == 0 : FriendsEmptyState {
|
||||
icon: "user-plus"; title: @tr("No pending requests");
|
||||
hint: @tr("When someone sends you their friend request, it will show up here for you to accept or decline.");
|
||||
}
|
||||
if root.active-tab == "blocked" && root.blocked-users.length == 0 : FriendsEmptyState {
|
||||
icon: "ban"; title: @tr("No blocked users");
|
||||
hint: @tr("You haven't blocked anyone. Blocked people will be listed here.");
|
||||
}
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ export component MainWindow inherits Window {
|
|||
in-out property <[FriendItem]> pending-requests;
|
||||
in-out property <[string]> blocked-users;
|
||||
in-out property <string> friends-active-tab;
|
||||
in-out property <int> friends-online-count: -1;
|
||||
in-out property <string> add-friend-input;
|
||||
|
||||
in-out property <[VoiceMemberItem]> voice-members;
|
||||
|
|
@ -309,6 +310,8 @@ export component MainWindow inherits Window {
|
|||
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;
|
||||
|
|
@ -435,6 +438,7 @@ export component MainWindow inherits Window {
|
|||
}
|
||||
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;
|
||||
|
|
@ -548,17 +552,6 @@ export component MainWindow inherits Window {
|
|||
import-keyfile(input, pass) => { root.import-keyfile(input, pass); }
|
||||
}
|
||||
|
||||
if root.account-authenticated && node-name == "" && !root.settings-open : Rectangle {
|
||||
x: parent.width - self.width - 12px; y: 6px;
|
||||
width: Math.min(340px, parent.width / 3); height: 32px;
|
||||
background: Theme.bg-elevated; border-radius: 6px;
|
||||
HorizontalLayout {
|
||||
padding-left: 10px; padding-right: 4px; spacing: 8px;
|
||||
Text { text: root.account-name; color: Theme.text-primary; font-size: 12px; overflow: elide; vertical-alignment: center; horizontal-stretch: 1; }
|
||||
ActionButton { text: @tr("Sign out of Central"); icon: "log-out"; width: 28px; clicked => { root.account-sign-out(); } }
|
||||
}
|
||||
}
|
||||
|
||||
if root.pending-delete-id != "" : Rectangle {
|
||||
background: Theme.overlay;
|
||||
TouchArea { }
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export component ManagementMenu inherits Rectangle {
|
|||
width: 264px; height: root.actions.length * 38px + 12px;
|
||||
x: Math.clamp(root.anchor-x * 1px, 8px, root.width - self.width - 8px);
|
||||
y: Math.clamp(root.anchor-y * 1px, 8px, root.height - self.height - 8px);
|
||||
background: Theme.bg-elevated; border-radius: 8px; border-width: 1px; border-color: Theme.border;
|
||||
background: Theme.bg-elevated; border-radius: 8px; border-width: 1px; border-color: Theme.line;
|
||||
TouchArea { }
|
||||
VerticalLayout {
|
||||
padding: 6px; spacing: 2px;
|
||||
|
|
|
|||
|
|
@ -107,15 +107,17 @@ export component SettingsWindow inherits Rectangle {
|
|||
callback reset-theme();
|
||||
callback import-theme(string);
|
||||
callback export-theme(string);
|
||||
// Content column: centered, max 780px wide, 28px minimum gutter.
|
||||
property <length> pane-pad: Math.max(28px, (self.width - 232px - 1px - 780px) / 2);
|
||||
background: Theme.bg-base;
|
||||
changed active-tab => { settings-scroll.content-y = 0px; }
|
||||
HorizontalLayout {
|
||||
spacing: 0;
|
||||
Rectangle {
|
||||
width: 236px; background: Theme.bg-surface;
|
||||
width: 232px; background: Theme.bg-surface;
|
||||
VerticalLayout {
|
||||
padding-left: 16px; padding-right: 16px; padding-top: 32px; padding-bottom: 20px; spacing: 7px;
|
||||
Text { text: @tr("Settings"); color: Theme.text-primary; font-size: Theme.font-size + 6px; font-weight: 700; height: 46px; }
|
||||
padding-left: 12px; padding-right: 12px; padding-top: 24px; padding-bottom: 16px; spacing: 6px;
|
||||
Text { text: @tr("Settings"); color: Theme.text-primary; font-size: Theme.font-size + 6px; font-weight: 700; height: 46px; horizontal-stretch: 1; overflow: elide; }
|
||||
SettingsNav { label: @tr("Audio & microphone"); detail: @tr("Devices and voice input"); mark: "mic"; active: root.active-tab == "audio"; clicked => { root.active-tab = "audio"; } }
|
||||
SettingsNav { label: @tr("Appearance"); detail: @tr("Themes, colours and text"); mark: "palette"; active: root.active-tab == "appearance"; clicked => { root.active-tab = "appearance"; } }
|
||||
SettingsNav { label: @tr("Profile and keys"); detail: @tr("Security and backup"); mark: "user"; active: root.active-tab == "identity"; clicked => { root.active-tab = "identity"; } }
|
||||
|
|
@ -135,7 +137,7 @@ export component SettingsWindow inherits Rectangle {
|
|||
Rectangle {
|
||||
height: 114px;
|
||||
HorizontalLayout {
|
||||
padding-left: 34px; padding-right: 28px; padding-top: 29px; padding-bottom: 20px; spacing: 18px;
|
||||
padding-left: root.pane-pad; padding-right: 28px; padding-top: 29px; padding-bottom: 20px; spacing: 18px;
|
||||
VerticalLayout {
|
||||
spacing: 6px;
|
||||
Text { text: root.active-tab == "appearance" ? @tr("Appearance") : root.active-tab == "identity" ? @tr("Profile and keys") : root.active-tab == "updates" ? @tr("Updates") : @tr("Audio & microphone"); color: Theme.text-primary; font-size: Theme.font-size + 12px; font-weight: 700; }
|
||||
|
|
@ -146,10 +148,13 @@ export component SettingsWindow inherits Rectangle {
|
|||
}
|
||||
}
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle {
|
||||
vertical-stretch: 1;
|
||||
clip: true;
|
||||
settings-scroll := Flickable {
|
||||
content-width: self.width;
|
||||
VerticalLayout {
|
||||
padding-left: 34px; padding-right: 34px; padding-top: 28px; padding-bottom: 16px; spacing: 0;
|
||||
padding-left: root.pane-pad; padding-right: root.pane-pad; padding-top: 28px; padding-bottom: 16px; spacing: 0;
|
||||
if root.active-tab == "audio" || (root.active-tab != "appearance" && root.active-tab != "identity" && root.active-tab != "updates") : AudioSettings {
|
||||
input-devices: root.input-devices;
|
||||
output-devices: root.output-devices;
|
||||
|
|
@ -230,6 +235,27 @@ export component SettingsWindow inherits Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Themed scrollbar, visible whenever content overflows.
|
||||
if settings-scroll.content-height > settings-scroll.height : Rectangle {
|
||||
x: parent.width - self.width - 3px; y: 3px; width: 8px; height: parent.height - 6px;
|
||||
background: Theme.bg-rail; border-radius: 4px; opacity: 0.7;
|
||||
thumb := Rectangle {
|
||||
property <length> th: Math.max(32px, parent.height * settings-scroll.height / settings-scroll.content-height);
|
||||
width: parent.width; height: self.th; border-radius: 4px;
|
||||
background: bar-touch.has-hover || bar-touch.pressed ? Theme.accent : Theme.border;
|
||||
y: (parent.height - self.th) * (-settings-scroll.content-y) / Math.max(1px, settings-scroll.content-height - settings-scroll.height);
|
||||
}
|
||||
bar-touch := TouchArea {
|
||||
property <length> start-y;
|
||||
pointer-event(e) => { if e.kind == PointerEventKind.down { self.start-y = settings-scroll.content-y; } }
|
||||
moved => {
|
||||
if self.pressed {
|
||||
settings-scroll.content-y = Math.clamp(self.start-y - (self.mouse-y - self.pressed-y) * (settings-scroll.content-height - settings-scroll.height) / Math.max(1px, parent.height - thumb.th), -(settings-scroll.content-height - settings-scroll.height), 0px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,19 +25,27 @@ export component AudioSettings inherits Rectangle {
|
|||
Rectangle { height: 24px; }
|
||||
Text { text: @tr("Microphone"); color: Theme.text-primary; font-size: Math.max(Theme.font-size - 2px, 11px); }
|
||||
Rectangle { height: 9px; }
|
||||
DeviceSelect {
|
||||
if root.input-devices.length > 0 : DeviceSelect {
|
||||
model: root.input-devices;
|
||||
current-index <=> root.input-device-index;
|
||||
selected(value) => { root.audio-changed(); }
|
||||
}
|
||||
if root.input-devices.length == 0 : Rectangle {
|
||||
height: 40px; background: Theme.bg-interactive; border-radius: Theme.radius; border-width: 1px; border-color: Theme.border;
|
||||
Text { x: 14px; width: parent.width - 28px; height: parent.height; text: @tr("No devices found - using default device"); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 2px, 11px); vertical-alignment: center; overflow: elide; }
|
||||
}
|
||||
Rectangle { height: 19px; }
|
||||
Text { text: @tr("Headphones or speakers"); color: Theme.text-primary; font-size: Math.max(Theme.font-size - 2px, 11px); }
|
||||
Rectangle { height: 9px; }
|
||||
DeviceSelect {
|
||||
if root.output-devices.length > 0 : DeviceSelect {
|
||||
model: root.output-devices;
|
||||
current-index <=> root.output-device-index;
|
||||
selected(value) => { root.audio-changed(); }
|
||||
}
|
||||
if root.output-devices.length == 0 : Rectangle {
|
||||
height: 40px; background: Theme.bg-interactive; border-radius: Theme.radius; border-width: 1px; border-color: Theme.border;
|
||||
Text { x: 14px; width: parent.width - 28px; height: parent.height; text: @tr("No devices found - using default device"); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 2px, 11px); vertical-alignment: center; overflow: elide; }
|
||||
}
|
||||
Rectangle { height: 29px; }
|
||||
Text { text: @tr("Microphone test"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; }
|
||||
Text { text: @tr("Use headphones. Hear yourself locally for up to 30 seconds. Nothing is sent to the room; voice transmission is paused during the test."); color: Theme.text-secondary; font-size: 13px; wrap: word-wrap; }
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ export component Sidebar inherits Rectangle {
|
|||
VerticalLayout {
|
||||
padding: 9px; spacing: 11px;
|
||||
ActionButton { text: @tr("Direct messages"); icon: "house"; height: 44px; active: root.show-dms; clicked => { root.show-friends(); } }
|
||||
Rectangle { height: 1px; background: Theme.border; }
|
||||
Rectangle { height: 1px; background: Theme.line; }
|
||||
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 {
|
||||
height: 44px;
|
||||
|
|
@ -121,13 +121,15 @@ export component Sidebar inherits Rectangle {
|
|||
ActionButton { text: @tr("Settings"); icon: "settings"; quiet: true; clicked => { root.open-settings(); } }
|
||||
}
|
||||
}
|
||||
Rectangle { width: 1px; background: Theme.line; }
|
||||
Rectangle {
|
||||
horizontal-stretch: 1;
|
||||
VerticalLayout {
|
||||
spacing: 0;
|
||||
Rectangle {
|
||||
height: 56px;
|
||||
border-width: 1px; border-color: Theme.border;
|
||||
border-width: 0px;
|
||||
Rectangle { y: parent.height - 1px; height: 1px; background: Theme.line; }
|
||||
HorizontalLayout {
|
||||
padding-left: 17px; padding-right: 10px; spacing: 8px;
|
||||
if !root.show-dms && root.active-guild-idx < 0 :Rectangle {
|
||||
|
|
@ -151,7 +153,7 @@ export component Sidebar inherits Rectangle {
|
|||
VerticalLayout {
|
||||
padding: 10px; spacing: 3px;
|
||||
if root.show-dms : NavRow { label: @tr("Friends"); symbol: "at-sign"; 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 : Text { text: @tr("Direct messages"); color: Theme.text-secondary; font-size: Math.max(12px, Theme.font-size * 0.8125); font-weight: 700; 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;
|
||||
|
|
@ -161,8 +163,8 @@ export component Sidebar inherits Rectangle {
|
|||
}
|
||||
if !root.show-dms : HorizontalLayout {
|
||||
height:32px;
|
||||
Text{text:@tr("Channels");color:Theme.text-muted;font-size:Math.max(11px,Theme.font-size*0.75);vertical-alignment:bottom;horizontal-stretch:1;}
|
||||
if root.node-admin && root.active-guild-idx < 0 :ActionButton{text:@tr("Create channel");icon:"plus";quiet:true;width:28px;clicked=>{root.open-channel-menu("",self.absolute-position.x/1px,(self.absolute-position.y+self.height)/1px);}}
|
||||
Text{text:@tr("Channels");color:Theme.text-secondary;font-size:Math.max(12px,Theme.font-size*0.8125);font-weight:700;vertical-alignment:bottom;horizontal-stretch:1;}
|
||||
if root.node-admin && root.active-guild-idx < 0 :ActionButton{text:@tr("Create channel");icon:"plus";quiet:true;width:Theme.hit-size;clicked=>{root.open-channel-menu("",self.absolute-position.x/1px,(self.absolute-position.y+self.height)/1px);}}
|
||||
}
|
||||
for ch in root.channels:NavRow {
|
||||
visible:!root.show-dms;
|
||||
|
|
@ -215,7 +217,7 @@ export component Sidebar inherits Rectangle {
|
|||
}
|
||||
VerticalLayout { alignment: center; AudioDeviceButton { text: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); icon: root.mic-enabled ? "mic" : "mic-off"; danger: !root.mic-enabled; model: root.input-devices; current-index: root.input-device-index; heading: @tr("Microphone"); clicked => { root.toggle-mic(); } refresh => { root.refresh-devices(); } chosen(index) => { root.device-selected(index, root.output-device-index); } } }
|
||||
VerticalLayout { alignment: center; AudioDeviceButton { text: root.deafened ? @tr("Undeafen") : @tr("Deafen"); icon: root.deafened ? "headphone-off" : "headphones"; danger: root.deafened; model: root.output-devices; current-index: root.output-device-index; heading: @tr("Headphones or speakers"); clicked => { root.toggle-deafen(); } refresh => { root.refresh-devices(); } chosen(index) => { root.device-selected(root.input-device-index, index); } } }
|
||||
VerticalLayout { alignment: center; ActionButton { text: @tr("Settings"); icon: "settings"; width: 30px; quiet: true; clicked => { root.open-settings(); } } }
|
||||
VerticalLayout { alignment: center; ActionButton { text: @tr("Settings"); icon: "settings"; width: Theme.hit-size; quiet: true; clicked => { root.open-settings(); } } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,17 @@ export global Theme {
|
|||
in-out property <color> voice-bg: #222b25;
|
||||
in-out property <color> overlay: #00000091;
|
||||
in-out property <length> radius: 7px;
|
||||
// Neutral separator/border derived from the text colour, so it follows every theme (dark and
|
||||
// light) without a hue cast. Alpha 0.5 keeps it at >= 3:1 against the surface backgrounds.
|
||||
out property <color> line: text-primary.with-alpha(0.5);
|
||||
// Softer neutral for decorative edges (still visible, not a meaningful boundary).
|
||||
out property <color> line-soft: text-primary.with-alpha(0.22);
|
||||
// Avatar circle fill: accent wash that stands out from every surface; initials use text-primary.
|
||||
out property <color> avatar-fill: accent.with-alpha(0.34);
|
||||
out property <color> avatar-ring: accent.with-alpha(0.85);
|
||||
// One icon size and one minimum hit area for all toolbar/icon buttons.
|
||||
out property <length> icon-size: 20px;
|
||||
out property <length> hit-size: 32px;
|
||||
}
|
||||
|
||||
/// Lucide icon (ISC license, see assets/icons/LICENSE) tinted with the theme ink colour.
|
||||
|
|
@ -107,17 +118,17 @@ export component ActionButton inherits Rectangle {
|
|||
in property <string> tooltip: icon != "" && !labeled ? text : "";
|
||||
callback clicked();
|
||||
callback right-clicked();
|
||||
min-width: 30px;
|
||||
min-width: Theme.hit-size;
|
||||
horizontal-stretch: 0;
|
||||
preferred-width: icon == "" ? label.preferred-width + 22px : labeled ? label.preferred-width + 48px : 32px;
|
||||
height: 32px;
|
||||
preferred-width: icon == "" ? label.preferred-width + 22px : labeled ? label.preferred-width + 48px : Theme.hit-size;
|
||||
height: Theme.hit-size;
|
||||
border-radius: 6px;
|
||||
background: primary ? (touch.has-hover ? Theme.accent.brighter(8%) : Theme.accent) : active ? Theme.selected : touch.has-hover ? Theme.bg-hover : quiet ? transparent : Theme.bg-interactive;
|
||||
border-width: keyboard.has-focus || !quiet ? 1px : 0px;
|
||||
border-color: keyboard.has-focus ? Theme.accent : Theme.border;
|
||||
border-color: keyboard.has-focus ? Theme.accent : Theme.line;
|
||||
accessible-role: button;
|
||||
accessible-label: text;
|
||||
Symbol { visible: root.icon != ""; kind: root.icon; ink: root.primary ? Theme.on-accent : root.danger ? Theme.danger : root.active ? Theme.text-primary : Theme.text-secondary; width: 18px; height: 18px; x: root.labeled ? 12px : (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; }
|
||||
Symbol { visible: root.icon != ""; kind: root.icon; ink: root.primary ? Theme.on-accent : root.danger ? Theme.danger : root.active ? Theme.text-primary : Theme.text-secondary; width: Theme.icon-size; height: Theme.icon-size; x: root.labeled ? 12px : (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; }
|
||||
label := Text {
|
||||
visible: root.icon == "" || root.labeled;
|
||||
x: root.labeled ? 36px : 0px;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ export component UnlockWindow inherits Window {
|
|||
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: @tr("Unlock"); clicked => { root.unlock(password.text); } }
|
||||
ActionButton { text: @tr("Unlock"); primary: true; clicked => { root.unlock(password.text); } }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,22 +40,25 @@ component ParticipantCard inherits Rectangle {
|
|||
in property <VoiceMemberItem> member;
|
||||
in property <image> own-avatar;
|
||||
in property <bool> has-own-avatar;
|
||||
accessible-role: groupbox;
|
||||
accessible-label: root.member.nickname + ", " + (root.member.speaking ? @tr("Speaking") : @tr("In voice"));
|
||||
border-radius: 16px;
|
||||
background: Theme.bg-elevated;
|
||||
border-width: root.member.speaking ? 3px : 1px;
|
||||
border-color: root.member.speaking ? Theme.success : Theme.border;
|
||||
private property <length> avatar-size: Math.max(56px, Math.min(128px, root.height * 0.42));
|
||||
VerticalLayout {
|
||||
padding: 18px; spacing: 10px; alignment: center;
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
AvatarView {
|
||||
width: 80px; height: 80px;
|
||||
width: root.avatar-size; height: root.avatar-size;
|
||||
source: root.member.avatar; has-source: root.member.has_avatar;
|
||||
initials: root.member.avatar_text; mask: Theme.bg-elevated;
|
||||
speaking: root.member.speaking;
|
||||
}
|
||||
}
|
||||
Text { text: root.member.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.9375); font-weight: 600; horizontal-alignment: center; overflow: elide; }
|
||||
Text { text: root.member.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * (root.height > 240px ? 1.125 : 0.9375)); font-weight: 600; horizontal-alignment: center; overflow: elide; }
|
||||
Text { text: root.member.speaking ? @tr("Speaking") : @tr("In voice"); color: root.member.speaking ? Theme.success : Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-alignment: center; }
|
||||
}
|
||||
}
|
||||
|
|
@ -71,8 +74,19 @@ export component VoicePanel inherits Rectangle {
|
|||
in property <image> own-avatar;
|
||||
in property <bool> has-own-avatar;
|
||||
private property <length> gap: 14px;
|
||||
private property <int> columns: Math.max(1, Math.floor((grid.width + root.gap) / (210px + root.gap)));
|
||||
private property <length> card-width: (grid.width - (root.columns - 1) * root.gap) / root.columns;
|
||||
private property <int> count: root.members.length;
|
||||
private property <bool> alone: root.count == 1 && !root.joining;
|
||||
private property <int> wanted-columns: root.count <= 1 ? 1 : root.count <= 4 ? 2 : root.count <= 6 ? 3 : root.count <= 12 ? 4 : 5;
|
||||
private property <int> columns: Math.max(1, Math.min(root.wanted-columns, Math.floor((grid.width + root.gap) / (200px + root.gap))));
|
||||
private property <int> rows: Math.max(1, Math.ceil(root.count / root.columns));
|
||||
private property <int> used-columns: Math.max(1, Math.min(root.columns, root.count));
|
||||
private property <length> hint-height: root.alone ? 84px : 0px;
|
||||
private property <length> card-width: Math.min(root.count <= 1 ? 360px : 420px, (grid.width - (root.columns - 1) * root.gap) / root.columns);
|
||||
private property <length> card-height: Math.max(150px, Math.min(root.card-width * 0.72, (grid.height - root.hint-height - (root.rows - 1) * root.gap) / root.rows));
|
||||
private property <length> block-width: root.used-columns * root.card-width + (root.used-columns - 1) * root.gap;
|
||||
private property <length> block-height: root.rows * root.card-height + (root.rows - 1) * root.gap + root.hint-height;
|
||||
private property <length> origin-x: Math.max(0px, (grid.width - root.block-width) / 2);
|
||||
private property <length> origin-y: Math.max(0px, (grid.height - root.block-height) / 2);
|
||||
callback preview-screen();
|
||||
callback ptt-held(bool);
|
||||
callback toggle-mic();
|
||||
|
|
@ -94,17 +108,30 @@ export component VoicePanel inherits Rectangle {
|
|||
VerticalLayout {
|
||||
padding: 24px; spacing: 16px;
|
||||
grid := Flickable {
|
||||
vertical-stretch: 1;
|
||||
content-width: self.width;
|
||||
content-height: Math.max(self.height, Math.ceil(root.members.length / root.columns) * (170px + root.gap));
|
||||
content-height: Math.max(self.height, root.block-height);
|
||||
for member[index] in root.members: ParticipantCard {
|
||||
x: Math.mod(index, root.columns) * (root.card-width + root.gap);
|
||||
y: Math.floor(index / root.columns) * (170px + root.gap);
|
||||
width: root.card-width; height: 170px;
|
||||
x: root.origin-x + Math.mod(index, root.columns) * (root.card-width + root.gap);
|
||||
y: root.origin-y + Math.floor(index / root.columns) * (root.card-height + root.gap);
|
||||
width: root.card-width; height: root.card-height;
|
||||
member: member;
|
||||
own-avatar: root.own-avatar;
|
||||
has-own-avatar: root.has-own-avatar;
|
||||
}
|
||||
if root.members.length == 0 : Text { text: @tr("Joining voice…"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); }
|
||||
if root.count == 0 : Text {
|
||||
x: 0px; y: 0px; width: parent.width; height: parent.height;
|
||||
text: @tr("Joining voice…"); color: Theme.text-muted;
|
||||
font-size: Math.max(11px, Theme.font-size * 0.875);
|
||||
horizontal-alignment: center; vertical-alignment: center;
|
||||
}
|
||||
if root.alone : VerticalLayout {
|
||||
x: root.origin-x; y: root.origin-y + root.card-height + 20px;
|
||||
width: root.block-width; height: root.hint-height - 20px;
|
||||
spacing: 4px; alignment: start;
|
||||
Text { text: @tr("It's quiet in here"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.9375); font-weight: 600; horizontal-alignment: center; }
|
||||
Text { text: @tr("Invite friends to join this voice channel."); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); horizontal-alignment: center; wrap: word-wrap; }
|
||||
}
|
||||
}
|
||||
if root.push-to-talk : Rectangle {
|
||||
height: 46px; background: ptt-area.pressed ? Theme.voice-bg : Theme.bg-interactive;
|
||||
|
|
@ -126,14 +153,33 @@ export component VoicePanel inherits Rectangle {
|
|||
changed has-focus => { if !self.has-focus { root.ptt-held(false); } }
|
||||
}
|
||||
}
|
||||
Text { text: root.joining ? @tr("Joining voice…") : root.activity-banner; color: root.joining ? Theme.text-muted : Theme.success; font-size: Math.max(11px, Theme.font-size * 0.8125); height: 22px; horizontal-alignment: center; }
|
||||
HorizontalLayout {
|
||||
alignment: center; vertical-stretch: 0;
|
||||
Rectangle {
|
||||
height: dock-content.preferred-height;
|
||||
background: Theme.bg-elevated; border-radius: 28px;
|
||||
border-width: 1px; border-color: Theme.border;
|
||||
dock-content := VerticalLayout {
|
||||
padding-top: 12px; padding-bottom: 16px; padding-left: 28px; padding-right: 28px; spacing: 10px;
|
||||
Text {
|
||||
text: root.joining ? @tr("Joining voice…") : root.activity-banner;
|
||||
color: root.joining ? Theme.text-muted : Theme.success;
|
||||
font-size: Math.max(11px, Theme.font-size * 0.8125);
|
||||
min-height: Math.max(18px, Theme.font-size * 1.1);
|
||||
horizontal-alignment: center; vertical-alignment: center;
|
||||
accessible-role: text;
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: center; spacing: 14px;
|
||||
RoundControl { icon: root.mic-enabled ? "mic" : "mic-off"; off: !root.mic-enabled; tooltip: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); clicked => { root.toggle-mic(); } }
|
||||
RoundControl { icon: root.deafened ? "headphone-off" : "headphones"; off: root.deafened; tooltip: root.deafened ? @tr("Undeafen") : @tr("Deafen"); clicked => { root.toggle-deafen(); } }
|
||||
RoundControl { icon: "screen-share"; tooltip: @tr("Screen preview"); clicked => { root.preview-screen(); } }
|
||||
Rectangle { width: 6px; }
|
||||
RoundControl { icon: "phone-off"; leave: true; tooltip: @tr("Leave room"); clicked => { root.leave-voice(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -614,5 +614,69 @@ fn native_shell_keeps_drafts_settings_and_models_between_ticks() {
|
|||
assert!(!s.ui.showing_voice);
|
||||
assert_eq!(s.ui.mic_enabled, mic_before);
|
||||
}
|
||||
// Forum screens: real topic list, create form and an open topic with replies.
|
||||
{
|
||||
let mut s = state.borrow_mut();
|
||||
s.ui.active_channel = Some("forum".into());
|
||||
s.ui.active_guild_id = None;
|
||||
s.ui.browsing_dms = false;
|
||||
s.ui.showing_voice = false;
|
||||
s.ui.forum = ui::forum::ForumState::with_support(true);
|
||||
s.ui.forum.channel_id = Some("forum".into());
|
||||
s.ui.forum.joined = true;
|
||||
let author = |name: &str| net::wire::MemberInfo {
|
||||
user_id: format!("u-{name}"),
|
||||
nickname: name.into(),
|
||||
..Default::default()
|
||||
};
|
||||
s.ui.forum.topics = (1..=3)
|
||||
.map(|i| net::wire::ForumTopic {
|
||||
topic_id: format!("t{i}"),
|
||||
channel_id: "forum".into(),
|
||||
title: format!("Тема {i}: как настроить сервер"),
|
||||
author: Some(author("Локи")),
|
||||
created_at: 1_700_000_000_000,
|
||||
updated_at: 1_700_000_000_000,
|
||||
reply_count: i,
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
sync();
|
||||
assert!(window.get_show_forum());
|
||||
render(&window, &surface, "forum-topics");
|
||||
{
|
||||
let mut s = state.borrow_mut();
|
||||
s.ui.forum.create();
|
||||
s.ui.forum.edit_title("Новая тема".into());
|
||||
s.ui.forum.edit_body("Первое сообщение темы.".into());
|
||||
}
|
||||
sync();
|
||||
assert!(window.get_forum_creating());
|
||||
render(&window, &surface, "forum-create");
|
||||
{
|
||||
let mut s = state.borrow_mut();
|
||||
s.ui.forum.creating = false;
|
||||
s.ui.forum.topic_id = Some("t2".into());
|
||||
s.ui.forum.posts = (1..=2)
|
||||
.map(|i| net::wire::ForumPost {
|
||||
message: Some(net::wire::ChatMessage {
|
||||
message_id: format!("m{i}"),
|
||||
sender_id: "u-Локи".into(),
|
||||
content: format!("Ответ номер {i} в теме."),
|
||||
timestamp: 1_700_000_000_000,
|
||||
..Default::default()
|
||||
}),
|
||||
author: Some(net::wire::MemberInfo {
|
||||
user_id: "u-Локи".into(),
|
||||
nickname: "Локи".into(),
|
||||
..Default::default()
|
||||
}),
|
||||
topic_id: "t2".into(),
|
||||
ordinal: i,
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
sync();
|
||||
render(&window, &surface, "forum-topic-open");
|
||||
window.hide().unwrap();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,6 +280,9 @@ msgstr "Emoji"
|
|||
msgid "End-to-end encrypted"
|
||||
msgstr "End-to-end encrypted"
|
||||
|
||||
msgid "Enter a friend ID"
|
||||
msgstr "Enter a friend ID"
|
||||
|
||||
msgid "Enter a local .css path to import or export a theme."
|
||||
msgstr "Enter a local .css path to import or export a theme."
|
||||
|
||||
|
|
@ -319,6 +322,9 @@ msgstr "Friend ID"
|
|||
msgid "Friends"
|
||||
msgstr "Friends"
|
||||
|
||||
msgid "Friends are added by ID. Open Settings > Profile and keys, copy your own ID and share it, then paste a friend's ID above."
|
||||
msgstr "Friends are added by ID. Open Settings > Profile and keys, copy your own ID and share it, then paste a friend's ID above."
|
||||
|
||||
msgid "Gestures"
|
||||
msgstr "Gestures"
|
||||
|
||||
|
|
@ -376,9 +382,15 @@ msgstr "Installed version"
|
|||
msgid "Integration name"
|
||||
msgstr "Integration name"
|
||||
|
||||
msgid "Invite friends to join this voice channel."
|
||||
msgstr "Invite friends to join this voice channel."
|
||||
|
||||
msgid "It is shown once. Closing this window or hiding it removes it from the client."
|
||||
msgstr "It is shown once. Closing this window or hiding it removes it from the client."
|
||||
|
||||
msgid "It's quiet in here"
|
||||
msgstr "It's quiet in here"
|
||||
|
||||
msgid "Join"
|
||||
msgstr "Join"
|
||||
|
||||
|
|
@ -496,24 +508,24 @@ msgstr "New topic"
|
|||
msgid "No audio"
|
||||
msgstr "No audio"
|
||||
|
||||
msgid "No blocked users."
|
||||
msgstr "No blocked users."
|
||||
msgid "No blocked users"
|
||||
msgstr "No blocked users"
|
||||
|
||||
msgid "No friends yet. Add someone using their ID."
|
||||
msgstr "No friends yet. Add someone using their ID."
|
||||
msgid "No devices found - using default device"
|
||||
msgstr "No devices found - using default device"
|
||||
|
||||
msgid "No messages in this channel yet."
|
||||
msgstr "No messages in this channel yet."
|
||||
msgid "No friends yet"
|
||||
msgstr "No friends yet"
|
||||
|
||||
msgid "No messages yet. Say hello."
|
||||
msgstr "No messages yet. Say hello."
|
||||
|
||||
msgid "No new requests."
|
||||
msgstr "No new requests."
|
||||
|
||||
msgid "No passphrase"
|
||||
msgstr "No passphrase"
|
||||
|
||||
msgid "No pending requests"
|
||||
msgstr "No pending requests"
|
||||
|
||||
msgid "No saved servers yet."
|
||||
msgstr "No saved servers yet."
|
||||
|
||||
|
|
@ -523,12 +535,18 @@ msgstr "No topics yet. Start the first discussion."
|
|||
msgid "No webhooks yet. Add an integration below."
|
||||
msgstr "No webhooks yet. Add an integration below."
|
||||
|
||||
msgid "Nobody is online"
|
||||
msgstr "Nobody is online"
|
||||
|
||||
msgid "Noise suppression"
|
||||
msgstr "Noise suppression"
|
||||
|
||||
msgid "Noise suppression is not included in this build."
|
||||
msgstr "Noise suppression is not included in this build."
|
||||
|
||||
msgid "None of your friends are online right now. Check the All tab to message them anyway."
|
||||
msgstr "None of your friends are online right now. Check the All tab to message them anyway."
|
||||
|
||||
msgid "Nothing found"
|
||||
msgstr "Nothing found"
|
||||
|
||||
|
|
@ -580,6 +598,9 @@ msgstr "Outgoing events"
|
|||
msgid "Passphrase protected"
|
||||
msgstr "Passphrase protected"
|
||||
|
||||
msgid "Paste a friend's ID"
|
||||
msgstr "Paste a friend's ID"
|
||||
|
||||
msgid "Paste image"
|
||||
msgstr "Paste image"
|
||||
|
||||
|
|
@ -661,6 +682,9 @@ msgstr "Repeat backup passphrase"
|
|||
msgid "Repeat passphrase"
|
||||
msgstr "Repeat passphrase"
|
||||
|
||||
msgid "Replies: {}"
|
||||
msgstr "Replies: {}"
|
||||
|
||||
msgid "Reply"
|
||||
msgstr "Reply"
|
||||
|
||||
|
|
@ -784,6 +808,9 @@ msgstr "Share audio"
|
|||
msgid "Short tones for voice rooms, messages and connection changes. They stay silent while you are deafened."
|
||||
msgstr "Short tones for voice rooms, messages and connection changes. They stay silent while you are deafened."
|
||||
|
||||
msgid "Show all friends"
|
||||
msgstr "Show all friends"
|
||||
|
||||
msgid "Sign in through browser"
|
||||
msgstr "Sign in through browser"
|
||||
|
||||
|
|
@ -877,6 +904,9 @@ msgstr "This cannot be undone."
|
|||
msgid "This is the first connection to this server. Its certificate is not issued by a public authority, so Vnox cannot verify it automatically. Compare the fingerprint with the one published by the server owner and trust it only if they match."
|
||||
msgstr "This is the first connection to this server. Its certificate is not issued by a public authority, so Vnox cannot verify it automatically. Compare the fingerprint with the one published by the server owner and trust it only if they match."
|
||||
|
||||
msgid "This is the start of the channel. Send the first message below."
|
||||
msgstr "This is the start of the channel. Send the first message below."
|
||||
|
||||
msgid "This server does not support forums yet."
|
||||
msgstr "This server does not support forums yet."
|
||||
|
||||
|
|
@ -889,6 +919,9 @@ msgstr "Trust and connect"
|
|||
msgid "Trust this server?"
|
||||
msgstr "Trust this server?"
|
||||
|
||||
msgid "Type an address above and choose Save address to keep it here for next time."
|
||||
msgstr "Type an address above and choose Save address to keep it here for next time."
|
||||
|
||||
msgid "Undeafen"
|
||||
msgstr "Undeafen"
|
||||
|
||||
|
|
@ -970,6 +1003,15 @@ msgstr "Webhook secret"
|
|||
msgid "Webhooks"
|
||||
msgstr "Webhooks"
|
||||
|
||||
msgid "Welcome to #{}"
|
||||
msgstr "Welcome to #{}"
|
||||
|
||||
msgid "When someone sends you their friend request, it will show up here for you to accept or decline."
|
||||
msgstr "When someone sends you their friend request, it will show up here for you to accept or decline."
|
||||
|
||||
msgid "You haven't blocked anyone. Blocked people will be listed here."
|
||||
msgstr "You haven't blocked anyone. Blocked people will be listed here."
|
||||
|
||||
msgid "Your display name"
|
||||
msgstr "Your display name"
|
||||
|
||||
|
|
@ -985,6 +1027,9 @@ msgstr "Your keys on this device are protected by a passphrase."
|
|||
msgid "Your microphone transmits when speech is detected."
|
||||
msgstr "Your microphone transmits when speech is detected."
|
||||
|
||||
msgid "Your own ID is in Settings > Profile and keys. Copy it and share it, or paste a friend's ID here."
|
||||
msgstr "Your own ID is in Settings > Profile and keys. Copy it and share it, or paste a friend's ID here."
|
||||
|
||||
msgid "Your preview appears here after you choose a source."
|
||||
msgstr "Your preview appears here after you choose a source."
|
||||
|
||||
|
|
@ -1015,6 +1060,3 @@ msgstr[1] "{n} participants"
|
|||
|
||||
msgid "{} kbps"
|
||||
msgstr "{} kbps"
|
||||
|
||||
msgid "{} replies"
|
||||
msgstr "{} replies"
|
||||
|
|
|
|||
|
|
@ -529,5 +529,92 @@
|
|||
"Use a server name of 1–100 characters and a description of at most 2000 characters.": "Название сервера: 1–100 символов, описание: не более 2000 символов.",
|
||||
"Voice": "Голосовой",
|
||||
"Your reply": "Ваш ответ",
|
||||
"{} replies": "Ответов: {}"
|
||||
"Paste a friend's ID": "Вставь ID друга",
|
||||
"Your own ID is in Settings > Profile and keys. Copy it and share it, or paste a friend's ID here.": "Твой ID находится в Настройки > Профиль и ключи. Скопируй его и поделись или вставь сюда ID друга.",
|
||||
"No friends yet": "Друзей пока нет",
|
||||
"Friends are added by ID. Open Settings > Profile and keys, copy your own ID and share it, then paste a friend's ID above.": "Друзья добавляются по ID. Открой Настройки > Профиль и ключи, скопируй свой ID и поделись им, затем вставь ID друга выше.",
|
||||
"Enter a friend ID": "Ввести ID друга",
|
||||
"Nobody is online": "Сейчас никого нет в сети",
|
||||
"None of your friends are online right now. Check the All tab to message them anyway.": "Никто из друзей сейчас не в сети. Открой вкладку «Все», чтобы всё равно написать им.",
|
||||
"Show all friends": "Показать всех друзей",
|
||||
"No pending requests": "Нет входящих запросов",
|
||||
"When someone sends you their friend request, it will show up here for you to accept or decline.": "Когда кто-то отправит тебе запрос в друзья, он появится здесь, и ты сможешь принять или отклонить его.",
|
||||
"No blocked users": "Заблокированных нет",
|
||||
"You haven't blocked anyone. Blocked people will be listed here.": "Ты никого не блокировал. Заблокированные пользователи появятся здесь.",
|
||||
"Invite friends to join this voice channel.": "Пригласи друзей в этот голосовой канал.",
|
||||
"It's quiet in here": "Здесь тихо",
|
||||
"No devices found - using default device": "Устройства не найдены — используется устройство по умолчанию",
|
||||
"This is the start of the channel. Send the first message below.": "Это начало канала. Отправь первое сообщение ниже.",
|
||||
"Type an address above and choose Save address to keep it here for next time.": "Введи адрес выше и нажми «Сохранить адрес», чтобы он остался здесь.",
|
||||
"Welcome to #{}": "Добро пожаловать в #{}",
|
||||
"Replies: {}": "Ответов: {}",
|
||||
"Loading image…": "Загружаю изображение…",
|
||||
"Decoding image…": "Декодирую изображение…",
|
||||
"Preview cache is full. Open another channel to release images.": "Кеш превью заполнен. Открой другой канал, чтобы освободить память.",
|
||||
"Image unavailable: {error}": "Изображение недоступно: {error}",
|
||||
"Image request timed out": "Время ожидания изображения истекло",
|
||||
"Image queue is full": "Очередь изображений заполнена",
|
||||
"Cannot paste image: {error}": "Не удалось вставить изображение: {error}",
|
||||
"Wait for the current image operation to finish.": "Дождись завершения текущей операции с изображением.",
|
||||
"Image attachments are available in channels. You can send an HTTPS image link here.": "Вложения-изображения доступны в каналах. Здесь можно отправить ссылку на изображение по HTTPS.",
|
||||
"Preparing image…": "Готовлю изображение…",
|
||||
"Select the original channel and connect before sending this image.": "Выбери исходный канал и подключись, прежде чем отправлять это изображение.",
|
||||
"Sending image…": "Отправляю изображение…",
|
||||
"Image ready. Send it to this channel or cancel.": "Изображение готово. Отправь его в этот канал или отмени.",
|
||||
"Image delivery could not be confirmed. Check the channel before retrying.": "Не удалось подтвердить доставку изображения. Проверь канал, прежде чем повторять.",
|
||||
"Image dimensions exceed the 4096 px / 4 megapixel limit": "Размеры изображения превышают лимит: 4096 пикселей / 4 мегапикселя",
|
||||
"Image must be no larger than 16 MiB": "Изображение должно быть не больше 16 МиБ",
|
||||
"Unsupported image": "Неподдерживаемое изображение",
|
||||
"Use PNG, JPEG, WebP or GIF": "Используй PNG, JPEG, WebP или GIF",
|
||||
"Invalid image header": "Некорректный заголовок изображения",
|
||||
"GIF exceeds the animation limit (120 frames / 64 MiB preview / 128 megapixels decoded)": "GIF превышает лимит анимации (120 кадров / 64 МиБ превью / 128 мегапикселей после распаковки)",
|
||||
"Invalid GIF frame": "Некорректный кадр GIF",
|
||||
"GIF has no frames": "В GIF нет кадров",
|
||||
"Invalid image data": "Некорректные данные изображения",
|
||||
"Only public HTTPS image URLs on port 443 are allowed": "Разрешены только публичные HTTPS-ссылки на изображения через порт 443",
|
||||
"Private or reserved image address is blocked": "Частный или зарезервированный адрес изображения заблокирован",
|
||||
"Image download timed out": "Время загрузки изображения истекло",
|
||||
"Invalid image URL": "Некорректная ссылка на изображение",
|
||||
"Image URL has no hostname": "В ссылке на изображение нет имени хоста",
|
||||
"Image DNS lookup timed out": "Время DNS-запроса для изображения истекло",
|
||||
"Too many image redirects": "Слишком много перенаправлений изображения",
|
||||
"Image redirect has no location": "В перенаправлении изображения нет адреса",
|
||||
"Invalid image redirect": "Некорректное перенаправление изображения",
|
||||
"Image exceeds 16 MiB": "Изображение больше 16 МиБ",
|
||||
"Image response is empty": "Ответ с изображением пуст",
|
||||
"Cannot open clipboard": "Не удалось открыть буфер обмена",
|
||||
"Clipboard has no image": "В буфере обмена нет изображения",
|
||||
"Invalid clipboard image data": "Некорректные данные изображения в буфере обмена",
|
||||
"Clipboard image exceeds 3 MiB; choose a smaller image": "Изображение из буфера больше 3 МиБ; выбери поменьше",
|
||||
"Image server returned {status}": "Сервер изображений ответил: {status}",
|
||||
"Enter a title (1–160 characters) and a first message (1–16000 characters).": "Введи заголовок (1–160 символов) и первое сообщение (1–16000 символов).",
|
||||
"Enter a reply (1–16000 characters).": "Введи ответ (1–16000 символов).",
|
||||
"The forum request timed out. Your draft has been kept; refresh or retry.": "Время ожидания запроса к форуму истекло. Черновик сохранён; обнови или повтори.",
|
||||
"The server refused this forum request.": "Сервер отклонил этот запрос к форуму.",
|
||||
"The server returned an invalid forum response.": "Сервер вернул некорректный ответ форума.",
|
||||
"The server did not acknowledge this forum message.": "Сервер не подтвердил это сообщение форума.",
|
||||
"invalid forum request": "Некорректный запрос к форуму.",
|
||||
"forum support was not negotiated": "Поддержка форумов не согласована с сервером.",
|
||||
"request_id and channel_id are required": "Нужны идентификаторы запроса и канала.",
|
||||
"forum offset is too large": "Слишком большое смещение списка форума.",
|
||||
"unsupported forum operation": "Это действие на форуме не поддерживается.",
|
||||
"forum not found": "Форум не найден.",
|
||||
"session not found": "Сессия не найдена.",
|
||||
"forum requests are too frequent": "Слишком много запросов к форуму. Подожди немного.",
|
||||
"valid topic_id is required": "Нужен корректный идентификатор темы.",
|
||||
"topic not found in this forum": "В этом форуме нет такой темы.",
|
||||
"topic/message UUIDs, title (1–160) and body (1–16000 characters, 64 KiB maximum) are required": "Нужны идентификаторы темы и сообщения, заголовок (1–160 символов) и текст (1–16000 символов, не больше 64 КиБ).",
|
||||
"topic/message UUIDs and body (1–16000 characters, 64 KiB maximum) are required": "Нужны идентификаторы темы и сообщения и текст (1–16000 символов, не больше 64 КиБ).",
|
||||
"forum operation failed or mutation IDs conflict; no unrelated message was changed": "Действие на форуме не выполнено или идентификаторы конфликтуют. Посторонние сообщения не изменены.",
|
||||
"image dimensions exceed limits": "Размеры изображения превышают допустимые.",
|
||||
"GIF animation exceeds limits": "GIF-анимация превышает допустимые пределы.",
|
||||
"invalid attachment request": "Некорректный запрос вложения.",
|
||||
"channel not found": "Канал не найден.",
|
||||
"image attachments require a text channel": "Изображения можно отправлять только в текстовые каналы.",
|
||||
"guild membership required": "Нужно быть участником сообщества.",
|
||||
"MESSAGE_SEND permission required": "Нет права отправлять сообщения.",
|
||||
"image request rate limit reached": "Слишком много запросов изображений. Подожди немного.",
|
||||
"could not save image message": "Не удалось сохранить сообщение с изображением.",
|
||||
"image not found": "Изображение не найдено.",
|
||||
"Could not process the image: {detail}": "Не удалось обработать изображение: {detail}"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,6 +281,9 @@ msgstr "Эмодзи"
|
|||
msgid "End-to-end encrypted"
|
||||
msgstr "Сквозное шифрование"
|
||||
|
||||
msgid "Enter a friend ID"
|
||||
msgstr "Ввести ID друга"
|
||||
|
||||
msgid "Enter a local .css path to import or export a theme."
|
||||
msgstr "Введи локальный путь к .css, чтобы импортировать тему или сохранить её в файл."
|
||||
|
||||
|
|
@ -320,6 +323,9 @@ msgstr "ID друга"
|
|||
msgid "Friends"
|
||||
msgstr "Друзья"
|
||||
|
||||
msgid "Friends are added by ID. Open Settings > Profile and keys, copy your own ID and share it, then paste a friend's ID above."
|
||||
msgstr "Друзья добавляются по ID. Открой Настройки > Профиль и ключи, скопируй свой ID и поделись им, затем вставь ID друга выше."
|
||||
|
||||
msgid "Gestures"
|
||||
msgstr "Жесты"
|
||||
|
||||
|
|
@ -377,9 +383,15 @@ msgstr "Установленная версия"
|
|||
msgid "Integration name"
|
||||
msgstr "Название интеграции"
|
||||
|
||||
msgid "Invite friends to join this voice channel."
|
||||
msgstr "Пригласи друзей в этот голосовой канал."
|
||||
|
||||
msgid "It is shown once. Closing this window or hiding it removes it from the client."
|
||||
msgstr "Секрет показывается один раз. После закрытия окна или скрытия он удаляется из клиента."
|
||||
|
||||
msgid "It's quiet in here"
|
||||
msgstr "Здесь тихо"
|
||||
|
||||
msgid "Join"
|
||||
msgstr "Войти"
|
||||
|
||||
|
|
@ -497,24 +509,24 @@ msgstr "Новая тема"
|
|||
msgid "No audio"
|
||||
msgstr "Без звука"
|
||||
|
||||
msgid "No blocked users."
|
||||
msgstr "Список блокировок пуст."
|
||||
msgid "No blocked users"
|
||||
msgstr "Заблокированных нет"
|
||||
|
||||
msgid "No friends yet. Add someone using their ID."
|
||||
msgstr "Список друзей пока пуст. Добавь друга по его ID."
|
||||
msgid "No devices found - using default device"
|
||||
msgstr "Устройства не найдены — используется устройство по умолчанию"
|
||||
|
||||
msgid "No messages in this channel yet."
|
||||
msgstr "В этом канале пока нет сообщений."
|
||||
msgid "No friends yet"
|
||||
msgstr "Друзей пока нет"
|
||||
|
||||
msgid "No messages yet. Say hello."
|
||||
msgstr "Сообщений пока нет. Напиши первым."
|
||||
|
||||
msgid "No new requests."
|
||||
msgstr "Новых запросов нет."
|
||||
|
||||
msgid "No passphrase"
|
||||
msgstr "Без пароля"
|
||||
|
||||
msgid "No pending requests"
|
||||
msgstr "Нет входящих запросов"
|
||||
|
||||
msgid "No saved servers yet."
|
||||
msgstr "Сохранённых серверов пока нет."
|
||||
|
||||
|
|
@ -524,12 +536,18 @@ msgstr "Тем пока нет. Начните первое обсуждение
|
|||
msgid "No webhooks yet. Add an integration below."
|
||||
msgstr "Вебхуков пока нет. Добавьте интеграцию ниже."
|
||||
|
||||
msgid "Nobody is online"
|
||||
msgstr "Сейчас никого нет в сети"
|
||||
|
||||
msgid "Noise suppression"
|
||||
msgstr "Шумоподавление"
|
||||
|
||||
msgid "Noise suppression is not included in this build."
|
||||
msgstr "Шумоподавление недоступно в этой сборке."
|
||||
|
||||
msgid "None of your friends are online right now. Check the All tab to message them anyway."
|
||||
msgstr "Никто из друзей сейчас не в сети. Открой вкладку «Все», чтобы всё равно написать им."
|
||||
|
||||
msgid "Nothing found"
|
||||
msgstr "Ничего не найдено"
|
||||
|
||||
|
|
@ -581,6 +599,9 @@ msgstr "Исходящие события"
|
|||
msgid "Passphrase protected"
|
||||
msgstr "Защищено паролем"
|
||||
|
||||
msgid "Paste a friend's ID"
|
||||
msgstr "Вставь ID друга"
|
||||
|
||||
msgid "Paste image"
|
||||
msgstr "Вставить изображение"
|
||||
|
||||
|
|
@ -662,6 +683,9 @@ msgstr "Повтори пароль копии"
|
|||
msgid "Repeat passphrase"
|
||||
msgstr "Повтори пароль"
|
||||
|
||||
msgid "Replies: {}"
|
||||
msgstr "Ответов: {}"
|
||||
|
||||
msgid "Reply"
|
||||
msgstr "Ответить"
|
||||
|
||||
|
|
@ -785,6 +809,9 @@ msgstr "Звук демонстрации"
|
|||
msgid "Short tones for voice rooms, messages and connection changes. They stay silent while you are deafened."
|
||||
msgstr "Короткие сигналы для голосовых комнат, сообщений и смены состояния связи. Пока звук выключен, они молчат."
|
||||
|
||||
msgid "Show all friends"
|
||||
msgstr "Показать всех друзей"
|
||||
|
||||
msgid "Sign in through browser"
|
||||
msgstr "Войти через браузер"
|
||||
|
||||
|
|
@ -878,6 +905,9 @@ msgstr "Это действие нельзя отменить."
|
|||
msgid "This is the first connection to this server. Its certificate is not issued by a public authority, so Vnox cannot verify it automatically. Compare the fingerprint with the one published by the server owner and trust it only if they match."
|
||||
msgstr "Это первое подключение к этому серверу. Его сертификат выдан не публичным центром сертификации, поэтому Vnox не может проверить его автоматически. Сравни отпечаток с тем, что опубликовал владелец сервера, и доверяй, только если они совпадают."
|
||||
|
||||
msgid "This is the start of the channel. Send the first message below."
|
||||
msgstr "Это начало канала. Отправь первое сообщение ниже."
|
||||
|
||||
msgid "This server does not support forums yet."
|
||||
msgstr "Этот сервер пока не поддерживает форумы."
|
||||
|
||||
|
|
@ -890,6 +920,9 @@ msgstr "Доверять и подключиться"
|
|||
msgid "Trust this server?"
|
||||
msgstr "Доверять этому серверу?"
|
||||
|
||||
msgid "Type an address above and choose Save address to keep it here for next time."
|
||||
msgstr "Введи адрес выше и нажми «Сохранить адрес», чтобы он остался здесь."
|
||||
|
||||
msgid "Undeafen"
|
||||
msgstr "Включить звук"
|
||||
|
||||
|
|
@ -971,6 +1004,15 @@ msgstr "Секрет вебхука"
|
|||
msgid "Webhooks"
|
||||
msgstr "Вебхуки"
|
||||
|
||||
msgid "Welcome to #{}"
|
||||
msgstr "Добро пожаловать в #{}"
|
||||
|
||||
msgid "When someone sends you their friend request, it will show up here for you to accept or decline."
|
||||
msgstr "Когда кто-то отправит тебе запрос в друзья, он появится здесь, и ты сможешь принять или отклонить его."
|
||||
|
||||
msgid "You haven't blocked anyone. Blocked people will be listed here."
|
||||
msgstr "Ты никого не блокировал. Заблокированные пользователи появятся здесь."
|
||||
|
||||
msgid "Your display name"
|
||||
msgstr "Ваше отображаемое имя"
|
||||
|
||||
|
|
@ -986,6 +1028,9 @@ msgstr "Ключи на этом устройстве защищены паро
|
|||
msgid "Your microphone transmits when speech is detected."
|
||||
msgstr "Микрофон передаёт звук, когда обнаружен голос."
|
||||
|
||||
msgid "Your own ID is in Settings > Profile and keys. Copy it and share it, or paste a friend's ID here."
|
||||
msgstr "Твой ID находится в Настройки > Профиль и ключи. Скопируй его и поделись или вставь сюда ID друга."
|
||||
|
||||
msgid "Your preview appears here after you choose a source."
|
||||
msgstr "После выбора источника здесь появится предпросмотр."
|
||||
|
||||
|
|
@ -1018,6 +1063,3 @@ msgstr[2] "{n} участников"
|
|||
|
||||
msgid "{} kbps"
|
||||
msgstr "{} кбит/с"
|
||||
|
||||
msgid "{} replies"
|
||||
msgstr "Ответов: {}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue