diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bfc1b5..5243923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,36 +12,36 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - `vnox-e2e-voice` now needs `--fingerprint HEX` or `--trust-first-use`. - Design and trust model: VNOX-Server `docs/02-protocol/tls.md`. -### Added — Phase 2 guild member list + identity export/import + channel rate limit (fourth batch) +### Added - Phase 2 guild member list + identity export/import + channel rate limit (fourth batch) #### Phase 2 guild member list with kick / role-assign UI (Phase E4) - **New PacketIds:** `GuildMemberListFetch` (0x010E), `GuildMemberList` (0x010F), `GuildRoleAssign` (0x0110), `GuildRoleUnassign` (0x0111), `GuildRoleListFetch` (0x0112), `GuildRoleList` (0x0113). - **New storage methods:** - - `Storage::list_guild_members(guild_id)` — returns each member's nickname, joined_at, highest-role color + name (via SQL subqueries on `member_roles`/`roles`). - - `Storage::assign_role(guild_id, user_id, role_id)` — idempotent insert into `member_roles`. + - `Storage::list_guild_members(guild_id)` - returns each member's nickname, joined_at, highest-role color + name (via SQL subqueries on `member_roles`/`roles`). + - `Storage::assign_role(guild_id, user_id, role_id)` - idempotent insert into `member_roles`. - `Storage::remove_role_from_user(guild_id, user_id, role_id)`. - - `Storage::list_guild_roles(guild_id)` — full role rows with permissions + position. + - `Storage::list_guild_roles(guild_id)` - full role rows with permissions + position. - **New gateway handlers:** `handle_member_list_fetch`, `handle_role_assign`, `handle_role_unassign`, `handle_role_list_fetch`. - Role assign/unassign require `MANAGE_ROLES` permission (or owner bypass) and append to the audit log. - **Client wiring:** `NetCommand::{GuildMemberListFetch, GuildRoleAssign, GuildRoleUnassign, GuildRoleListFetch}` + `NetEvent::{GuildMemberList, GuildRoleList}` + dispatch + UI handling. -- **👥 button in guild bar** — opens the guild members modal (disabled when no guild is selected). On open, fetches both member list and role list in parallel. +- **👥 button in guild bar** - opens the guild members modal (disabled when no guild is selected). On open, fetches both member list and role list in parallel. - **Guild members modal:** - Member rows with role-colored avatar ring + nickname + role name + truncated user ID. - 👑 crown indicator for the guild owner. - - 👢 kick button (hidden for owner) — calls `GuildMemberKick` and auto-refreshes the list after 200 ms. - - "+ role" combo — lists all guild roles; clicking a role name calls `GuildRoleAssign`. + - 👢 kick button (hidden for owner) - calls `GuildMemberKick` and auto-refreshes the list after 200 ms. + - "+ role" combo - lists all guild roles; clicking a role name calls `GuildRoleAssign`. - ↻ refresh button. - "N members" header with close button. #### Phase 2 server-side channel rate limit (Phase E6) - `handle_channel_create` now consumes a token from the per-session rate limiter (same bucket as chat/DM messages). - - When exceeded, replies `ErrorPayload{ RateLimited }` with message "slow down — too many channel operations". + - When exceeded, replies `ErrorPayload{ RateLimited }` with message "slow down - too many channel operations". - Bumps `rate_limited_events_total` counter. - Default channels ("general", "voice") remain protected from deletion (already in place from previous batch). #### Phase 2 identity export / import to keyfile (Phase E7) -- **`identity::export_keyfile(identity, passphrase)`** — serializes the identity to JSON, seals it with the same Argon2id + ChaCha20-Poly1305 scheme as the on-disk vault, returns the keyfile JSON string. Passphrase is optional (empty = plain JSON). -- **`identity::import_keyfile(keyfile_json, passphrase)`** — opens a keyfile and returns the deserialized identity (without persisting — caller calls `save()` separately). +- **`identity::export_keyfile(identity, passphrase)`** - serializes the identity to JSON, seals it with the same Argon2id + ChaCha20-Poly1305 scheme as the on-disk vault, returns the keyfile JSON string. Passphrase is optional (empty = plain JSON). +- **`identity::import_keyfile(keyfile_json, passphrase)`** - opens a keyfile and returns the deserialized identity (without persisting - caller calls `save()` separately). - **Export keyfile modal** in Settings → Identity: - Optional passphrase + confirm field (with mismatch check). - "Generate keyfile" button produces the JSON output. @@ -51,48 +51,48 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - **Import keyfile modal:** - Multiline paste area for the keyfile JSON. - Optional passphrase field. - - "Import & Replace Identity" button — calls `import_keyfile` + `save(identity, None)`. + - "Import & Replace Identity" button - calls `import_keyfile` + `save(identity, None)`. - Warning that the current identity will be replaced; restart required. - New `UiState` fields: `export_keyfile_open`, `export_keyfile_pass`, `export_keyfile_confirm`, `export_keyfile_output`, `export_keyfile_error`, `import_keyfile_open`, `import_keyfile_input`, `import_keyfile_pass`, `import_keyfile_error`. ### Build verification -- `cargo clippy --workspace` — 0 warnings. -- `cargo test --workspace` — 41/41 tests pass. +- `cargo clippy --workspace` - 0 warnings. +- `cargo test --workspace` - 41/41 tests pass. -### Added — Phase 2 server-side channels + identity vault UI + audit log (third batch, kept for history) +### Added - Phase 2 server-side channels + identity vault UI + audit log (third batch, kept for history) #### Phase 2 server-side channel management -- **`ChannelCreate` packet (0x0033)** — register a new channel in the gateway's channel store. +- **`ChannelCreate` packet (0x0033)** - register a new channel in the gateway's channel store. - Validates `kind` ("text" or "voice"); rejects empty `channel_id`. - Returns `ChannelState` to the creator and broadcasts `ChannelCreate` to all other sessions. - Returns `ErrorPayload{ ChannelNotFound }` (reused code) if a channel with the same id exists. -- **`ChannelDelete` packet (0x0034)** — remove a channel from the store. +- **`ChannelDelete` packet (0x0034)** - remove a channel from the store. - Protects default channels ("general", "voice") with `PermissionDenied`. - Broadcasts `ChannelDelete` to all sessions; client removes it from sidebar and clears cached messages. -- **`ChannelList` packet (0x0035)** — fetch all known channels. Client replaces its local list with the server-authoritative one (preserving member lists for channels already joined). +- **`ChannelList` packet (0x0035)** - fetch all known channels. Client replaces its local list with the server-authoritative one (preserving member lists for channels already joined). - New `channels::create` / `channels::delete` / `channels::list` ops on the gateway. - Client wiring: `NetCommand::{ChannelCreate, ChannelDelete, ChannelList}` + `NetEvent::{ChannelCreated, ChannelDeleted, ChannelListEvent}` + dispatch + UI handling. -- **Channel create popup** now sends `ChannelCreate` to the gateway instead of adding locally — sidebar updates come back through the broadcast. -- **Channel delete context menu** — right-click any non-default channel in the sidebar to delete it. +- **Channel create popup** now sends `ChannelCreate` to the gateway instead of adding locally - sidebar updates come back through the broadcast. +- **Channel delete context menu** - right-click any non-default channel in the sidebar to delete it. #### Phase 2 identity vault UI - **Set-passphrase modal** in Settings → Identity: - Two passphrase fields with match check + min-8-char warning. - Calls `identity::save(identity, Some(passphrase))` to encrypt the keypair at rest with Argon2id + ChaCha20-Poly1305. - Shows error messages on save failure. -- **Remove-passphrase modal** — type `REMOVE` to confirm; calls `identity::save(identity, None)` to revert to plain JSON. -- **Vault status block** — shows current encryption state (🔒 encrypted / 🔓 plain) with explanatory text. -- **Copy pubkey button** — copies the hex pubkey to clipboard via `egui::Context::copy_text`. +- **Remove-passphrase modal** - type `REMOVE` to confirm; calls `identity::save(identity, None)` to revert to plain JSON. +- **Vault status block** - shows current encryption state (🔒 encrypted / 🔓 plain) with explanatory text. +- **Copy pubkey button** - copies the hex pubkey to clipboard via `egui::Context::copy_text`. - New `UiState` fields: `vault_set_open`, `vault_remove_open`, `vault_passphrase_input`, `vault_passphrase_confirm`, `vault_error`. #### Phase 2 audit log viewer -- **`GuildAuditLogFetch` packet (0x010C)** — admin-only endpoint; requires `MANAGE_GUILD` permission (or owner). +- **`GuildAuditLogFetch` packet (0x010C)** - admin-only endpoint; requires `MANAGE_GUILD` permission (or owner). - Returns last 50 audit log entries (clamped 1..=200) via `GuildAuditLogPayload`. -- New storage method `Storage::get_audit_log(guild_id, limit)` — newest first. +- New storage method `Storage::get_audit_log(guild_id, limit)` - newest first. - Client wiring: `NetCommand::GuildAuditLogFetch`, `NetEvent::GuildAuditLog`, dispatch, `UiState.audit_log_entries`. -- **📋 button in guild bar** — opens the audit log modal for the active guild (disabled when no guild is selected). -- **Audit log modal** — scrollable list of entries with: +- **📋 button in guild bar** - opens the audit log modal for the active guild (disabled when no guild is selected). +- **Audit log modal** - scrollable list of entries with: - Action-specific icons (🏗 create, 🗑 delete, 👢 kick, 🏷 role, 🔗 invite, ✓ accept). - Actor ID (truncated to 8 hex chars), target ID, reason (italic). - Relative timestamp ("2m ago", "3h ago", "5d ago"). @@ -104,25 +104,25 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Build verification (third batch) -- `cargo clippy --workspace` — 0 warnings. -- `cargo test --workspace` — 41/41 tests pass. +- `cargo clippy --workspace` - 0 warnings. +- `cargo test --workspace` - 41/41 tests pass. -### Added — Phase 2 hardening + Phase 1.3 polish (second batch, kept for history) +### Added - Phase 2 hardening + Phase 1.3 polish (second batch, kept for history) #### Phase 2 server hardening - **Admin HTTP server (axum) on gateway.** Default bind `0.0.0.0:7601`, configurable via `[gateway] admin_bind`. - - `GET /health` — JSON `{status, uptime_seconds, node, address, private_mode}` for orchestrator liveness probes. - - `GET /version` — `{name, version, lnex_version}`. - - `GET /metrics` — Prometheus text exposition format v0.0.4 with counters/gauges for messages, DMs, voice packets, connections, auth failures, rate-limited events, errors, guilds, friends requests, sessions, channels, uptime. + - `GET /health` - JSON `{status, uptime_seconds, node, address, private_mode}` for orchestrator liveness probes. + - `GET /version` - `{name, version, lnex_version}`. + - `GET /metrics` - Prometheus text exposition format v0.0.4 with counters/gauges for messages, DMs, voice packets, connections, auth failures, rate-limited events, errors, guilds, friends requests, sessions, channels, uptime. - **Per-session token-bucket rate limiting** on chat and DM messages. - Configurable via `[gateway] message_rate_per_sec` (default 5) and `message_rate_burst` (default 10). - When a session exceeds the limit, server replies `ErrorPayload{ code: RateLimited }` and bumps `rate_limited_events_total` counter. - Idle buckets are pruned on session disconnect via `RateLimiter::remove()`. - **Prometheus metrics module** (`gateway/src/admin/metrics.rs`) with lock-free atomic counters shared across all session tasks. -- **`ensure_column` idempotent migration helper** — adds new SQLite columns on existing databases without dropping data. Used to add `messages.reply_to` for the reply feature. +- **`ensure_column` idempotent migration helper** - adds new SQLite columns on existing databases without dropping data. Used to add `messages.reply_to` for the reply feature. #### Phase 2 identity security -- **Encrypted identity vault** (`client/src/identity_vault.rs`) — Argon2id passphrase + ChaCha20-Poly1305 AEAD. +- **Encrypted identity vault** (`client/src/identity_vault.rs`) - Argon2id passphrase + ChaCha20-Poly1305 AEAD. - Vault format: `{version, scheme, salt, nonce, ciphertext, plaintext}` (JSON). - When passphrase is set, identity is encrypted at rest with Argon2id (m=64 MiB, t=3, p=4) for KDF + ChaCha20-Poly1305 AEAD. - When passphrase is empty, falls back to plain JSON (legacy behavior preserved). @@ -132,11 +132,11 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). #### Phase 1.3 chat UX - **Message context menu** (right-click on any message row): - - Quick-reactions row (👍 ❤️ 😂 🎉 👀 🤔) — toggles reaction on click. - - Reply — sets `replying_to` state, preview bar shown above chat input. - - Copy text — copies message content to clipboard via `egui::Context::copy_text`. - - Edit (own messages only) — fills chat input with current content, switches to edit mode. - - Delete (own messages only) — sends MessageDelete to gateway. + - Quick-reactions row (👍 ❤️ 😂 🎉 👀 🤔) - toggles reaction on click. + - Reply - sets `replying_to` state, preview bar shown above chat input. + - Copy text - copies message content to clipboard via `egui::Context::copy_text`. + - Edit (own messages only) - fills chat input with current content, switches to edit mode. + - Delete (own messages only) - sends MessageDelete to gateway. - **Reply feature** end-to-end: - Wire protocol: `ChatMessagePayload.reply_to: Option` (optional message_id). - DB schema: `messages.reply_to TEXT` column (added via `ensure_column` migration). @@ -160,10 +160,10 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - Auto-fetches block list on first open of the Blocked tab. #### Phase 1.3 per-user speaking attribution -- **Voice packet protocol extended** — plaintext now includes `[sender_id:32]` (raw Ed25519 pubkey) between channel_id and opus data. +- **Voice packet protocol extended** - plaintext now includes `[sender_id:32]` (raw Ed25519 pubkey) between channel_id and opus data. - `voice::build_packet()` accepts `sender_pubkey: &[u8; 32]`. - `voice::spawn_recv()` parses sender_id and emits hex-encoded `sender_id` in `NetEvent::VoicePacket`. - - Legacy packets (no sender_id) gracefully handled — empty `sender_id` string. + - Legacy packets (no sender_id) gracefully handled - empty `sender_id` string. - Unit test `build_packet_header_layout` updated to verify sender_id roundtrip. - **Per-user speaking indicator in voice panel**: - `last_remote_speaker_id` field on `UiState`, updated on every received voice packet. @@ -172,7 +172,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - Speaker ID decays after 500 ms of silence (driven by `remote_speaking(500)`). #### Phase 1.3 channel creation UI -- **"Create a Channel" popup** — accessible from the channel list header via the "+" button. +- **"Create a Channel" popup** - accessible from the channel list header via the "+" button. - Input: channel name (free text). - Type selector: Text (`#`) or Voice (`🔊`). - Creates the channel in the local `s.channels` list so it appears in the sidebar immediately. @@ -180,20 +180,20 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Fixed -- **NetEvent dispatch bug (from previous commit):** `GuildMemberKicked`, `InviteCreated/Accepted/Deleted`, `RoleCreated/Deleted` were silently dropped — now routed to `social::handle`. +- **NetEvent dispatch bug (from previous commit):** `GuildMemberKicked`, `InviteCreated/Accepted/Deleted`, `RoleCreated/Deleted` were silently dropped - now routed to `social::handle`. - **`FriendAccepted` handler (from previous commit):** now uses `user_id` and adds the friend to the list. - **PID collision:** `PID_FRIEND_EVENT` was 0x0155, conflicting with server `BlockUser=0x0155`. Renumbered: `BlockUser=0x0155`, `UnblockUser=0x0156`, `BlockList=0x0157`, `FriendEvent=0x0158`. - **PresenceUpdate wire format mismatch:** client was sending `{custom_status, activity}` but server expected `{activity_type, activity_text}`. Now the client serializes `activity_type`/`activity_text`/`custom_status` correctly, matching the gateway's `PresenceUpdatePayload`. ### Documentation -- `docs/00-status.md` and `docs/06-roadmap.md` updated in previous commit — Phase 1.1/1.2/1.3 marked DONE where implemented. +- `docs/00-status.md` and `docs/06-roadmap.md` updated in previous commit - Phase 1.1/1.2/1.3 marked DONE where implemented. - `CHANGELOG.md` expanded with all new entries. ### Build verification (second batch) -- `cargo clippy --workspace` — 0 warnings. -- `cargo test --workspace` — 41/41 tests pass (22 in client lib incl. new rate_limit + vault tests, 10 in gateway, 9 in voice-node). +- `cargo clippy --workspace` - 0 warnings. +- `cargo test --workspace` - 41/41 tests pass (22 in client lib incl. new rate_limit + vault tests, 10 in gateway, 9 in voice-node). ## [0.1.0] - 2025-05-21 diff --git a/Cargo.toml b/Cargo.toml index 48b8241..18f54db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ exclude = ["patches/*"] [package] name = "vnox-client" -description = "VNOX native desktop client — Slint, chat and voice" +description = "VNOX native desktop client - Slint, chat and voice" version = "0.1.0" edition = "2024" license = "GPL-3.0" diff --git a/README.md b/README.md index 72787cb..3ea82cb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# VNOX — Client +# VNOX - Client > Native desktop client for VNOX. Voice, text, no cloud. @@ -10,12 +10,12 @@ ## What is this? -The official desktop client for [VNOX](https://github.com/loki5512344/Vnox) — a self-hosted voice and text communication platform. Connects to a VNOX server over the LNEx protocol. +The official desktop client for [VNOX](https://github.com/loki5512344/Vnox) - a self-hosted voice and text communication platform. Connects to a VNOX server over the LNEx protocol. - Connects to gateway via **TCP** (text, auth, channels, guilds, DMs) - Connects to voice node via **UDP** (encrypted Opus voice packets) - Opus audio encoding/decoding with adaptive jitter buffer -- Native UI built with **Slint** — no Electron, no web views +- Native UI built with **Slint** - no Electron, no web views --- @@ -73,13 +73,13 @@ See [docs/00-status.md](docs/00-status.md) for a full breakdown. Linux builds also need audio/protocol prerequisites and FreeType/fontconfig development libraries (`libfreetype6-dev libfontconfig1-dev` on Ubuntu); native file selection uses the desktop portal. ```bash -# Terminal 1 — gateway +# Terminal 1 - gateway cargo run -p vnox-gateway -- --config dev/config.toml -# Terminal 2 — voice node +# Terminal 2 - voice node cargo run -p vnox-voice-node -- --config dev/config.toml -# Terminal 3 — client +# Terminal 3 - client cargo run -p vnox-client ``` @@ -87,7 +87,7 @@ The client connects to `127.0.0.1:7600` by default. You can change the address i ### Opus on Windows -`audiopus_sys` builds libopus from source via CMake. CMake 4.x policy flag is already set in `.cargo/config.toml` — no manual steps needed. +`audiopus_sys` builds libopus from source via CMake. CMake 4.x policy flag is already set in `.cargo/config.toml` - no manual steps needed. --- @@ -129,5 +129,5 @@ src/ ## License -Client code: **GPL-3.0** — see [LICENSE](LICENSE) +Client code: **GPL-3.0** - see [LICENSE](LICENSE) LNEx protocol specification: **CC0** (public domain) diff --git a/docs/04-clients/README.md b/docs/04-clients/README.md index 15e07a4..9c49759 100644 --- a/docs/04-clients/README.md +++ b/docs/04-clients/README.md @@ -14,6 +14,6 @@ and has direct access to audio hardware without browser sandboxing. ## Clients -- [desktop.md](desktop.md) — primary client, Windows / macOS / Linux -- [mobile.md](mobile.md) — Phase 3, stack TBD -- [overlay.md](overlay.md) — in-game HUD, Phase 2 +- [desktop.md](desktop.md) - primary client, Windows / macOS / Linux +- [mobile.md](mobile.md) - Phase 3, stack TBD +- [overlay.md](overlay.md) - in-game HUD, Phase 2 diff --git a/docs/04-clients/design-system.md b/docs/04-clients/design-system.md index 0b82a46..a62a7e3 100644 --- a/docs/04-clients/design-system.md +++ b/docs/04-clients/design-system.md @@ -1,4 +1,4 @@ -# VNOX Client — Design System +# VNOX Client - Design System > Based on Hi-Fi Minimalism v2.0 > Adapted for: native desktop voice/chat client (Rust + egui + wgpu) @@ -25,32 +25,32 @@ gamer RGB · Discord clone · neon cyberpunk · glassmorphism · corporate SaaS ## Color Tokens ```css -/* Backgrounds — layered, never pure black */ +/* Backgrounds - layered, never pure black */ --bg-base: #0d0d0d; /* root, titlebar */ ---bg-surface: #151515; /* panels, sidebars (was #111111 — lifted for panel contrast) */ ---bg-elevated: #1d1d1d; /* inputs, cards (was #141414 — lifted for depth) */ +--bg-surface: #151515; /* panels, sidebars (was #111111 - lifted for panel contrast) */ +--bg-elevated: #1d1d1d; /* inputs, cards (was #141414 - lifted for depth) */ --bg-interactive: #2a2a2a; /* hover targets, dropdowns */ -/* Borders — lifted significantly for visual hierarchy */ +/* Borders - lifted significantly for visual hierarchy */ --border-subtle: #1c1c1c; /* was #171717 */ ---border-default: #262626; /* was #1e1e1e — now actually visible */ +--border-default: #262626; /* was #1e1e1e - now actually visible */ --border-strong: #2e2e2e; --border-accent: rgba(255, 107, 53, 0.20); -/* Accent — warm orange */ +/* Accent - warm orange */ --accent: #ff6b35; --accent-hover: #ff844f; --accent-active: #e85d04; --accent-10: rgba(255, 107, 53, 0.08); --accent-20: rgba(255, 107, 53, 0.15); -/* Text — warm, never pure white */ +/* Text - warm, never pure white */ --text-primary: #f4c89a; /* main content (added) */ --text-secondary: #c88b5a; /* names, labels */ --text-muted: #8a6a52; /* secondary info */ --text-dim: #6a4a2a; /* hints, timestamps */ ---text-ghost: #5a422c; /* section labels, separators (was #3d2e20 — lifted) */ ---text-invisible: #443222; /* near-invisible, decorative (was #2d1e12 — lifted) */ +--text-ghost: #5a422c; /* section labels, separators (was #3d2e20 - lifted) */ +--text-invisible: #443222; /* near-invisible, decorative (was #2d1e12 - lifted) */ /* Semantic */ --success: #7cb87a; /* online, connected, low latency */ @@ -67,7 +67,7 @@ gamer RGB · Discord clone · neon cyberpunk · glassmorphism · corporate SaaS ## Typography -Клиент использует **только monospace**. Это намеренно — усиливает ощущение инструмента. +Клиент использует **только monospace**. Это намеренно - усиливает ощущение инструмента. ``` Primary font: IBM Plex Mono @@ -98,13 +98,13 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase ### Title bar (34px) -- Background: `--bg-strip` (`theme::BG_STRIP`); **без отдельной painter-linии** под всю ширину — переход «titlebar ↔ контент» только за счёт контраста `--bg-strip` vs `--bg-base`. Раньше 1px `hline` воспринимался как случайная полоска «под логотипом» из-за состыковки с левым rail. +- Background: `--bg-strip` (`theme::BG_STRIP`); **без отдельной painter-linии** под всю ширину - переход «titlebar ↔ контент» только за счёт контраста `--bg-strip` vs `--bg-base`. Раньше 1px `hline` воспринимался как случайная полоска «под логотипом» из-за состыковки с левым rail. - Сетка из **трёх равных колонок**: - - **левая** — **`[ prefs ]`** + **`VNOX`** (wordmark `--text-primary`, слева направо после prefs); - - **центр** — статус ноды: **`●`** + **`NODE: …`** (`OFFLINE` / `CONNECTING` / имя ноды), **по центру средней колонки** (= визуальный центр окна); - - **правая** — **transport‑подсказка** справа: `transport: idle` · `transport: connecting…` · `transport: quic/v1`. -- Вход в настройки: **`[ prefs ]`** — явная консольная кнопка (без нестабильных Unicode‑иконок); при открытых настройках тот же текст, цвет **accent**. Дубль: кнопка **open prefs** в нижней левой колонке, **только пока offline**. -- Нативный заголовок ОС (**taskbar / список окон**) — короткий **`Vnox`**, чтобы не дублировать тот же wordmark **`VNOX`** внутри клиента. + - **левая** - **`[ prefs ]`** + **`VNOX`** (wordmark `--text-primary`, слева направо после prefs); + - **центр** - статус ноды: **`●`** + **`NODE: …`** (`OFFLINE` / `CONNECTING` / имя ноды), **по центру средней колонки** (= визуальный центр окна); + - **правая** - **transport‑подсказка** справа: `transport: idle` · `transport: connecting…` · `transport: quic/v1`. +- Вход в настройки: **`[ prefs ]`** - явная консольная кнопка (без нестабильных Unicode‑иконок); при открытых настройках тот же текст, цвет **accent**. Дубль: кнопка **open prefs** в нижней левой колонке, **только пока offline**. +- Нативный заголовок ОС (**taskbar / список окон**) - короткий **`Vnox`**, чтобы не дублировать тот же wordmark **`VNOX`** внутри клиента. ### Структура окна @@ -128,10 +128,10 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase - Ширина **52px**, фон `--bg-strip`, как верхний titlebar для визуальной связности. - Заголовок колонки: **SERVERS** (8px, `--text-ghost`, центрируется по ширине rail). -- Плитки **30×30px**, скругление 5px, **строго центрируются** по горизонтали (без случайной короткой линии‑разделителя посередине — она давала эффект «криво» в узком rail). +- Плитки **30×30px**, скругление 5px, **строго центрируются** по горизонтали (без случайной короткой линии‑разделителя посередине - она давала эффект «криво» в узком rail). - **Idle** (нет активной закладки): рамка 1px `--border-faint`, подпись `···` во внутреннем поле, tooltip объясняет «подключайся через Connect». - **Активная нода**: 2 символа аббревиатуры, `--accent` левый акцент 2px внутри плитки, `--accent-10` фон. -- **«+»**: только одна вторичная плита внизу; tooltip — «bookmark позже». +- **«+»**: только одна вторичная плита внизу; tooltip - «bookmark позже». ### Node switcher (legacy note) @@ -139,7 +139,7 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase ### Channel list (208px) -- Node info (верх): имя ноды 12px semibold + `lnex://nc.` 9px `--text-ghost` при коннекте; офлайн — одна строка **not connected** +- Node info (верх): имя ноды 12px semibold + `lnex://nc.` 9px `--text-ghost` при коннекте; офлайн - одна строка **not connected** - Section labels: 9px uppercase, `--text-ghost`, letter-spacing 0.12em - Channel item: 4px 12px padding, gap 6px (icon + name) - Default: `--text-ghost` @@ -152,7 +152,7 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase ``` [ open prefs ] (только пока offline) -— voice ~ channel 00:42 +- voice ~ channel 00:42 [x] microphone [x] hear others [YU] you @@ -160,10 +160,10 @@ Letter spacing для section labels: `0.10–0.12em`, text-transform: uppercase ``` - **Не показывать** фиктивный RTT (например «12ms»), если нет реального измерения. -- **Не дублировать** протокольную строку вида `LNEx v1 · udp` под ником — перегружает и налезает на аватар/текст; протокол раскрывается в Connect / docs. -- Настройки **не** прячем в ряд мелких иконок у ника: основной вход — **`[ prefs ]`** в title bar; офлайн — компактная кнопка **open prefs**. +- **Не дублировать** протокольную строку вида `LNEx v1 · udp` под ником - перегружает и налезает на аватар/текст; протокол раскрывается в Connect / docs. +- Настройки **не** прячем в ряд мелких иконок у ника: основной вход - **`[ prefs ]`** в title bar; офлайн - компактная кнопка **open prefs**. - В голосе: чекбоксы **microphone** / **hear others** (без эмодзи/символов, которые на части шрифтов дают «квадратики»). -- Avatar: 32×32px, radius 6px, disabled button (только визуал), self — `--accent-10` + border. +- Avatar: 32×32px, radius 6px, disabled button (только визуал), self - `--accent-10` + border. ### Main area @@ -228,9 +228,9 @@ thumb: 10px circle, --accent, subtle glow ``` Size variants: - sm — 24×24px, border-radius 5px (identity bar) - md — 26×26px, border-radius 6px (member list) - lg — 36×36px, border-radius 8px (identity card in settings) + sm - 24×24px, border-radius 5px (identity bar) + md - 26×26px, border-radius 6px (member list) + lg - 36×36px, border-radius 8px (identity card in settings) Default: bg --bg-elevated, border --border-default, color --text-muted Self: bg --accent-10, border --border-accent, color --accent @@ -246,7 +246,7 @@ display: flex + ::before/::after lines in --border-subtle Examples: ● connected · nightcore.lnex · LNEx v1 - — today — + - today - ``` --- @@ -288,7 +288,7 @@ dot 5px --accent, box-shadow 0 0 6px rgba(255,107,53,0.5) ``` ┌─────────────────────────────────────────────────────┐ -│ titlebar — [prefs]* │ VNOX │ … │ +│ titlebar - [prefs]* │ VNOX │ … │ │ открыть настройки: клик [prefs]; обратный маршрут │ │ тот же, пока приложение показывает settings screen │ ├──────────────────────────────────────────────────────┤ @@ -328,12 +328,12 @@ dot 5px --accent, box-shadow 0 0 6px rgba(255,107,53,0.5) ## Motion ``` -duration-instant: 80ms — toggle, dot -duration-fast: 120ms — hover color change -duration-base: 150ms — toggle thumb, panel transitions -duration-slow: 250ms — page switch in settings +duration-instant: 80ms - toggle, dot +duration-fast: 120ms - hover color change +duration-base: 150ms - toggle thumb, panel transitions +duration-slow: 250ms - page switch in settings -ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего +ease: cubic-bezier(0.0, 0.0, 0.2, 1) - ease-out для всего ``` Никаких scale transforms на hover. Только: @@ -352,7 +352,7 @@ ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего | Отдельная 1px линия на всю ширину только под titlebar (стек с rail = «случайная полоска») | Отделение только контрастом `--bg-strip` / `--bg-base`; линии локально там, где группируешь контент | | Круглые аватары | Квадратные с border-radius 5–8px | | Sidebar с серверами как у Discord (72px, круглые) | Узкий rail **52px**, квадратные плитки **30×30**, аббревиатура, заголовок **SERVERS** | -| Панель участников справа как у Discord | Нет отдельной панели, участники — в боковом списке | +| Панель участников справа как у Discord | Нет отдельной панели, участники - в боковом списке | | Neon glow на элементах | Subtle glow max 0.18 opacity | | Pure black backgrounds | Минимум #0a0a0a | | Pure white text | Максимум #f4c89a | @@ -364,7 +364,7 @@ ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего ## Noise Texture -Лёгкий шум поверх всего интерфейса — добавляет аналоговое ощущение. +Лёгкий шум поверх всего интерфейса - добавляет аналоговое ощущение. ```css .root::after { @@ -389,12 +389,20 @@ ease: cubic-bezier(0.0, 0.0, 0.2, 1) — ease-out для всего Палитра допустимых цветов (тёплая, совместимая с системой): ``` -#c88b5a — warm amber (default / self) -#6a9ecf — steel blue -#7cb87a — warm green -#c49a6c — sand -#b07cc6 — muted purple -#d4876a — terracotta +#c88b5a - warm amber (default / self) +#6a9ecf - steel blue +#7cb87a - warm green +#c49a6c - sand +#b07cc6 - muted purple +#d4876a - terracotta ``` Не используются: яркие/neon цвета, холодные синие, чистый белый/красный. + +## Icons, avatars and emoji in the Slint client + +- Icons are Lucide SVG files in `src/ui/slint/assets/icons/`, drawn by `Symbol` and tinted with the theme colours. Do not draw icons from text characters or hand written paths. Licenses are listed in `docs/THIRD_PARTY.md`. +- Icon-only buttons set `text` as their accessible label and tooltip (`ActionButton { icon: "mic"; text: "Mute microphone"; }`). Use `labeled: true` to show the text next to the icon and `primary: true` for the one accent coloured action of a view. +- Every avatar in the app is an `AvatarView` (user panel, messages, members, voice cards, friends, settings). Pass the surface colour behind it as `mask`. +- A `FocusScope` placed above a `TouchArea` must set `focus-on-click: false`, otherwise it swallows the first click and controls only react from the second one. The `ui_smoke` test sends real pointer events to guard this. +- Emoji come from bundled Noto Emoji images (`src/ui/emoji/`), because Slint draws emoji characters in text with a monochrome fallback glyph. The picker and reaction chips use the images. diff --git a/docs/04-clients/desktop.md b/docs/04-clients/desktop.md index 0b14121..7060227 100644 --- a/docs/04-clients/desktop.md +++ b/docs/04-clients/desktop.md @@ -85,9 +85,9 @@ Full specification: `docs/04-clients/design-system.md` Key decisions: - monospace font throughout (IBM Plex Mono) - warm dark palette (`#0d0d0d` base, `#ff6b35` accent) -- no round server icons — square with abbreviation, 40px sidebar +- no round server icons - square with abbreviation, 40px sidebar - latency indicator bottom-left, next to identity -- no separate member list panel — voice users shown inline in channel list +- no separate member list panel - voice users shown inline in channel list --- diff --git a/docs/04-clients/mobile.md b/docs/04-clients/mobile.md index ac01905..973d996 100644 --- a/docs/04-clients/mobile.md +++ b/docs/04-clients/mobile.md @@ -1,6 +1,6 @@ # Mobile Client -> Status: Phase 3 — not yet started. +> Status: Phase 3 - not yet started. > This document tracks intentions and open questions. --- @@ -14,7 +14,7 @@ Not a PWA. Not a wrapper around the desktop client. ### UI framework -egui on mobile is not practical today — touch input support is limited, +egui on mobile is not practical today - touch input support is limited, and the immediate mode model doesn't map well to mobile interaction patterns. Candidates under consideration: diff --git a/docs/04-clients/overlay.md b/docs/04-clients/overlay.md index 2f108b1..446d773 100644 --- a/docs/04-clients/overlay.md +++ b/docs/04-clients/overlay.md @@ -1,6 +1,6 @@ # Overlay -> Status: Phase 2 — design draft. +> Status: Phase 2 - design draft. The VNOX overlay renders a HUD on top of running games and applications, showing voice channel state without alt-tabbing. @@ -50,7 +50,7 @@ For games that support it, the overlay can receive additional data: ### Positional voice (Phase 4) Games that expose player position data can send it to VNOX, -enabling positional audio — players hear each other based on +enabling positional audio - players hear each other based on in-game distance and direction. Integration methods: diff --git a/docs/05-features/admin-panel.md b/docs/05-features/admin-panel.md index 0a56a7c..febb4d6 100644 --- a/docs/05-features/admin-panel.md +++ b/docs/05-features/admin-panel.md @@ -1,4 +1,4 @@ -# Admin Panel — Design +# Admin Panel - Design > Target: Phase 1.1 (core) → Phase 1.2 (guilds, roles) → Phase 2 (plugins, bot permissions) @@ -6,11 +6,11 @@ | Layer | Config file (TOML) | Admin panel (GUI) | |-------|-------------------|-------------------| -| **Infrastructure** | `bind`, `ports`, `data_dir`, TLS certs | — | +| **Infrastructure** | `bind`, `ports`, `data_dir`, TLS certs | - | | **Node identity** | `name`, `address` | Display only | -| **Storage** | `backend`, `sqlite_path`, `retention` | — | +| **Storage** | `backend`, `sqlite_path`, `retention` | - | | **Security** | federation gate, rate limits, session timeout | Ban list, mute, kick | -| **Runtime state** | — | Channels, roles, members, invites, audit log | +| **Runtime state** | - | Channels, roles, members, invites, audit log | | **Plugins** | Plugin enable/disable | Permission keys, commands | **Rule of thumb:** If it needs a server restart → TOML. If it can apply live → GUI. @@ -24,22 +24,22 @@ Designed for both built-in actions and plugin/bot commands (inspired by LuckPerm ### Built-in permission keys ``` -vnox.admin.manage_channels — create, edit, delete channels -vnox.admin.manage_roles — create, edit, delete roles -vnox.admin.manage_members — kick, ban, mute, timeout -vnox.admin.manage_invites — create, delete invites -vnox.admin.manage_guild — edit guild name, icon, settings -vnox.admin.view_audit_log — read audit log +vnox.admin.manage_channels - create, edit, delete channels +vnox.admin.manage_roles - create, edit, delete roles +vnox.admin.manage_members - kick, ban, mute, timeout +vnox.admin.manage_invites - create, delete invites +vnox.admin.manage_guild - edit guild name, icon, settings +vnox.admin.view_audit_log - read audit log -vnox.channel.read — view channel -vnox.channel.send — send messages -vnox.channel.voice_connect — join voice channel -vnox.channel.voice_speak — speak in voice (push-to-talk) -vnox.channel.voice_mute_members — server-mute others +vnox.channel.read - view channel +vnox.channel.send - send messages +vnox.channel.voice_connect - join voice channel +vnox.channel.voice_speak - speak in voice (push-to-talk) +vnox.channel.voice_mute_members - server-mute others -vnox.dm.send — send direct messages -vnox.friend.request — send friend requests -vnox.presence.view — see online status +vnox.dm.send - send direct messages +vnox.friend.request - send friend requests +vnox.presence.view - see online status ``` ### Custom permission keys (plugin/bot commands) @@ -47,24 +47,24 @@ vnox.presence.view — see online status Plugins register their permissions at load time via the RPC API: ``` -mybot.command.greet — /greet command -mybot.command.play — /play music -mybot.command.ban_override — override sub-command +mybot.command.greet - /greet command +mybot.command.play - /play music +mybot.command.ban_override - override sub-command ``` **Wildcard support:** ``` -vnox.admin.* — all admin permissions -vnox.channel.* — all channel permissions -mybot.* — all commands from mybot -* — everything (owner only) +vnox.admin.* - all admin permissions +vnox.channel.* - all channel permissions +mybot.* - all commands from mybot +* - everything (owner only) ``` ### How it works ``` ┌──────────────────────────────────────────────────┐ -│ Role Editor — "Moderator" │ +│ Role Editor - "Moderator" │ ├──────────────────────────────────────────────────┤ │ Permission keys: │ │ │ @@ -91,14 +91,14 @@ mybot.* — all commands from mybot ``` **Resolution order (highest priority wins):** -1. Owner — overrides everything -2. Channel override (user-specific) — allow/deny -3. Channel override (role-specific) — allow/deny +1. Owner - overrides everything +2. Channel override (user-specific) - allow/deny +3. Channel override (role-specific) - allow/deny 4. Role hierarchy (top role has higher priority) 5. @everyone default 6. Server-wide default -Each override is `(allow_mask, deny_mask)` — deny always beats allow at the same level. +Each override is `(allow_mask, deny_mask)` - deny always beats allow at the same level. ### Database @@ -184,10 +184,10 @@ Server Settings → Channels → [+ Add] Double-click channel or right-click → "Edit Channel". Same modal pre-filled, plus: -- **Name change** — updates slug -- **Category change** — moves channel -- **Drag position** — reorder inside category -- **Delete** — with confirmation (soft delete in DB) +- **Name change** - updates slug +- **Category change** - moves channel +- **Drag position** - reorder inside category +- **Delete** - with confirmation (soft delete in DB) ### Drag & Drop @@ -363,7 +363,7 @@ PID 0x00A2 GUILD_TRANSFER client → gateway (owner only) } ``` -**ADMIN_UPDATE_CHANNEL (0x0072) — includes position changes via drag & drop:** +**ADMIN_UPDATE_CHANNEL (0x0072) - includes position changes via drag & drop:** ```json { "channel_id": "uuid", @@ -390,7 +390,7 @@ Gateway checks: 2. Is user in guild? → 403 if no 3. Does user have vnox.admin.manage_channels? - Resolve role hierarchy - - Check channel_overrides (none — new channel) + - Check channel_overrides (none - new channel) - Check wildcards (vnox.admin.*) - Owner override → 403 if no │ diff --git a/docs/05-features/central-hub.md b/docs/05-features/central-hub.md index cf684c5..89abf28 100644 --- a/docs/05-features/central-hub.md +++ b/docs/05-features/central-hub.md @@ -1,4 +1,4 @@ -# Central Hub — опциональный координационный сервер +# Central Hub - опциональный координационный сервер ## Мотивация @@ -6,12 +6,12 @@ VNOX спроектирован как self-hosted платформа: кажд Но для adoption нужна точка входа для тех, у кого нет своего сервера, и механизм обнаружения публичных нодов. -Central Hub — опциональный сервер, который **не заменяет** собственный нод +Central Hub - опциональный сервер, который **не заменяет** собственный нод и **не хостит** голос/чат. Он только координирует. ## Что делает Central Hub -### 1. Discovery / Registry — реестр публичных нодов +### 1. Discovery / Registry - реестр публичных нодов Владельцы нодов могут опубликовать свой сервер в реестре: - адрес, название, описание, регион @@ -19,19 +19,19 @@ Central Hub — опциональный сервер, который **не з - мета: онлайне, кол-во пользователей Клиент может найти сервер по тегам/названию и подключиться. -Без Central Hub — только прямой ввод адреса или закладки. +Без Central Hub - только прямой ввод адреса или закладки. -### 2. Global identity bridge — аккаунт без своего нода +### 2. Global identity bridge - аккаунт без своего нода Пользователь регистрирует ключ на Central Hub: -- `user@hub` — глобальный идентификатор +- `user@hub` - глобальный идентификатор - никнейм, аватар (опционально) - привязка к одному или нескольким "гостевым" нодам Позволяет зайти в VNOX без поднятия собственной инфраструктуры. При этом Central Hub не хранит сообщения, не релеит голос, не управляет каналами. -### 3. Push notification relay — поддержка мобильных +### 3. Push notification relay - поддержка мобильных Мобильные клиенты не могут держать постоянное TCP/UDP соединение. Central Hub принимает пуш-уведомления от нодов: @@ -41,7 +41,7 @@ Central Hub принимает пуш-уведомления от нодов: Без этого мобильный клиент будет получать сообщения только с задержками. -### 4. User directory / friend graph — глобальная социальная сеть +### 4. User directory / friend graph - глобальная социальная сеть Список друзей и поиск пользователей не привязан к одному ноду: - `@user` ищется по Central Hub @@ -53,13 +53,13 @@ Central Hub принимает пуш-уведомления от нодов: - ❌ Не хостит голосовые каналы - ❌ Не хостит текстовые каналы - ❌ Не хранит историю сообщений -- ❌ Не управляет сессиями — только направляет -- ❌ Не заменяет self-hosted нод — только дополняет +- ❌ Не управляет сессиями - только направляет +- ❌ Не заменяет self-hosted нод - только дополняет -Hub — это телефонная книга и коммутатор, а не сам телефон. +Hub - это телефонная книга и коммутатор, а не сам телефон. ## Деплой -Central Hub — отдельный бинарник (например, `vnox-hub`). +Central Hub - отдельный бинарник (например, `vnox-hub`). Работает на HTTP(S) / WebSocket, минимальные требования. Может быть поднят кем угодно, не обязательно авторами VNOX. diff --git a/docs/05-features/custom-emoji-stickers.md b/docs/05-features/custom-emoji-stickers.md index ff54b0e..a859677 100644 --- a/docs/05-features/custom-emoji-stickers.md +++ b/docs/05-features/custom-emoji-stickers.md @@ -15,7 +15,7 @@ Three related but distinct features: | **Stickers** | 512×512 max | PNG, GIF, WebP, Lottie† | Per-guild + per-user | Server filesystem | | **GIF Picker** | External | GIF (Tenor/Giphy API) | Per-server config | Proxy via server | -† Lottie — future, not Phase 2. +† Lottie - future, not Phase 2. ### Difference from unicode reactions @@ -171,7 +171,7 @@ Server sends on guild join. Client caches locally. } ``` -Image bytes are NOT included — client lazy-loads via `EMOJI_DATA` + `EMOJI_DATA_RESP`. +Image bytes are NOT included - client lazy-loads via `EMOJI_DATA` + `EMOJI_DATA_RESP`. ### EMOJI_ADD (0x0071) @@ -205,7 +205,7 @@ Server removes file + DB row, broadcasts `EMOJI_UPDATE` with `deleted: true`. ### EMOJI_DATA / EMOJI_DATA_RESP (0x0078/0x0079) -Lazy-load pattern — client requests image bytes when first rendering an emoji. +Lazy-load pattern - client requests image bytes when first rendering an emoji. Request: ```json @@ -408,36 +408,36 @@ When two nodes federate: ### GIF proxy GIF search always goes through the user's home node. -The server proxies to Tenor/Giphy — no federation needed for GIF results (they're just URLs). +The server proxies to Tenor/Giphy - no federation needed for GIF results (they're just URLs). --- ## Migration Path -### Phase 1.3 — Unicode reactions only +### Phase 1.3 - Unicode reactions only - `message_reactions` table (already designed) - Unicode emoji picker in client - No custom emoji, no stickers, no GIF -### Phase 2 — Custom emoji +### Phase 2 - Custom emoji - Add `guild_emojis` table - Add packet types 0x0070–0x0073, 0x0078–0x0079 - Client emoji picker with custom tab - Admin upload/delete UI - No federation support yet -### Phase 2 — Stickers +### Phase 2 - Stickers - Add `guild_stickers` + `user_stickers` tables - Add packet types 0x0074–0x0077 - Sticker panel in client - New message content_type: "sticker" -### Phase 2 — GIF picker +### Phase 2 - GIF picker - Add Tenor/Giphy config to gateway - Add packet types 0x0080–0x0081 - GIF picker widget in client - Server-side proxy (API key protection) -### Phase 3 — Federation +### Phase 3 - Federation - Cross-node emoji/sticker sync - `@node` suffix in references diff --git a/docs/05-features/direct-messages.md b/docs/05-features/direct-messages.md index ed7fb0f..b19d790 100644 --- a/docs/05-features/direct-messages.md +++ b/docs/05-features/direct-messages.md @@ -1,4 +1,4 @@ -# Direct Messages — Phase 1.1 +# Direct Messages - Phase 1.1 ## Goal diff --git a/docs/05-features/private-mode.md b/docs/05-features/private-mode.md index 692974c..2f6ad80 100644 --- a/docs/05-features/private-mode.md +++ b/docs/05-features/private-mode.md @@ -1,4 +1,4 @@ -# Private Mode — Phase 1.1 +# Private Mode - Phase 1.1 ## Goal @@ -81,4 +81,4 @@ if !config.federation.enabled { | `private` | Fully isolated. Like OwnCord. Safe for personal LAN/ home server. | | `federated` | Can discover, peer, and sync with other VNOX nodes. Like Matrix. | -Default is `private` — opt-in to federation. +Default is `private` - opt-in to federation. diff --git a/docs/05-features/slint-migration.md b/docs/05-features/slint-migration.md index 66cb8b7..a292f3d 100644 --- a/docs/05-features/slint-migration.md +++ b/docs/05-features/slint-migration.md @@ -1,4 +1,4 @@ -# Slint UI Migration — Phase 1.1 +# Slint UI Migration - Phase 1.1 ## Current state @@ -18,23 +18,23 @@ Desktop client uses **egui** (immediate-mode GUI). Functional but: | Chat app fit | ❌ feel | ✅ modern | ✅ modern | | Learning curve | Low | Medium | Medium | -**Recommendation:** Slint — declarative DSL makes UI easier to iterate, +**Recommendation:** Slint - declarative DSL makes UI easier to iterate, built-in design system produces professional look out of the box. ## Migration strategy -### Stage 1 — Side-by-side (week 1) +### Stage 1 - Side-by-side (week 1) - Embed Slint canvas alongside existing egui panels - Rewrite sidebar (server list + channel list) in Slint first - Keep chat area in egui - Verify data flow works between both frameworks -### Stage 2 — Chat panel (week 2) +### Stage 2 - Chat panel (week 2) - Rewrite channel chat (text messages + input bar) in Slint - Rewrite voice panel in Slint - Remove egui chat dependency -### Stage 3 — Settings & polish (week 3) +### Stage 3 - Settings & polish (week 3) - Rewrite settings window in Slint - Add dark/light theme toggle - Add accent color picker @@ -102,7 +102,7 @@ client/src/ui/ ## Open questions -- Slint's rendering backend (gl/winit/software) — test on all target platforms +- Slint's rendering backend (gl/winit/software) - test on all target platforms - Slint's text input / rich text support for chat messages (emoji, markdown?) - Whether to remove egui entirely or keep for specific panels (e.g. overlay) - Licensing: Slint is LGPL (compatible with GPL-3.0 for now, but check for future) diff --git a/docs/05-features/video-screen-audit.md b/docs/05-features/video-screen-audit.md index 453a4f1..4e2daeb 100644 --- a/docs/05-features/video-screen-audit.md +++ b/docs/05-features/video-screen-audit.md @@ -1,4 +1,4 @@ -# Video, Camera & Screen Share — Design Audit +# Video, Camera & Screen Share - Design Audit > Audits `docs/05-features/video.md` against the current codebase and roadmap. > Each gap has: problem, recommendation, priority, target file. @@ -12,19 +12,19 @@ But critical details are missing for actual implementation. This audit fills tho --- -## 1. Video-node — Integration with existing architecture +## 1. Video-node - Integration with existing architecture -### Gap 1.1 — Video-node lifecycle +### Gap 1.1 - Video-node lifecycle -**Problem:** `video.md` says "separate binary or embedded in voice-node" but doesn't decide. Voice-node has just been refactored with jitter buffer — video needs the same relay pattern. +**Problem:** `video.md` says "separate binary or embedded in voice-node" but doesn't decide. Voice-node has just been refactored with jitter buffer - video needs the same relay pattern. **Recommendation:** Separate binary (`vnox-video-node`). Video frames are fundamentally different from voice packets (keyframes, fragmentation, higher bandwidth). Keeping them separate avoids coupling and allows independent scaling. -**Priority:** P0 — must decide before writing a line of code. +**Priority:** P0 - must decide before writing a line of code. -**Target:** `video.md` — add "Deployment" section. +**Target:** `video.md` - add "Deployment" section. -### Gap 1.2 — Channel membership signalling +### Gap 1.2 - Channel membership signalling **Problem:** Video-node needs to know which users are in which channel. Currently this is managed by gateway. How does video-node learn membership? @@ -40,27 +40,27 @@ But critical details are missing for actual implementation. This audit fills tho } ``` -**Priority:** P0 — video relay can't work without knowing recipients. +**Priority:** P0 - video relay can't work without knowing recipients. -**Target:** `video.md` — add "Gateway integration" section. +**Target:** `video.md` - add "Gateway integration" section. -### Gap 1.3 — No encryption spec +### Gap 1.3 - No encryption spec -**Problem:** Voice packets are encrypted with ChaCha20-Poly1305. Video packets are not addressed — are they encrypted? With what keys? +**Problem:** Voice packets are encrypted with ChaCha20-Poly1305. Video packets are not addressed - are they encrypted? With what keys? **Recommendation:** Same ChaCha20-Poly1305 AEAD as voice. Each video session gets ephemeral keys derived via the same X25519 ECDH + HKDF-SHA256 path used for voice. Video-node does NOT decrypt (transparent relay, same as voice-node). -The session key exchange happens during `HELLO` handshake — add a `video_key` field alongside the existing `voice_key`. +The session key exchange happens during `HELLO` handshake - add a `video_key` field alongside the existing `voice_key`. -**Priority:** P0 — security regression if video is plaintext. +**Priority:** P0 - security regression if video is plaintext. -**Target:** `video.md` — add "Encryption" section; `docs/02-protocol/security.md` — add video encryption note. +**Target:** `video.md` - add "Encryption" section; `docs/02-protocol/security.md` - add video encryption note. --- -## 2. Camera Capture — Missing details +## 2. Camera Capture - Missing details -### Gap 2.1 — nokhwa API surface and fallback +### Gap 2.1 - nokhwa API surface and fallback **Problem:** `video.md` mentions `nokhwa` but not the concrete API or what happens on platforms where it doesn't work (Linux v4l2 permissions, Wayland). @@ -86,11 +86,11 @@ pub struct StreamConfig { Make `nokhwa` a feature gate (same pattern as `rnnoise` for voice). -**Priority:** P0 — blocks camera implementation. +**Priority:** P0 - blocks camera implementation. **Target:** New file: `client/src/video/capture.rs` (spec in `video.md`). -### Gap 2.2 — Device hotplug / switch +### Gap 2.2 - Device hotplug / switch **Problem:** No mention of what happens when camera is unplugged/replugged or user switches camera mid-call. @@ -106,11 +106,11 @@ enum CaptureEvent { Client handles `DeviceLost` by showing placeholder tile. User can select new device in settings without leaving call. -**Priority:** P1 — quality of life, not MVP blocker. +**Priority:** P1 - quality of life, not MVP blocker. -**Target:** `video.md` — add "Device lifecycle" to capture section. +**Target:** `video.md` - add "Device lifecycle" to capture section. -### Gap 2.3 — Resolution / FPS negotiation +### Gap 2.3 - Resolution / FPS negotiation **Problem:** `video.md` says "720p default, 30 fps" but doesn't say how clients agree on parameters. Different clients have different cameras. @@ -124,15 +124,15 @@ max_fps = 30 max_bitrate_kbps = 2500 ``` -**Priority:** P1 — needed before multi-user video testing. +**Priority:** P1 - needed before multi-user video testing. -**Target:** `video.md` — add "Capability negotiation" section. +**Target:** `video.md` - add "Capability negotiation" section. --- -## 3. Screen Share — Almost entirely missing +## 3. Screen Share - Almost entirely missing -### Gap 3.1 — Screen capture crate +### Gap 3.1 - Screen capture crate **Problem:** `video.md` mentions "Screen sharing (desktop capture)" as one bullet in Phase 2, no detail. @@ -140,18 +140,18 @@ max_bitrate_kbps = 2500 | Platform | Crate | Notes | |----------|-------|-------| -| Windows | `windows-capture` or DXGI via `winapi` | DXGI Desktop Duplication API — best perf | +| Windows | `windows-capture` or DXGI via `winapi` | DXGI Desktop Duplication API - best perf | | Linux X11 | `x11cap` or raw XSHM | X11 only, no Wayland | | Linux Wayland | `pipewire` via `pw-video` or xdg-desktop-portal | Portal is the standard path | | macOS | `screencapturekit` via objc bindings or `CGDisplay` | ScreenCaptureKit requires macOS 13+ | Abstract behind same `VideoSource` trait as camera. Two implementations: `CameraSource`, `ScreenSource`. -**Priority:** P1 — needed for Phase 2 screen share. +**Priority:** P1 - needed for Phase 2 screen share. **Target:** New doc: `docs/05-features/screen-share.md` or extend `video.md` Phase 2. -### Gap 3.2 — Window/display selection UI +### Gap 3.2 - Window/display selection UI **Problem:** User needs to pick which screen or window to share. No UI spec. @@ -176,13 +176,13 @@ Abstract behind same `VideoSource` trait as camera. Two implementations: `Camera └─────────────────────────────────────────┘ ``` -**Priority:** P1 — UX blocker for screen share. +**Priority:** P1 - UX blocker for screen share. -**Target:** `video.md` — add "Screen share UI" section. +**Target:** `video.md` - add "Screen share UI" section. -### Gap 3.3 — System audio capture with screen +### Gap 3.3 - System audio capture with screen -**Problem:** "Share system audio" checkbox in the mockup — how? No mention in video.md. +**Problem:** "Share system audio" checkbox in the mockup - how? No mention in video.md. **Recommendation:** - Windows: WASAPI loopback (`cpal` supports it with `loopback` config) @@ -191,11 +191,11 @@ Abstract behind same `VideoSource` trait as camera. Two implementations: `Camera Feature-gate it: `--features screen-audio`. Not all platforms support it cleanly. -**Priority:** P2 — nice to have, not MVP. +**Priority:** P2 - nice to have, not MVP. -**Target:** `video.md` Phase 2 — add "System audio" bullet. +**Target:** `video.md` Phase 2 - add "System audio" bullet. -### Gap 3.4 — Screen share FPS strategy +### Gap 3.4 - Screen share FPS strategy **Problem:** Screen share has different FPS needs than camera. Coding: 15fps is fine. Gaming: 60fps needed. @@ -203,15 +203,15 @@ Feature-gate it: `--features screen-audio`. Not all platforms support it cleanly Default: 15fps for screen share, 30fps for camera. -**Priority:** P2 — optimization, not MVP. +**Priority:** P2 - optimization, not MVP. -**Target:** `video.md` — add to Phase 2. +**Target:** `video.md` - add to Phase 2. --- -## 4. Interaction Model — Video + Voice +## 4. Interaction Model - Video + Voice -### Gap 4.1 — Video tied to voice channel +### Gap 4.1 - Video tied to voice channel **Problem:** `video.md` implies video is in the same channel as voice. What if users want video-only (no voice) or voice-only (no video)? @@ -226,25 +226,25 @@ Channel membership = voice channel membership. Video is additive. New voice state: `VOICE_STATE` gets a `video: bool` field. -**Priority:** P0 — architectural decision, affects protocol design. +**Priority:** P0 - architectural decision, affects protocol design. -**Target:** `video.md` — add "Interaction model" section; `docs/02-protocol/packets.md` — extend VOICE_STATE. +**Target:** `video.md` - add "Interaction model" section; `docs/02-protocol/packets.md` - extend VOICE_STATE. -### Gap 4.2 — Video without voice +### Gap 4.2 - Video without voice **Problem:** Some users may want to watch a stream without transmitting audio. Current model requires voice channel join. **Recommendation:** Phase 1: allow joining voice channel muted+deafened to watch video. Phase 3: separate "watch-only" mode (VIEW permission). -**Priority:** P2 — Phase 1 workaround is acceptable. +**Priority:** P2 - Phase 1 workaround is acceptable. -**Target:** `video.md` — add "Watch-only mode" to Phase 3. +**Target:** `video.md` - add "Watch-only mode" to Phase 3. --- ## 5. Performance & Quality -### Gap 5.1 — Bitrate adaptation +### Gap 5.1 - Bitrate adaptation **Problem:** No mechanism to adjust video bitrate based on network conditions. Voice has jitter buffer adaptation, video has nothing. @@ -265,11 +265,11 @@ Video-node sends periodic `VIDEO_STATS` with per-receiver loss rates: } ``` -**Priority:** P1 — needed for real-world use. +**Priority:** P1 - needed for real-world use. -**Target:** `video.md` — add "Adaptive bitrate" section. +**Target:** `video.md` - add "Adaptive bitrate" section. -### Gap 5.2 — Simulcast design +### Gap 5.2 - Simulcast design **Problem:** "Simulcast" is listed as Phase 3 with no design. Different receivers have different bandwidth. @@ -283,13 +283,13 @@ Sender → encode: 1080p (4Mbps) + 720p (1.5Mbps) + 360p (500kbps) 1080p→A 720p→B 360p→C (based on per-receiver stats) ``` -Requires VP9 SVC or H.264 simulcast. Complex — Phase 3 is correct. +Requires VP9 SVC or H.264 simulcast. Complex - Phase 3 is correct. -**Priority:** P2 — Phase 3, but design it now to avoid architecture lock-in. +**Priority:** P2 - Phase 3, but design it now to avoid architecture lock-in. -**Target:** `video.md` Phase 3 — expand "Simulcast" bullet. +**Target:** `video.md` Phase 3 - expand "Simulcast" bullet. -### Gap 5.3 — Keyframe interval +### Gap 5.3 - Keyframe interval **Problem:** New viewers joining mid-stream need a keyframe to start decoding. Video.md doesn't mention keyframe strategy. @@ -301,15 +301,15 @@ Requires VP9 SVC or H.264 simulcast. Complex — Phase 3 is correct. Add `REQUEST_KEYFRAME` packet for explicit PLI (Picture Loss Indication). -**Priority:** P1 — new viewers can't see video without keyframe. +**Priority:** P1 - new viewers can't see video without keyframe. -**Target:** `video.md` — add "Keyframe handling" section. +**Target:** `video.md` - add "Keyframe handling" section. --- ## 6. Missing Protocol Details -### Gap 6.1 — No packet fragmentation spec +### Gap 6.1 - No packet fragmentation spec **Problem:** Video frames can be 50-100KB. UDP MTU is ~1400 bytes. Video.md says "Packetize into MTU-friendly chunks" but doesn't define the fragmentation protocol. @@ -325,27 +325,27 @@ Each video frame: 3. Last chunk sets `LAST_FRAG` flag 4. Receiver reassembles before decode -New packet type: `VIDEO_FRAME_FRAGMENT (0x0012)` — separate from unfragmented `VIDEO_FRAME (0x0011)`. +New packet type: `VIDEO_FRAME_FRAGMENT (0x0012)` - separate from unfragmented `VIDEO_FRAME (0x0011)`. -Wait — `VIDEO_FRAME` ID isn't assigned in the packet registry yet. Register: +Wait - `VIDEO_FRAME` ID isn't assigned in the packet registry yet. Register: ``` 0x0011 VIDEO_FRAME single (small) video frame, no fragmentation 0x0012 VIDEO_FRAME_FRAG fragment of a larger video frame ``` -**Priority:** P0 — video can't work over UDP without fragmentation. +**Priority:** P0 - video can't work over UDP without fragmentation. -**Target:** `video.md` — replace packet format section; `docs/02-protocol/packets.md` — add 0x0011/0x0012 to registry. +**Target:** `video.md` - replace packet format section; `docs/02-protocol/packets.md` - add 0x0011/0x0012 to registry. -### Gap 6.2 — No RTCP-like receiver reports +### Gap 6.2 - No RTCP-like receiver reports **Problem:** Sender has no feedback about what receivers are experiencing. Voice has implicit feedback (jitter buffer stats), video needs explicit. **Recommendation:** Minimal receiver report packet: ```json -// 0x0013 VIDEO_RECEIVER_REPORT — client → video-node → sender +// 0x0013 VIDEO_RECEIVER_REPORT - client → video-node → sender { "frame_seq": 1042, "loss_cumulative": 15, @@ -357,21 +357,21 @@ Wait — `VIDEO_FRAME` ID isn't assigned in the packet registry yet. Register: Client sends every 1 second. Video-node aggregates and forwards to sender. -**Priority:** P1 — needed for ABR and quality adaptation. +**Priority:** P1 - needed for ABR and quality adaptation. -**Target:** `video.md` — add "Receiver reports" section. +**Target:** `video.md` - add "Receiver reports" section. --- ## 7. Guild Integration (Phase 1.2) -### Gap 7.1 — Video permissions already defined +### Gap 7.1 - Video permissions already defined **Status:** ✅ `STREAM` (bit 18) permission is already in the community model (`docs/07-community-model.md`). Covers both camera and screen share. -No gap here — just implement the check in gateway when processing `VIDEO_SESSION_JOIN`. +No gap here - just implement the check in gateway when processing `VIDEO_SESSION_JOIN`. -### Gap 7.2 — Channel-level video settings +### Gap 7.2 - Channel-level video settings **Problem:** Guild admins may want to disable video in certain channels (text-only channels, AFK channel). @@ -383,37 +383,37 @@ ALTER TABLE channels ADD COLUMN video_allowed BOOLEAN NOT NULL DEFAULT 1; Gateway rejects `VIDEO_SESSION_JOIN` if `video_allowed = false`. -**Priority:** P1 — admin control expected by guild owners. +**Priority:** P1 - admin control expected by guild owners. -**Target:** `docs/10-database.md` — add column to channels table; `docs/07-community-model.md` — add `video_allowed` to channel settings. +**Target:** `docs/10-database.md` - add column to channels table; `docs/07-community-model.md` - add `video_allowed` to channel settings. --- ## 8. Mobile Considerations (Phase 3) -### Gap 8.1 — Front/back camera switch +### Gap 8.1 - Front/back camera switch **Problem:** Mobile video.md doesn't mention camera switching at all. -**Recommendation:** Mobile client sends `CAMERA_SWITCH` event to video-node — no protocol change needed, just local capture change. New frame stream with `camera: front|back` metadata. +**Recommendation:** Mobile client sends `CAMERA_SWITCH` event to video-node - no protocol change needed, just local capture change. New frame stream with `camera: front|back` metadata. -**Priority:** P2 — Phase 3. +**Priority:** P2 - Phase 3. -**Target:** `docs/04-clients/mobile.md` (doesn't exist yet — create in Phase 3). +**Target:** `docs/04-clients/mobile.md` (doesn't exist yet - create in Phase 3). -### Gap 8.2 — Self preview +### Gap 8.2 - Self preview **Problem:** Desktop video grid has "Self-view (small, picture-in-picture corner)". On mobile the self-view is more important (front camera framing). **Recommendation:** Mobile layout: self-view full-width at top, other participants in scrollable grid below. Toggle button to swap. -**Priority:** P2 — Phase 3. +**Priority:** P2 - Phase 3. **Target:** `docs/04-clients/mobile.md`. --- -## Gap Summary — What to Add Before Implementation +## Gap Summary - What to Add Before Implementation | # | Gap | Priority | Target file | |---|-----|----------|-------------| @@ -441,13 +441,13 @@ Gateway rejects `VIDEO_SESSION_JOIN` if `video_allowed = false`. ## Recommended Implementation Order -1. **Update `video.md`** — incorporate P0 and P1 gaps from this audit into the design doc -2. **Register packet types** — 0x0011–0x0013 in `packets.md` -3. **Video-node prototype** — separate binary, UDP relay, no encoding/decoding (transparent relay like voice) -4. **Gateway ↔ video-node signalling** — internal TCP control channel for membership -5. **Client camera capture** — `VideoSource` trait + `NokhwaSource` behind feature gate -6. **Fragmentation** — implement FRAGMENTED/LAST_FRAG for video frames -7. **Grid UI** — basic 2×2 grid in client -8. **Encryption** — ChaCha20-Poly1305 for video frames -9. **ABR + receiver reports** — iterate toward production quality -10. **Screen share** — `ScreenSource` implementation + picker UI +1. **Update `video.md`** - incorporate P0 and P1 gaps from this audit into the design doc +2. **Register packet types** - 0x0011–0x0013 in `packets.md` +3. **Video-node prototype** - separate binary, UDP relay, no encoding/decoding (transparent relay like voice) +4. **Gateway ↔ video-node signalling** - internal TCP control channel for membership +5. **Client camera capture** - `VideoSource` trait + `NokhwaSource` behind feature gate +6. **Fragmentation** - implement FRAGMENTED/LAST_FRAG for video frames +7. **Grid UI** - basic 2×2 grid in client +8. **Encryption** - ChaCha20-Poly1305 for video frames +9. **ABR + receiver reports** - iterate toward production quality +10. **Screen share** - `ScreenSource` implementation + picker UI diff --git a/docs/05-features/video.md b/docs/05-features/video.md index 3e3e878..6b058b3 100644 --- a/docs/05-features/video.md +++ b/docs/05-features/video.md @@ -1,4 +1,4 @@ -# Video Chat — Architecture +# Video Chat - Architecture ## Goal @@ -14,9 +14,9 @@ Current (voice only): └─ Client: mic → Opus → UDP → voice-node → UDP → client → playback With video: -├─ Gateway: TCP (signaling) — UNCHANGED -├─ Voice-node: UDP (Opus voice) — UNCHANGED -├─ Video-node: UDP (H.264/VP9 relay) — NEW +├─ Gateway: TCP (signaling) - UNCHANGED +├─ Voice-node: UDP (Opus voice) - UNCHANGED +├─ Video-node: UDP (H.264/VP9 relay) - NEW │ └─ Receives encoded frames, relays to channel members └─ Client: mic → Opus → UDP → voice-node webcam → H.264 → UDP → video-node ← UDP → decode → display grid @@ -29,7 +29,7 @@ New optional component, separate binary or embedded in voice-node. ### Responsibilities - Receive encoded video frames over UDP - Relay to all other clients in the same voice channel -- No transcoding (relay only — CPU efficient) +- No transcoding (relay only - CPU efficient) - Max resolution / bitrate per channel configurable ### Packet format @@ -60,10 +60,10 @@ New file: `client/src/video/capture.rs` ### Dependencies -- `nokhwa` — cross-platform camera capture (Rust) -- `ffmpeg-next` or `rav1e` — H.264/VP9 encoding +- `nokhwa` - cross-platform camera capture (Rust) +- `ffmpeg-next` or `rav1e` - H.264/VP9 encoding -## Client UI — Video grid +## Client UI - Video grid New component: `client/src/ui/video.rs` diff --git a/docs/THIRD_PARTY.md b/docs/THIRD_PARTY.md index 03362d8..ba8535c 100644 --- a/docs/THIRD_PARTY.md +++ b/docs/THIRD_PARTY.md @@ -1,4 +1,21 @@ -# Third-party material +# Third-party assets + +The desktop client bundles two sets of third-party artwork and generates its own notification sounds. The artwork licenses permit redistribution inside a GPL-3.0 application as long as the notices below are kept. + +## Lucide icons (ISC, partly MIT) + +- Source: [Lucide](https://lucide.dev), package `lucide-static` 1.61.0. +- License: ISC, with the icons derived from Feather under the MIT license. The full text is in `src/ui/slint/assets/icons/LICENSE` (copied unchanged from the package). +- Files: `src/ui/slint/assets/icons/*.svg`. The only modification is replacing `currentColor` with black, so that Slint can tint the icon with `colorize` using the active theme colour. +- Use: `Symbol` in `src/ui/slint/theme.slint` selects an icon by name and `ActionButton` uses it for its `icon` property. To add an icon, copy the SVG from the Lucide package, replace `currentColor` with `#000000` and add its name to the `Symbol` list. + +## Noto Emoji images (Apache-2.0) + +- Source: Google Noto Emoji artwork as published in the npm package `emoji-datasource-google` 16.0.0 (`img/google/64`). The package code is MIT; the images are Google's Noto Emoji artwork, licensed under the Apache License 2.0. +- License: Apache License 2.0, full text in `src/ui/slint/assets/emoji/LICENSE`. +- Files: `src/ui/slint/assets/emoji/*.png` (a subset of about 190 emoji in 64 px), `src/ui/emoji/catalog.tsv` (categories and English and Russian search keywords) and `src/ui/emoji/images.rs` (the list of embedded files). +- Why images: Slint's renderers cannot rely on a colour emoji font being installed, so emoji in the picker and in reaction chips are drawn from these images. +- No modifications were made to the images. ## Notification sounds @@ -6,7 +23,3 @@ The notification sounds are not recordings. They are generated at runtime by `src/audio/sounds/synth.rs` (sine tones with two quiet harmonics, a short attack, an exponential decay and a fade-out). No third-party audio files, samples or presets are bundled, so they carry no extra attribution or licence: they are part of VNOX-Client under GPL-3.0. - -## Interface icons - -Icon sets and their licences (Lucide, ISC) are documented with the icon assets. diff --git a/docs/maintenance/dependency-audit.md b/docs/maintenance/dependency-audit.md index ab2af6d..556c371 100644 --- a/docs/maintenance/dependency-audit.md +++ b/docs/maintenance/dependency-audit.md @@ -41,7 +41,7 @@ RustSec до обновления:5 advisories. После обновления: Для этого обновлён rfd до0.17.2, parent UI/accessibility callers адаптированы к поддерживаемому zbus6, Wayland CSD использует crossfont0.9. Accessibility, portal и Wayland сохранены. `typed-index-collections` закреплён на совместимом3.2.3, чтобы убрать неиспользуемый optional bincode из resolution; это осознанное исключение из выбора самой новой версии. -Локальные compatibility backports — отдельная обязанность сопровождения, а не релизы upstream. Точные исходные версии, SHA256, лицензии, исходные ревизии и девять компактных diff записаны в `patches/`. Патчи следует удалить после соответствующих upstream релизов. Для Linux нужны FreeType/fontconfig development packages (`libfreetype6-dev libfontconfig1-dev` на Ubuntu). +Локальные compatibility backports - отдельная обязанность сопровождения, а не релизы upstream. Точные исходные версии, SHA256, лицензии, исходные ревизии и девять компактных diff записаны в `patches/`. Патчи следует удалить после соответствующих upstream релизов. Для Linux нужны FreeType/fontconfig development packages (`libfreetype6-dev libfontconfig1-dev` на Ubuntu). ## Совместимость и проверки diff --git a/docs/maintenance/ux-defects-2026-10-24.md b/docs/maintenance/ux-defects-2026-10-24.md index ccc58d8..151d900 100644 --- a/docs/maintenance/ux-defects-2026-10-24.md +++ b/docs/maintenance/ux-defects-2026-10-24.md @@ -6,25 +6,25 @@ | № | Область | Проблема | Поток | Статус | |---|---------|----------|-------|--------| -| 1 | Список каналов | Текст «general» стоит выше центра строки, не выровнен с иконкой `#` | A | открыто | -| 2 | Участники | У самого пользователя «Не в сети», хотя внизу «В сети»; аватар из двух букв «us» | A, C | открыто | -| 3 | Панель пользователя | Кривые иконки микрофона, наушников и настроек | A | открыто | -| 4 | Поле ввода | Ненужная подсказка «Enter отправить, Shift+Enter новая строка» | A | открыто | -| 5 | Иконки | Шестерёнка выглядит как цветок или снежинка, набор иконок самодельный | A | открыто | -| 6 | Шапка сервера | Кнопка «питание» рядом с названием сервера непонятна | A | открыто | -| 7 | Сообщения | В панели при наведении («Ответить, Править, Удалить») странная иконка слева | A | открыто | -| 8 | Эмодзи | Нет выбора эмодзи для текста сообщения и для реакций на сообщения | A | открыто | +| 1 | Список каналов | Текст «general» стоит выше центра строки, не выровнен с иконкой `#` | A | исправлено (поток A): текст в строках со значком выравнивался по верху, теперь `vertical-alignment: center` и кнопки в шапках центрируются через `VerticalLayout` | +| 2 | Участники | У самого пользователя «Не в сети», хотя внизу «В сети»; аватар из двух букв «us» | A, C | интерфейс исправлен (поток A): собственный пользователь в списке участников всегда «В сети», как в панели; аватар из двух букв остаётся до передачи аватаров по сети (поток C) | +| 3 | Панель пользователя | Кривые иконки микрофона, наушников и настроек | A | исправлено (поток A): иконки Lucide вместо самодельных путей | +| 4 | Поле ввода | Ненужная подсказка «Enter отправить, Shift+Enter новая строка» | A | исправлено (поток A): подсказка под полем ввода удалена, добавлен плейсхолдер «Сообщение» | +| 5 | Иконки | Шестерёнка выглядит как цветок или снежинка, набор иконок самодельный | A | исправлено (поток A): набор Lucide (ISC), шестерёнка `settings`, все юникод-значки заменены | +| 6 | Шапка сервера | Кнопка «питание» рядом с названием сервера непонятна | A | исправлено (поток A): иконка выхода `log-out` с подсказкой «Отключиться от сервера» | +| 7 | Сообщения | В панели при наведении («Ответить, Править, Удалить») странная иконка слева | A | исправлено (поток A): панель действий с иконками (быстрые реакции, реакция, ответ, правка, удаление); пустой квадрат слева был эмодзи без шрифта | +| 8 | Эмодзи | Нет выбора эмодзи для текста сообщения и для реакций на сообщения | A | исправлено (поток A): выбор эмодзи в поле ввода и для реакций, категории и поиск (ru и en), реакции показаны под сообщением и переключаются кликом; картинки Noto Emoji, цветные глифы в тексте этой сборкой не рисуются | | 9 | Звук | В голосовой комнате нет звуков: вход и выход участников, сообщения, упоминание или пинг, mute и unmute, подключение | B исправлено: звуки событий синтезируются программно, настройки в разделе «Звуки», диагностика ошибок аудио (см. ниже) | | 10a | Голос | По умолчанию стоит режим рации (PTT), выглядит странно и неудобно; нужен обычный режим по активации голоса | B исправлено: по умолчанию голосовая активность с автоподбором порога | -| 10b | Голосовая комната | Страница слишком серая, текстовые кнопки «Выключить микрофон», «Выключить звук», «Покинуть комнату» неудобны; нужны иконочные кнопки | A | открыто | +| 10b | Голосовая комната | Страница слишком серая, текстовые кнопки «Выключить микрофон», «Выключить звук», «Покинуть комнату» неудобны; нужны иконочные кнопки | A | исправлено (поток A): карточки участников с аватаром и кольцом говорящего, круглые иконочные кнопки с подсказками, выключенные состояния красные | | 10c | Голосовая комната | Верхняя строка «Подключение к голосовой комнате…» остаётся, хотя внизу «Голос подключён» | B исправлено: единый статус голоса (см. ниже) | | 10d | Аккаунт | Можно зайти на сервер без аккаунта; регистрация или вход в Central должны быть обязательными | C | открыто | | 10e | Аватары | Две буквы вместо аватара; при первой регистрации нужен случайный сгенерированный аватар | C | открыто | -| 10f | Отзывчивость | Приложение реагирует медленно; нажатие срабатывает не с одного клика, а со второго | A | открыто | +| 10f | Отзывчивость | Приложение реагирует медленно; нажатие срабатывает не с одного клика, а со второго | A | исправлено (поток A). Причина: `FocusScope` лежал над `TouchArea` и по умолчанию забирал первое нажатие (`focus-on-click`), клик доходил до кнопки только со второго раза; плюс панель действий над сообщением пропадала при наведении на её кнопки. Тест `ui_smoke` шлёт реальные события указателя и падал до исправления. Отдельно остаётся: `refresh_devices` при открытии настроек опрашивает ALSA в потоке интерфейса (поток B) | | 11a | Настройки звука | В списках устройств вывода и микрофона мусорные ALSA-пункты (Discard all samples, Rate Converter Plugin, JACK, Open Sound System) | B исправлено: фильтр устройств, выбор хранится по идентификатору | -| 11b | Настройки | Те же двойные клики в настройках | A | открыто | -| 12a | Темы | Тема работает странно (чёрная тема: части интерфейса остаются серыми, фон не везде одинаковый) | A | открыто | -| 12b | Аватар | Аватар в панели пользователя обновился, в карточке участника голосовой комнаты остались две буквы | A, C | открыто | +| 11b | Настройки | Те же двойные клики в настройках | A | исправлено (поток A): та же причина, что в 10f | +| 12a | Темы | Тема работает странно (чёрная тема: части интерфейса остаются серыми, фон не везде одинаковый) | A | исправлено (поток A): все экраны проверены в светлой, тёмной, чёрной и своей теме по снимкам `ui_smoke`; захардкоженные цвета убраны, кнопка отправки и состояния берут цвета темы | +| 12b | Аватар | Аватар в панели пользователя обновился, в карточке участника голосовой комнаты остались две буквы | A, C | интерфейс исправлен (поток A): один компонент `AvatarView` в панели, сообщениях, участниках, голосовых карточках и друзьях; свой аватар виден везде, чужие аватары ждут поток C | | 12c | Аватар | Неясно, доходит ли аватар до других пользователей. Проверить и, если нет, реализовать передачу | C | открыто | ## Принципы исправления diff --git a/docs/slint-migration-plan.md b/docs/slint-migration-plan.md index 7ac22b6..3d9eaf4 100644 --- a/docs/slint-migration-plan.md +++ b/docs/slint-migration-plan.md @@ -1,4 +1,4 @@ -# Slint UI Migration Plan — VNOX Client +# Slint UI Migration Plan - VNOX Client ## Current Architecture (egui) @@ -18,7 +18,7 @@ main.rs └─ settings::show_window() ``` -State: `UiState` — single large struct (131+ lines) with conn, channels, messages, DMs, guilds, friends, audio settings, voice state. Mutated directly in place every frame. +State: `UiState` - single large struct (131+ lines) with conn, channels, messages, DMs, guilds, friends, audio settings, voice state. Mutated directly in place every frame. UI: 80+ Rust files in `ui/`, all immediate-mode egui. Every widget redrawn every frame. @@ -31,19 +31,19 @@ main.rs └─ slint::MainWindow::new() → .run() │ ├─ .slint files (declarative UI) - │ ├─ main.slint — window layout - │ ├─ sidebar.slint — guild bar + channel list - │ ├─ chat.slint — message list + input bar - │ ├─ voice.slint — voice channel panel - │ ├─ connect.slint — connect/bookmarks screen - │ ├─ settings.slint — settings dialog - │ └─ theme.slint — color/font/spacing definitions + │ ├─ main.slint - window layout + │ ├─ sidebar.slint - guild bar + channel list + │ ├─ chat.slint - message list + input bar + │ ├─ voice.slint - voice channel panel + │ ├─ connect.slint - connect/bookmarks screen + │ ├─ settings.slint - settings dialog + │ └─ theme.slint - color/font/spacing definitions │ └─ Rust code (logic only) - ├─ app.rs — VnoxApp, init, event wiring - ├─ bridge.rs — UiState ↔ Slint property sync - ├─ state/ — UiState (unchanged, slimmed) - └─ net/ audio/ — no changes + ├─ app.rs - VnoxApp, init, event wiring + ├─ bridge.rs - UiState ↔ Slint property sync + ├─ state/ - UiState (unchanged, slimmed) + └─ net/ audio/ - no changes ``` Key difference: Slint only re-renders changed properties. UI is declared once in `.slint` files. Rust code pushes state updates via `in-out property` setters. @@ -52,14 +52,14 @@ Key difference: Slint only re-renders changed properties. UI is declared once in ## Migration Phases -### Phase 1 — Infrastructure (day 1) +### Phase 1 - Infrastructure (day 1) 1. Add `slint` crate to `Cargo.toml`: ```toml slint = { version = "1", features = ["backend-winit", "compat-1-2"] } ``` -2. Create `ui/main.slint` — empty window with a placeholder text +2. Create `ui/main.slint` - empty window with a placeholder text 3. Rewrite `main.rs`: - Remove `eframe::run_native()` @@ -72,9 +72,9 @@ Key difference: Slint only re-renders changed properties. UI is declared once in --- -### Phase 2 — Sidebar (day 2) +### Phase 2 - Sidebar (day 2) -Sidebar is the most isolated component — no complex interaction, just a list of channels + guild bar + user bar. +Sidebar is the most isolated component - no complex interaction, just a list of channels + guild bar + user bar. ```slint // theme.slint @@ -104,7 +104,7 @@ fn sync_sidebar(window: &MainWindow, state: &UiState) { --- -### Phase 3 — Chat (days 3-4) +### Phase 3 - Chat (days 3-4) The complex one: text messages, reactions, editing, typing indicators, reply chain, DMs, friends list. @@ -138,7 +138,7 @@ component ChatPanel { --- -### Phase 4 — Connect Screen (day 4) +### Phase 4 - Connect Screen (day 4) ```slint component ConnectScreen { @@ -154,7 +154,7 @@ component ConnectScreen { --- -### Phase 5 — Settings + Polish (day 5) +### Phase 5 - Settings + Polish (day 5) Settings dialog with tabs: Audio, Network, Identity, Appearance. @@ -214,10 +214,10 @@ The bridge pattern: ## What stays the same -- **`net/`** — all networking code, `NetHandle`, `NetCommand`, `NetEvent` -- **`audio/`** — capture/playback pipeline, Opus encode/decode, RNNoise -- **`identity.rs`**, **`identity_vault.rs`** — keypair management -- **`jitter/`** — jitter buffer (copied from voice-node) +- **`net/`** - all networking code, `NetHandle`, `NetCommand`, `NetEvent` +- **`audio/`** - capture/playback pipeline, Opus encode/decode, RNNoise +- **`identity.rs`**, **`identity_vault.rs`** - keypair management +- **`jitter/`** - jitter buffer (copied from voice-node) --- diff --git a/src/main.rs b/src/main.rs index 1a30750..00e5527 100644 --- a/src/main.rs +++ b/src/main.rs @@ -197,6 +197,7 @@ fn wire_signals(window: &MainWindow, state: &Rc>) { }); } + ui::emoji::wire(window); crate::ui::appearance::wire(window, state, !cfg!(test)); ui::i18n::wire(window, !cfg!(test)); crate::ui::avatar::wire(window, state, !cfg!(test)); @@ -804,14 +805,11 @@ fn wire_signals(window: &MainWindow, state: &Rc>) { let s = state.borrow(); let ch_id = s.ui.active_channel.clone().unwrap_or_default(); let net = s.net.clone(); + let command = + ui::update::reaction_command(&s.ui, &s.identity.pubkey_hex, ch_id, msg_id, emoji); drop(s); tokio::spawn(async move { - net.send(NetCommand::ReactionAdd { - channel_id: ch_id, - message_id: msg_id, - emoji, - }) - .await; + net.send(command).await; }); }); } diff --git a/src/ui/bridge.rs b/src/ui/bridge.rs index a10c972..bad8b98 100644 --- a/src/ui/bridge.rs +++ b/src/ui/bridge.rs @@ -14,6 +14,16 @@ fn presence_label(status: &str) -> String { }) } +/// Presence dot variant for the avatar. +fn presence_key(status: &str) -> &'static str { + match status.to_ascii_lowercase().as_str() { + "online" => "online", + "idle" | "away" => "idle", + "dnd" | "busy" => "dnd", + _ => "offline", + } +} + type MainWindow = crate::ui::slint::MainWindow; type BookmarkItem = crate::ui::slint::BookmarkItem; type ChannelItem = crate::ui::slint::ChannelItem; @@ -23,6 +33,7 @@ type MessageItem = crate::ui::slint::MessageItem; type MemberItem = crate::ui::slint::MemberItem; type FriendItem = crate::ui::slint::FriendItem; type VoiceMemberItem = crate::ui::slint::VoiceMemberItem; +type ReactionItem = crate::ui::slint::ReactionItem; fn replace_model( current: ModelRc, @@ -34,6 +45,49 @@ fn replace_model( } } +fn initials(name: &str) -> SharedString { + name.chars().take(2).collect::().into() +} + +/// Reaction chips of a message in a stable order, with the bundled emoji image when known. +fn reaction_items(m: &crate::ui::state::ChatMessage, own_user_id: &str) -> Vec { + let mut reactions: Vec<(&String, &Vec)> = m + .reactions + .iter() + .filter(|(_, users)| !users.is_empty()) + .collect(); + reactions.sort_by(|a, b| b.1.len().cmp(&a.1.len()).then_with(|| a.0.cmp(b.0))); + reactions + .into_iter() + .map(|(emoji, users)| { + let image = crate::ui::emoji::image_for_glyph(emoji); + ReactionItem { + emoji: SharedString::from(emoji.as_str()), + has_image: image.is_some(), + image: image.unwrap_or_default(), + count: users.len().min(i32::MAX as usize) as i32, + mine: users.iter().any(|u| u == own_user_id), + } + }) + .collect() +} + +/// Field by field comparison; `ModelRc` fields (reactions) compare by identity otherwise and +/// would make every refresh look like a change. +fn same_message(a: &MessageItem, b: &MessageItem) -> bool { + a.message_id == b.message_id + && a.sender_id == b.sender_id + && a.sender_name == b.sender_name + && a.content == b.content + && a.timestamp == b.timestamp + && a.is_own == b.is_own + && a.edited == b.edited + && a.reply_to == b.reply_to + && a.avatar_text == b.avatar_text + && a.show_author == b.show_author + && a.reactions.iter().eq(b.reactions.iter()) +} + fn fmt_ts(ts: i64) -> String { let secs = (ts / 1000).abs() % 86400; format!("{:02}:{:02}", secs / 3600, (secs % 3600) / 60) @@ -49,12 +103,7 @@ fn set_messages( .iter() .enumerate() .map(|(index, m)| MessageItem { - avatar_text: state - .nick_for(&m.sender_id) - .chars() - .take(2) - .collect::() - .into(), + avatar_text: initials(state.nick_for(&m.sender_id)), show_author: index == 0 || msgs[index - 1].sender_id != m.sender_id || m.timestamp.saturating_sub(msgs[index - 1].timestamp) > 300_000, @@ -65,6 +114,7 @@ fn set_messages( timestamp: SharedString::from(fmt_ts(m.timestamp)), is_own: m.sender_id == own_user_id, edited: m.edited, + reactions: Rc::new(VecModel::from(reaction_items(m, own_user_id))).into(), reply_to: SharedString::from( m.reply_to .as_ref() @@ -86,12 +136,18 @@ fn set_messages( ), }) .collect(); - replace_model(window.get_messages(), items, |model| { - window.set_messages(model) - }); + let current = window.get_messages(); + if current.row_count() != items.len() + || !current + .iter() + .zip(items.iter()) + .all(|(a, b)| same_message(&a, b)) + { + window.set_messages(Rc::new(VecModel::from(items)).into()); + } } -fn set_members_state(window: &MainWindow, state: &UiState, ch_id: &str) { +fn set_members_state(window: &MainWindow, state: &UiState, ch_id: &str, own_user_id: &str) { if let Some(ch) = state.channels.iter().find(|c| c.id == ch_id) { let items: Vec = ch .members @@ -103,16 +159,25 @@ fn set_members_state(window: &MainWindow, state: &UiState, ch_id: &str) { .find(|(_, n)| *n == nick) .map(|(id, _)| id.clone()) .unwrap_or_else(|| nick.clone()); - let status = state - .presences - .get(&user_id) - .map(|p| p.status.as_str()) - .unwrap_or("offline"); + let is_own = user_id == own_user_id; + // This client is connected whenever the member list is shown, so the local user + // is online even though the server sends no presence update about oneself. + let status = if is_own { + "online" + } else { + state + .presences + .get(&user_id) + .map(|p| p.status.as_str()) + .unwrap_or("offline") + }; MemberItem { - avatar_text: nick.chars().take(2).collect::().into(), + avatar_text: initials(nick), user_id: SharedString::from(user_id), nickname: SharedString::from(nick.as_str()), status: presence_label(status).into(), + presence: presence_key(status).into(), + is_own, } }) .collect(); @@ -173,6 +238,7 @@ fn sync_sidebar(window: &MainWindow, state: &UiState, own_nickname: &str) { }); window.set_username(SharedString::from(own_nickname)); + window.set_own_initials(initials(own_nickname)); window.set_user_status(crate::ui::i18n::text("Online").into()); window.set_show_dms(state.browsing_dms); window.set_active_dm_id(state.active_dm_id.as_deref().unwrap_or("").into()); @@ -236,7 +302,7 @@ fn sync_chat(window: &MainWindow, state: &UiState, own_user_id: &str) { .unwrap_or_default(), own_user_id, ); - set_members_state(window, state, &channel.id); + set_members_state(window, state, &channel.id, own_user_id); } // User edits are immediately written back through input-edited. Only a real // state change (navigation/send/edit) should replace the editor contents. @@ -252,6 +318,7 @@ fn sync_friends(window: &MainWindow, state: &UiState) { .map(|f| FriendItem { user_id: SharedString::from(f.user_id.as_str()), nickname: SharedString::from(f.nickname.as_str()), + avatar_text: initials(&f.nickname), status_label: presence_label( state .presences @@ -279,6 +346,7 @@ fn sync_friends(window: &MainWindow, state: &UiState) { .map(|f| FriendItem { user_id: SharedString::from(f.user_id.as_str()), nickname: SharedString::from(f.nickname.as_str()), + avatar_text: initials(&f.nickname), status: "pending".into(), status_label: presence_label("pending").into(), }) @@ -299,7 +367,7 @@ fn sync_friends(window: &MainWindow, state: &UiState) { window.set_friends_active_tab(SharedString::from(state.friends_tab.as_str())); } -pub fn sync_voice(window: &MainWindow, state: &UiState) { +pub fn sync_voice(window: &MainWindow, state: &UiState, own_user_id: &str) { let members: Vec = state .channels .iter() @@ -318,7 +386,8 @@ pub fn sync_voice(window: &MainWindow, state: &UiState) { .map(|(id, _)| id.clone()) .unwrap_or_else(|| nick.clone()); VoiceMemberItem { - avatar_text: nick.chars().take(2).collect::().into(), + avatar_text: initials(nick), + is_own: user_id == own_user_id, user_id: SharedString::from(user_id.clone()), nickname: SharedString::from(nick.as_str()), speaking: state.remote_speaking && state.last_remote_speaker_id == user_id, @@ -465,7 +534,7 @@ pub fn sync_ui( sync_sidebar(window, state, own_nickname); sync_chat(window, state, own_user_id); sync_friends(window, state); - sync_voice(window, state); + sync_voice(window, state, own_user_id); sync_connect(window, state); sync_settings(window, state, own_pubkey); } diff --git a/src/ui/emoji/catalog.tsv b/src/ui/emoji/catalog.tsv new file mode 100644 index 0000000..78d3a09 --- /dev/null +++ b/src/ui/emoji/catalog.tsv @@ -0,0 +1,193 @@ +1f600 0 😀 grinning grinning face улыбка радость +1f603 0 😃 smiley smiling face with open mouth улыбка +1f604 0 😄 smile smiling face with open mouth and smiling eyes улыбка счастье +1f601 0 😁 grin grinning face with smiling eyes ухмылка +1f606 0 😆 laughing satisfied smiling face with open mouth and tightly-closed eyes смех +1f605 0 😅 sweat smile smiling face with open mouth and cold sweat облегчение пот +1f602 0 😂 joy face with tears of joy смех слёзы ржу +1f923 0 🤣 rolling on the floor laughing rolling on the floor laughing ржу катаюсь +1f642 0 🙂 slightly smiling face slightly smiling face лёгкая улыбка +1f643 0 🙃 upside down face upside-down face перевёрнутое лицо +1f609 0 😉 wink winking face подмигивание +1f60a 0 😊 blush smiling face with smiling eyes смущение румянец +1f607 0 😇 innocent smiling face with halo ангел невинность +1f970 0 🥰 smiling face with 3 hearts smiling face with smiling eyes and three hearts влюблённый сердца +1f60d 0 😍 heart eyes smiling face with heart-shaped eyes влюблён глаза сердечки +1f929 0 🤩 grinning face with star eyes star struck grinning face with star eyes восторг звёзды +1f618 0 😘 kissing heart face throwing a kiss поцелуй +1f60b 0 😋 yum face savouring delicious food вкусно +1f61b 0 😛 stuck out tongue face with stuck-out tongue язык +1f61c 0 😜 stuck out tongue winking eye face with stuck-out tongue and winking eye язык подмигивание +1f911 0 🤑 money mouth face money-mouth face деньги +1f917 0 🤗 hugging face hugging face объятия +1f914 0 🤔 thinking face thinking face думаю задумался +1f928 0 🤨 face with one eyebrow raised face with raised eyebrow face with one eyebrow raised бровь сомнение +1f610 0 😐 neutral face neutral face нейтральное +1f611 0 😑 expressionless expressionless face без эмоций +1f60f 0 😏 smirk smirking face ухмылка хитрость +1f612 0 😒 unamused unamused face недовольство +1f644 0 🙄 face with rolling eyes face with rolling eyes закатил глаза +1f62c 0 😬 grimacing grimacing face гримаса неловко +1f60c 0 😌 relieved relieved face облегчение +1f614 0 😔 pensive pensive face грусть задумчивость +1f62a 0 😪 sleepy sleepy face сонный +1f634 0 😴 sleeping sleeping face сон спит +1f637 0 😷 mask face with medical mask маска болезнь +1f912 0 🤒 face with thermometer face with thermometer температура болезнь +1f922 0 🤢 nauseated face nauseated face тошнит +1f92f 0 🤯 exploding head shocked face with exploding head shocked face with exploding head взрыв мозга +1f60e 0 😎 sunglasses smiling face with sunglasses очки крутой +1f913 0 🤓 nerd face nerd face ботаник +1f615 0 😕 confused confused face растерянность +1f61f 0 😟 worried worried face тревога +1f641 0 🙁 slightly frowning face slightly frowning face грусть +1f62e 0 😮 open mouth face with open mouth удивление +1f632 0 😲 astonished astonished face изумление +1f633 0 😳 flushed flushed face смущение +1f97a 0 🥺 pleading face face with pleading eyes умоляю +1f622 0 😢 cry crying face плач слёзы +1f62d 0 😭 sob loudly crying face рыдание +1f631 0 😱 scream face screaming in fear крик ужас +1f620 0 😠 angry angry face злость +1f621 0 😡 rage pouting face ярость +1f624 0 😤 triumph face with look of triumph триумф +1f480 0 💀 skull skull череп +1f4a9 0 💩 hankey poop shit pile of poo какашка +1f921 0 🤡 clown face clown face клоун +1f47b 0 👻 ghost ghost призрак +1f47d 0 👽 alien extraterrestrial alien пришелец инопланетянин +1f916 0 🤖 robot face robot face робот +1f648 0 🙈 see no evil see-no-evil monkey не вижу обезьяна +1f44d 1 👍 +1 thumbsup thumbs up sign лайк класс отлично да палец вверх +1f44e 1 👎 1 thumbsdown thumbs down sign дизлайк палец вниз нет +1f44c 1 👌 ok hand ok hand sign окей +270c-fe0f 1 ✌️ v victory hand победа мир +1f91e 1 🤞 crossed fingers hand with index and middle fingers crossed hand with index and middle fingers crossed скрестил пальцы удача +1f919 1 🤙 call me hand call me hand позвони +261d-fe0f 1 ☝️ point up white up pointing index вверх +1f447 1 👇 point down white down pointing backhand index вниз +1f448 1 👈 point left white left pointing backhand index влево +1f449 1 👉 point right white right pointing backhand index вправо +270b 1 ✋ hand raised hand raised hand рука стоп +1f44b 1 👋 wave waving hand sign привет махать +1f44f 1 👏 clap clapping hands sign аплодисменты хлопки +1f64c 1 🙌 raised hands person raising both hands in celebration ура руки вверх +1f450 1 👐 open hands open hands sign открытые ладони +1f64f 1 🙏 pray person with folded hands спасибо молитва пожалуйста +1f91d 1 🤝 handshake handshake рукопожатие договор +1f4aa 1 💪 muscle flexed biceps сила бицепс +1f440 1 👀 eyes eyes глаза смотрю +1f9e0 1 🧠 brain brain мозг +1f937 1 🤷 shrug shrug пожатие плечами +270a 1 ✊ fist raised fist кулак +1f44a 1 👊 facepunch punch fisted hand sign удар кулаком +270d-fe0f 1 ✍️ writing hand writing hand пишу +1f933 1 🤳 selfie selfie селфи +2764-fe0f 2 ❤️ heart heavy black heart сердце любовь +1f9e1 2 🧡 orange heart orange heart оранжевое сердце +1f49b 2 💛 yellow heart yellow heart жёлтое сердце +1f49a 2 💚 green heart green heart зелёное сердце +1f499 2 💙 blue heart blue heart синее сердце +1f49c 2 💜 purple heart purple heart фиолетовое сердце +1f5a4 2 🖤 black heart black heart чёрное сердце +1f494 2 💔 broken heart broken heart разбитое сердце +1f495 2 💕 two hearts two hearts два сердца +1f496 2 💖 sparkling heart sparkling heart сияющее сердце +1f525 2 🔥 fire fire огонь горячо +1f4af 2 💯 100 hundred points symbol сто баллов отлично +2728 2 ✨ sparkles sparkles блёстки искры +2b50 2 ⭐ star white medium star звезда +1f4a5 2 💥 boom collision collision symbol взрыв +26a1 2 ⚡ zap high voltage sign молния +1f389 2 🎉 tada party popper праздник ура поздравляю +2705 2 ✅ white check mark white heavy check mark галочка готово да +274c 2 ❌ x cross mark крестик нет +26a0-fe0f 2 ⚠️ warning warning sign внимание предупреждение +2753 2 ❓ question black question mark ornament вопрос +2757 2 ❗ exclamation heavy exclamation mark heavy exclamation mark symbol восклицание +26d4 2 ⛔ no entry no entry запрет +1f4a4 2 💤 zzz sleeping symbol сон +1f4ac 2 💬 speech balloon speech balloon сообщение чат +1f4ad 2 💭 thought balloon thought balloon мысль +1f514 2 🔔 bell bell колокольчик уведомление +1f512 2 🔒 lock lock замок +1f511 2 🔑 key key ключ +1f517 2 🔗 link link symbol ссылка +1f436 3 🐶 dog dog face собака +1f431 3 🐱 cat cat face кошка кот +1f42d 3 🐭 mouse mouse face мышь +1f430 3 🐰 rabbit rabbit face кролик заяц +1f98a 3 🦊 fox face fox face лиса +1f43b 3 🐻 bear bear face медведь +1f43c 3 🐼 panda face panda face панда +1f42f 3 🐯 tiger tiger face тигр +1f981 3 🦁 lion face lion face лев +1f435 3 🐵 monkey face monkey face обезьяна +1f984 3 🦄 unicorn face unicorn face единорог +1f427 3 🐧 penguin penguin пингвин +1f414 3 🐔 chicken chicken курица +1f438 3 🐸 frog frog face лягушка +1f433 3 🐳 whale spouting whale кит +1f419 3 🐙 octopus octopus осьминог +1f98b 3 🦋 butterfly butterfly бабочка +1f41b 3 🐛 bug bug жук баг +1f40d 3 🐍 snake snake змея +1f33b 3 🌻 sunflower sunflower подсолнух цветок +1f339 3 🌹 rose rose роза цветок +1f340 3 🍀 four leaf clover four leaf clover клевер удача +1f34e 3 🍎 apple red apple яблоко +1f34c 3 🍌 banana banana банан +1f349 3 🍉 watermelon watermelon арбуз +1f353 3 🍓 strawberry strawberry клубника +1f355 3 🍕 pizza slice of pizza пицца +1f354 3 🍔 hamburger hamburger бургер +1f35f 3 🍟 fries french fries картошка фри +1f32e 3 🌮 taco taco тако +1f370 3 🍰 cake shortcake торт +1f36a 3 🍪 cookie cookie печенье +1f369 3 🍩 doughnut doughnut пончик +2615 3 ☕ coffee hot beverage кофе +1f375 3 🍵 tea teacup without handle чай +1f37a 3 🍺 beer beer mug пиво +1f37b 3 🍻 beers clinking beer mugs пиво кружки +1f377 3 🍷 wine glass wine glass вино +1f3ae 4 🎮 video game video game игра геймпад +1f579-fe0f 4 🕹️ joystick joystick джойстик +1f3af 4 🎯 dart direct hit мишень цель +1f3b2 4 🎲 game die game die кубик игра +1f3c6 4 🏆 trophy trophy кубок победа +1f396-fe0f 4 🎖️ medal military medal медаль +26bd 4 ⚽ soccer soccer ball футбол мяч +1f3c0 4 🏀 basketball basketball and hoop баскетбол +1f3b8 4 🎸 guitar guitar гитара +1f3b5 4 🎵 musical note musical note музыка нота +1f3a7 4 🎧 headphones headphone наушники +1f3a4 4 🎤 microphone microphone микрофон +1f3a5 4 🎥 movie camera movie camera кино камера +1f4bb 4 💻 computer personal computer компьютер ноутбук +2328-fe0f 4 ⌨️ keyboard keyboard клавиатура +1f4f1 4 📱 iphone mobile phone телефон +1f50b 4 🔋 battery battery батарея +1f4a1 4 💡 bulb electric light bulb лампочка идея +1f4da 4 📚 books books книги +1f4dd 4 📝 memo pencil memo заметка записка +1f4cc 4 📌 pushpin pushpin кнопка закрепить +1f4ce 4 📎 paperclip paperclip скрепка +2702-fe0f 4 ✂️ scissors black scissors ножницы +1f528 4 🔨 hammer hammer молоток +1f527 4 🔧 wrench wrench ключ гаечный +2699-fe0f 4 ⚙️ gear gear шестерёнка настройки +1f6e1-fe0f 4 🛡️ shield shield щит +1f451 4 👑 crown crown корона +1f48e 4 💎 gem gem stone алмаз драгоценность +1f381 4 🎁 gift wrapped present подарок +1f388 4 🎈 balloon balloon шарик +1f680 4 🚀 rocket rocket ракета +2708-fe0f 4 ✈️ airplane airplane самолёт +1f697 4 🚗 car red car automobile машина +1f308 4 🌈 rainbow rainbow радуга +2600-fe0f 4 ☀️ sunny black sun with rays солнце +1f319 4 🌙 crescent moon crescent moon луна +2744-fe0f 4 ❄️ snowflake snowflake снежинка +2602-fe0f 4 ☂️ umbrella umbrella зонт дождь +1f310 4 🌐 globe with meridians globe with meridians мир интернет diff --git a/src/ui/emoji/images.rs b/src/ui/emoji/images.rs new file mode 100644 index 0000000..61ace21 --- /dev/null +++ b/src/ui/emoji/images.rs @@ -0,0 +1,242 @@ +//! Generated list of embedded emoji images (Noto Emoji, Apache-2.0). One entry per catalog row. +/// Image bytes keyed by the lowercase hyphenated code points used in `catalog.tsv`. +pub(super) const IMAGES: &[(&str, &[u8])] = &[ + ("1f600", include_bytes!("../slint/assets/emoji/1f600.png")), + ("1f603", include_bytes!("../slint/assets/emoji/1f603.png")), + ("1f604", include_bytes!("../slint/assets/emoji/1f604.png")), + ("1f601", include_bytes!("../slint/assets/emoji/1f601.png")), + ("1f606", include_bytes!("../slint/assets/emoji/1f606.png")), + ("1f605", include_bytes!("../slint/assets/emoji/1f605.png")), + ("1f602", include_bytes!("../slint/assets/emoji/1f602.png")), + ("1f923", include_bytes!("../slint/assets/emoji/1f923.png")), + ("1f642", include_bytes!("../slint/assets/emoji/1f642.png")), + ("1f643", include_bytes!("../slint/assets/emoji/1f643.png")), + ("1f609", include_bytes!("../slint/assets/emoji/1f609.png")), + ("1f60a", include_bytes!("../slint/assets/emoji/1f60a.png")), + ("1f607", include_bytes!("../slint/assets/emoji/1f607.png")), + ("1f970", include_bytes!("../slint/assets/emoji/1f970.png")), + ("1f60d", include_bytes!("../slint/assets/emoji/1f60d.png")), + ("1f929", include_bytes!("../slint/assets/emoji/1f929.png")), + ("1f618", include_bytes!("../slint/assets/emoji/1f618.png")), + ("1f60b", include_bytes!("../slint/assets/emoji/1f60b.png")), + ("1f61b", include_bytes!("../slint/assets/emoji/1f61b.png")), + ("1f61c", include_bytes!("../slint/assets/emoji/1f61c.png")), + ("1f911", include_bytes!("../slint/assets/emoji/1f911.png")), + ("1f917", include_bytes!("../slint/assets/emoji/1f917.png")), + ("1f914", include_bytes!("../slint/assets/emoji/1f914.png")), + ("1f928", include_bytes!("../slint/assets/emoji/1f928.png")), + ("1f610", include_bytes!("../slint/assets/emoji/1f610.png")), + ("1f611", include_bytes!("../slint/assets/emoji/1f611.png")), + ("1f60f", include_bytes!("../slint/assets/emoji/1f60f.png")), + ("1f612", include_bytes!("../slint/assets/emoji/1f612.png")), + ("1f644", include_bytes!("../slint/assets/emoji/1f644.png")), + ("1f62c", include_bytes!("../slint/assets/emoji/1f62c.png")), + ("1f60c", include_bytes!("../slint/assets/emoji/1f60c.png")), + ("1f614", include_bytes!("../slint/assets/emoji/1f614.png")), + ("1f62a", include_bytes!("../slint/assets/emoji/1f62a.png")), + ("1f634", include_bytes!("../slint/assets/emoji/1f634.png")), + ("1f637", include_bytes!("../slint/assets/emoji/1f637.png")), + ("1f912", include_bytes!("../slint/assets/emoji/1f912.png")), + ("1f922", include_bytes!("../slint/assets/emoji/1f922.png")), + ("1f92f", include_bytes!("../slint/assets/emoji/1f92f.png")), + ("1f60e", include_bytes!("../slint/assets/emoji/1f60e.png")), + ("1f913", include_bytes!("../slint/assets/emoji/1f913.png")), + ("1f615", include_bytes!("../slint/assets/emoji/1f615.png")), + ("1f61f", include_bytes!("../slint/assets/emoji/1f61f.png")), + ("1f641", include_bytes!("../slint/assets/emoji/1f641.png")), + ("1f62e", include_bytes!("../slint/assets/emoji/1f62e.png")), + ("1f632", include_bytes!("../slint/assets/emoji/1f632.png")), + ("1f633", include_bytes!("../slint/assets/emoji/1f633.png")), + ("1f97a", include_bytes!("../slint/assets/emoji/1f97a.png")), + ("1f622", include_bytes!("../slint/assets/emoji/1f622.png")), + ("1f62d", include_bytes!("../slint/assets/emoji/1f62d.png")), + ("1f631", include_bytes!("../slint/assets/emoji/1f631.png")), + ("1f620", include_bytes!("../slint/assets/emoji/1f620.png")), + ("1f621", include_bytes!("../slint/assets/emoji/1f621.png")), + ("1f624", include_bytes!("../slint/assets/emoji/1f624.png")), + ("1f480", include_bytes!("../slint/assets/emoji/1f480.png")), + ("1f4a9", include_bytes!("../slint/assets/emoji/1f4a9.png")), + ("1f921", include_bytes!("../slint/assets/emoji/1f921.png")), + ("1f47b", include_bytes!("../slint/assets/emoji/1f47b.png")), + ("1f47d", include_bytes!("../slint/assets/emoji/1f47d.png")), + ("1f916", include_bytes!("../slint/assets/emoji/1f916.png")), + ("1f648", include_bytes!("../slint/assets/emoji/1f648.png")), + ("1f44d", include_bytes!("../slint/assets/emoji/1f44d.png")), + ("1f44e", include_bytes!("../slint/assets/emoji/1f44e.png")), + ("1f44c", include_bytes!("../slint/assets/emoji/1f44c.png")), + ( + "270c-fe0f", + include_bytes!("../slint/assets/emoji/270c-fe0f.png"), + ), + ("1f91e", include_bytes!("../slint/assets/emoji/1f91e.png")), + ("1f919", include_bytes!("../slint/assets/emoji/1f919.png")), + ( + "261d-fe0f", + include_bytes!("../slint/assets/emoji/261d-fe0f.png"), + ), + ("1f447", include_bytes!("../slint/assets/emoji/1f447.png")), + ("1f448", include_bytes!("../slint/assets/emoji/1f448.png")), + ("1f449", include_bytes!("../slint/assets/emoji/1f449.png")), + ("270b", include_bytes!("../slint/assets/emoji/270b.png")), + ("1f44b", include_bytes!("../slint/assets/emoji/1f44b.png")), + ("1f44f", include_bytes!("../slint/assets/emoji/1f44f.png")), + ("1f64c", include_bytes!("../slint/assets/emoji/1f64c.png")), + ("1f450", include_bytes!("../slint/assets/emoji/1f450.png")), + ("1f64f", include_bytes!("../slint/assets/emoji/1f64f.png")), + ("1f91d", include_bytes!("../slint/assets/emoji/1f91d.png")), + ("1f4aa", include_bytes!("../slint/assets/emoji/1f4aa.png")), + ("1f440", include_bytes!("../slint/assets/emoji/1f440.png")), + ("1f9e0", include_bytes!("../slint/assets/emoji/1f9e0.png")), + ("1f937", include_bytes!("../slint/assets/emoji/1f937.png")), + ("270a", include_bytes!("../slint/assets/emoji/270a.png")), + ("1f44a", include_bytes!("../slint/assets/emoji/1f44a.png")), + ( + "270d-fe0f", + include_bytes!("../slint/assets/emoji/270d-fe0f.png"), + ), + ("1f933", include_bytes!("../slint/assets/emoji/1f933.png")), + ( + "2764-fe0f", + include_bytes!("../slint/assets/emoji/2764-fe0f.png"), + ), + ("1f9e1", include_bytes!("../slint/assets/emoji/1f9e1.png")), + ("1f49b", include_bytes!("../slint/assets/emoji/1f49b.png")), + ("1f49a", include_bytes!("../slint/assets/emoji/1f49a.png")), + ("1f499", include_bytes!("../slint/assets/emoji/1f499.png")), + ("1f49c", include_bytes!("../slint/assets/emoji/1f49c.png")), + ("1f5a4", include_bytes!("../slint/assets/emoji/1f5a4.png")), + ("1f494", include_bytes!("../slint/assets/emoji/1f494.png")), + ("1f495", include_bytes!("../slint/assets/emoji/1f495.png")), + ("1f496", include_bytes!("../slint/assets/emoji/1f496.png")), + ("1f525", include_bytes!("../slint/assets/emoji/1f525.png")), + ("1f4af", include_bytes!("../slint/assets/emoji/1f4af.png")), + ("2728", include_bytes!("../slint/assets/emoji/2728.png")), + ("2b50", include_bytes!("../slint/assets/emoji/2b50.png")), + ("1f4a5", include_bytes!("../slint/assets/emoji/1f4a5.png")), + ("26a1", include_bytes!("../slint/assets/emoji/26a1.png")), + ("1f389", include_bytes!("../slint/assets/emoji/1f389.png")), + ("2705", include_bytes!("../slint/assets/emoji/2705.png")), + ("274c", include_bytes!("../slint/assets/emoji/274c.png")), + ( + "26a0-fe0f", + include_bytes!("../slint/assets/emoji/26a0-fe0f.png"), + ), + ("2753", include_bytes!("../slint/assets/emoji/2753.png")), + ("2757", include_bytes!("../slint/assets/emoji/2757.png")), + ("26d4", include_bytes!("../slint/assets/emoji/26d4.png")), + ("1f4a4", include_bytes!("../slint/assets/emoji/1f4a4.png")), + ("1f4ac", include_bytes!("../slint/assets/emoji/1f4ac.png")), + ("1f4ad", include_bytes!("../slint/assets/emoji/1f4ad.png")), + ("1f514", include_bytes!("../slint/assets/emoji/1f514.png")), + ("1f512", include_bytes!("../slint/assets/emoji/1f512.png")), + ("1f511", include_bytes!("../slint/assets/emoji/1f511.png")), + ("1f517", include_bytes!("../slint/assets/emoji/1f517.png")), + ("1f436", include_bytes!("../slint/assets/emoji/1f436.png")), + ("1f431", include_bytes!("../slint/assets/emoji/1f431.png")), + ("1f42d", include_bytes!("../slint/assets/emoji/1f42d.png")), + ("1f430", include_bytes!("../slint/assets/emoji/1f430.png")), + ("1f98a", include_bytes!("../slint/assets/emoji/1f98a.png")), + ("1f43b", include_bytes!("../slint/assets/emoji/1f43b.png")), + ("1f43c", include_bytes!("../slint/assets/emoji/1f43c.png")), + ("1f42f", include_bytes!("../slint/assets/emoji/1f42f.png")), + ("1f981", include_bytes!("../slint/assets/emoji/1f981.png")), + ("1f435", include_bytes!("../slint/assets/emoji/1f435.png")), + ("1f984", include_bytes!("../slint/assets/emoji/1f984.png")), + ("1f427", include_bytes!("../slint/assets/emoji/1f427.png")), + ("1f414", include_bytes!("../slint/assets/emoji/1f414.png")), + ("1f438", include_bytes!("../slint/assets/emoji/1f438.png")), + ("1f433", include_bytes!("../slint/assets/emoji/1f433.png")), + ("1f419", include_bytes!("../slint/assets/emoji/1f419.png")), + ("1f98b", include_bytes!("../slint/assets/emoji/1f98b.png")), + ("1f41b", include_bytes!("../slint/assets/emoji/1f41b.png")), + ("1f40d", include_bytes!("../slint/assets/emoji/1f40d.png")), + ("1f33b", include_bytes!("../slint/assets/emoji/1f33b.png")), + ("1f339", include_bytes!("../slint/assets/emoji/1f339.png")), + ("1f340", include_bytes!("../slint/assets/emoji/1f340.png")), + ("1f34e", include_bytes!("../slint/assets/emoji/1f34e.png")), + ("1f34c", include_bytes!("../slint/assets/emoji/1f34c.png")), + ("1f349", include_bytes!("../slint/assets/emoji/1f349.png")), + ("1f353", include_bytes!("../slint/assets/emoji/1f353.png")), + ("1f355", include_bytes!("../slint/assets/emoji/1f355.png")), + ("1f354", include_bytes!("../slint/assets/emoji/1f354.png")), + ("1f35f", include_bytes!("../slint/assets/emoji/1f35f.png")), + ("1f32e", include_bytes!("../slint/assets/emoji/1f32e.png")), + ("1f370", include_bytes!("../slint/assets/emoji/1f370.png")), + ("1f36a", include_bytes!("../slint/assets/emoji/1f36a.png")), + ("1f369", include_bytes!("../slint/assets/emoji/1f369.png")), + ("2615", include_bytes!("../slint/assets/emoji/2615.png")), + ("1f375", include_bytes!("../slint/assets/emoji/1f375.png")), + ("1f37a", include_bytes!("../slint/assets/emoji/1f37a.png")), + ("1f37b", include_bytes!("../slint/assets/emoji/1f37b.png")), + ("1f377", include_bytes!("../slint/assets/emoji/1f377.png")), + ("1f3ae", include_bytes!("../slint/assets/emoji/1f3ae.png")), + ( + "1f579-fe0f", + include_bytes!("../slint/assets/emoji/1f579-fe0f.png"), + ), + ("1f3af", include_bytes!("../slint/assets/emoji/1f3af.png")), + ("1f3b2", include_bytes!("../slint/assets/emoji/1f3b2.png")), + ("1f3c6", include_bytes!("../slint/assets/emoji/1f3c6.png")), + ( + "1f396-fe0f", + include_bytes!("../slint/assets/emoji/1f396-fe0f.png"), + ), + ("26bd", include_bytes!("../slint/assets/emoji/26bd.png")), + ("1f3c0", include_bytes!("../slint/assets/emoji/1f3c0.png")), + ("1f3b8", include_bytes!("../slint/assets/emoji/1f3b8.png")), + ("1f3b5", include_bytes!("../slint/assets/emoji/1f3b5.png")), + ("1f3a7", include_bytes!("../slint/assets/emoji/1f3a7.png")), + ("1f3a4", include_bytes!("../slint/assets/emoji/1f3a4.png")), + ("1f3a5", include_bytes!("../slint/assets/emoji/1f3a5.png")), + ("1f4bb", include_bytes!("../slint/assets/emoji/1f4bb.png")), + ( + "2328-fe0f", + include_bytes!("../slint/assets/emoji/2328-fe0f.png"), + ), + ("1f4f1", include_bytes!("../slint/assets/emoji/1f4f1.png")), + ("1f50b", include_bytes!("../slint/assets/emoji/1f50b.png")), + ("1f4a1", include_bytes!("../slint/assets/emoji/1f4a1.png")), + ("1f4da", include_bytes!("../slint/assets/emoji/1f4da.png")), + ("1f4dd", include_bytes!("../slint/assets/emoji/1f4dd.png")), + ("1f4cc", include_bytes!("../slint/assets/emoji/1f4cc.png")), + ("1f4ce", include_bytes!("../slint/assets/emoji/1f4ce.png")), + ( + "2702-fe0f", + include_bytes!("../slint/assets/emoji/2702-fe0f.png"), + ), + ("1f528", include_bytes!("../slint/assets/emoji/1f528.png")), + ("1f527", include_bytes!("../slint/assets/emoji/1f527.png")), + ( + "2699-fe0f", + include_bytes!("../slint/assets/emoji/2699-fe0f.png"), + ), + ( + "1f6e1-fe0f", + include_bytes!("../slint/assets/emoji/1f6e1-fe0f.png"), + ), + ("1f451", include_bytes!("../slint/assets/emoji/1f451.png")), + ("1f48e", include_bytes!("../slint/assets/emoji/1f48e.png")), + ("1f381", include_bytes!("../slint/assets/emoji/1f381.png")), + ("1f388", include_bytes!("../slint/assets/emoji/1f388.png")), + ("1f680", include_bytes!("../slint/assets/emoji/1f680.png")), + ( + "2708-fe0f", + include_bytes!("../slint/assets/emoji/2708-fe0f.png"), + ), + ("1f697", include_bytes!("../slint/assets/emoji/1f697.png")), + ("1f308", include_bytes!("../slint/assets/emoji/1f308.png")), + ( + "2600-fe0f", + include_bytes!("../slint/assets/emoji/2600-fe0f.png"), + ), + ("1f319", include_bytes!("../slint/assets/emoji/1f319.png")), + ( + "2744-fe0f", + include_bytes!("../slint/assets/emoji/2744-fe0f.png"), + ), + ( + "2602-fe0f", + include_bytes!("../slint/assets/emoji/2602-fe0f.png"), + ), + ("1f310", include_bytes!("../slint/assets/emoji/1f310.png")), +]; diff --git a/src/ui/emoji/mod.rs b/src/ui/emoji/mod.rs new file mode 100644 index 0000000..628dd69 --- /dev/null +++ b/src/ui/emoji/mod.rs @@ -0,0 +1,175 @@ +//! Emoji picker data: a bundled catalog of Noto Emoji images (Apache-2.0, see +//! `docs/THIRD_PARTY.md`) with English and Russian search keywords. +//! +//! Colour emoji are drawn from the embedded PNG images rather than from a system font. Many +//! machines have no colour emoji font and Slint's renderers would then show empty boxes. +mod images; + +use std::cell::RefCell; +use std::collections::HashMap; +use std::rc::Rc; + +use slint::{ComponentHandle, Image, Rgba8Pixel, SharedPixelBuffer, SharedString, VecModel}; + +use crate::ui::slint::{EmojiCatalog, EmojiItem, MainWindow}; + +/// One catalog row of `catalog.tsv`: code, category, glyph, English keywords, Russian keywords. +struct Entry { + code: &'static str, + category: i32, + glyph: &'static str, + keywords: String, +} + +fn entries() -> &'static [Entry] { + use std::sync::OnceLock; + static ENTRIES: OnceLock> = OnceLock::new(); + ENTRIES.get_or_init(|| { + include_str!("catalog.tsv") + .lines() + .filter_map(|line| { + let mut cols = line.split('\t'); + Some(Entry { + code: cols.next()?, + category: cols.next()?.parse().ok()?, + glyph: cols.next()?, + keywords: format!("{} {}", cols.next()?, cols.next().unwrap_or("")) + .to_lowercase(), + }) + }) + .collect() + }) +} + +/// Removes the emoji presentation selector so that `❤` and `❤️` identify the same image. +fn normalize(glyph: &str) -> String { + glyph.chars().filter(|c| *c != '\u{fe0f}').collect() +} + +thread_local! { + static CACHE: RefCell> = RefCell::new(HashMap::new()); +} + +fn decode(bytes: &[u8]) -> Option { + let rgba = image::load_from_memory_with_format(bytes, image::ImageFormat::Png) + .ok()? + .to_rgba8(); + let buffer = SharedPixelBuffer::::clone_from_slice( + rgba.as_raw(), + rgba.width(), + rgba.height(), + ); + Some(Image::from_rgba8(buffer)) +} + +fn image_of(entry: &'static Entry) -> Option { + CACHE.with(|cache| { + if let Some(image) = cache.borrow().get(entry.code) { + return Some(image.clone()); + } + let bytes = images::IMAGES + .iter() + .find(|(code, _)| *code == entry.code) + .map(|(_, bytes)| *bytes)?; + let image = decode(bytes)?; + cache.borrow_mut().insert(entry.code, image.clone()); + Some(image) + }) +} + +/// The bundled image for `glyph`, when the catalog contains it. +pub fn image_for_glyph(glyph: &str) -> Option { + let wanted = normalize(glyph); + entries() + .iter() + .find(|entry| normalize(entry.glyph) == wanted) + .and_then(image_of) +} + +/// Indexes of catalog entries for a category (`-1` meaning all) and a free text query. +fn search(category: i32, query: &str) -> Vec { + let query = query.trim().to_lowercase(); + entries() + .iter() + .enumerate() + .filter(|(_, entry)| { + if query.is_empty() { + category < 0 || entry.category == category + } else { + // A query searches every category. + entry + .keywords + .split_whitespace() + .any(|word| word.starts_with(&query)) + || entry.keywords.contains(&query) + } + }) + .map(|(index, _)| index) + .collect() +} + +fn items(category: i32, query: &str) -> Vec { + search(category, query) + .into_iter() + .filter_map(|index| { + let entry = &entries()[index]; + Some(EmojiItem { + glyph: SharedString::from(entry.glyph), + image: image_of(entry)?, + name: SharedString::from(entry.keywords.split(' ').next().unwrap_or("")), + }) + }) + .collect() +} + +/// Fills the shared picker model and answers search or category changes from the picker. +pub fn wire(window: &MainWindow) { + let catalog = window.global::(); + catalog.set_shown(Rc::new(VecModel::from(items(0, ""))).into()); + let weak = window.as_weak(); + catalog.on_query(move |category, text| { + if let Some(window) = weak.upgrade() { + window + .global::() + .set_shown(Rc::new(VecModel::from(items(category, text.as_str()))).into()); + } + }); +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn every_catalog_row_has_a_decodable_image() { + assert!(entries().len() > 150); + for entry in entries() { + let bytes = images::IMAGES + .iter() + .find(|(code, _)| *code == entry.code) + .unwrap_or_else(|| panic!("image for {}", entry.code)) + .1; + assert!(decode(bytes).is_some(), "{} must decode", entry.code); + } + } + + #[test] + fn search_understands_english_and_russian() { + let find = |query: &str| -> Vec<&str> { + search(-1, query) + .into_iter() + .map(|i| entries()[i].glyph) + .collect() + }; + assert!(find("fire").contains(&"🔥")); + assert!(find("огонь").contains(&"🔥")); + assert!(find("лайк").contains(&"👍")); + assert!(find("zzzz-no-such-emoji").is_empty()); + assert!(search(1, "").len() < search(-1, "").len()); + } + + #[test] + fn selector_variants_share_an_image() { + assert!(entries().iter().any(|e| normalize(e.glyph) == "❤")); + } +} diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 819e4cc..a794b63 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -2,6 +2,7 @@ pub mod appearance; pub mod avatar; pub mod bridge; pub mod devices; +pub mod emoji; pub mod i18n; pub mod media; pub mod preferences; diff --git a/src/ui/slint/assets/emoji/1f308.png b/src/ui/slint/assets/emoji/1f308.png new file mode 100644 index 0000000..18b2b41 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f308.png differ diff --git a/src/ui/slint/assets/emoji/1f310.png b/src/ui/slint/assets/emoji/1f310.png new file mode 100644 index 0000000..94a0d1a Binary files /dev/null and b/src/ui/slint/assets/emoji/1f310.png differ diff --git a/src/ui/slint/assets/emoji/1f319.png b/src/ui/slint/assets/emoji/1f319.png new file mode 100644 index 0000000..c11dd28 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f319.png differ diff --git a/src/ui/slint/assets/emoji/1f32e.png b/src/ui/slint/assets/emoji/1f32e.png new file mode 100644 index 0000000..ac680b7 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f32e.png differ diff --git a/src/ui/slint/assets/emoji/1f339.png b/src/ui/slint/assets/emoji/1f339.png new file mode 100644 index 0000000..a7ed8d6 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f339.png differ diff --git a/src/ui/slint/assets/emoji/1f33b.png b/src/ui/slint/assets/emoji/1f33b.png new file mode 100644 index 0000000..d471283 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f33b.png differ diff --git a/src/ui/slint/assets/emoji/1f340.png b/src/ui/slint/assets/emoji/1f340.png new file mode 100644 index 0000000..9c8dfba Binary files /dev/null and b/src/ui/slint/assets/emoji/1f340.png differ diff --git a/src/ui/slint/assets/emoji/1f349.png b/src/ui/slint/assets/emoji/1f349.png new file mode 100644 index 0000000..8ff52e0 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f349.png differ diff --git a/src/ui/slint/assets/emoji/1f34c.png b/src/ui/slint/assets/emoji/1f34c.png new file mode 100644 index 0000000..ef8ca51 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f34c.png differ diff --git a/src/ui/slint/assets/emoji/1f34e.png b/src/ui/slint/assets/emoji/1f34e.png new file mode 100644 index 0000000..1df3223 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f34e.png differ diff --git a/src/ui/slint/assets/emoji/1f353.png b/src/ui/slint/assets/emoji/1f353.png new file mode 100644 index 0000000..6f2e64b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f353.png differ diff --git a/src/ui/slint/assets/emoji/1f354.png b/src/ui/slint/assets/emoji/1f354.png new file mode 100644 index 0000000..3c94c44 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f354.png differ diff --git a/src/ui/slint/assets/emoji/1f355.png b/src/ui/slint/assets/emoji/1f355.png new file mode 100644 index 0000000..bbe1dbe Binary files /dev/null and b/src/ui/slint/assets/emoji/1f355.png differ diff --git a/src/ui/slint/assets/emoji/1f35f.png b/src/ui/slint/assets/emoji/1f35f.png new file mode 100644 index 0000000..cfb7b10 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f35f.png differ diff --git a/src/ui/slint/assets/emoji/1f369.png b/src/ui/slint/assets/emoji/1f369.png new file mode 100644 index 0000000..e8e78e1 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f369.png differ diff --git a/src/ui/slint/assets/emoji/1f36a.png b/src/ui/slint/assets/emoji/1f36a.png new file mode 100644 index 0000000..fa5273b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f36a.png differ diff --git a/src/ui/slint/assets/emoji/1f370.png b/src/ui/slint/assets/emoji/1f370.png new file mode 100644 index 0000000..cc74b49 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f370.png differ diff --git a/src/ui/slint/assets/emoji/1f375.png b/src/ui/slint/assets/emoji/1f375.png new file mode 100644 index 0000000..8e7ff49 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f375.png differ diff --git a/src/ui/slint/assets/emoji/1f377.png b/src/ui/slint/assets/emoji/1f377.png new file mode 100644 index 0000000..69cbe7a Binary files /dev/null and b/src/ui/slint/assets/emoji/1f377.png differ diff --git a/src/ui/slint/assets/emoji/1f37a.png b/src/ui/slint/assets/emoji/1f37a.png new file mode 100644 index 0000000..2c44eeb Binary files /dev/null and b/src/ui/slint/assets/emoji/1f37a.png differ diff --git a/src/ui/slint/assets/emoji/1f37b.png b/src/ui/slint/assets/emoji/1f37b.png new file mode 100644 index 0000000..1f7de27 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f37b.png differ diff --git a/src/ui/slint/assets/emoji/1f381.png b/src/ui/slint/assets/emoji/1f381.png new file mode 100644 index 0000000..adf8994 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f381.png differ diff --git a/src/ui/slint/assets/emoji/1f388.png b/src/ui/slint/assets/emoji/1f388.png new file mode 100644 index 0000000..90ba393 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f388.png differ diff --git a/src/ui/slint/assets/emoji/1f389.png b/src/ui/slint/assets/emoji/1f389.png new file mode 100644 index 0000000..037cd9c Binary files /dev/null and b/src/ui/slint/assets/emoji/1f389.png differ diff --git a/src/ui/slint/assets/emoji/1f396-fe0f.png b/src/ui/slint/assets/emoji/1f396-fe0f.png new file mode 100644 index 0000000..9096358 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f396-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/1f3a4.png b/src/ui/slint/assets/emoji/1f3a4.png new file mode 100644 index 0000000..beea208 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3a4.png differ diff --git a/src/ui/slint/assets/emoji/1f3a5.png b/src/ui/slint/assets/emoji/1f3a5.png new file mode 100644 index 0000000..7dfe6c6 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3a5.png differ diff --git a/src/ui/slint/assets/emoji/1f3a7.png b/src/ui/slint/assets/emoji/1f3a7.png new file mode 100644 index 0000000..6094bfe Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3a7.png differ diff --git a/src/ui/slint/assets/emoji/1f3ae.png b/src/ui/slint/assets/emoji/1f3ae.png new file mode 100644 index 0000000..4c83a49 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3ae.png differ diff --git a/src/ui/slint/assets/emoji/1f3af.png b/src/ui/slint/assets/emoji/1f3af.png new file mode 100644 index 0000000..18fe2f1 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3af.png differ diff --git a/src/ui/slint/assets/emoji/1f3b2.png b/src/ui/slint/assets/emoji/1f3b2.png new file mode 100644 index 0000000..7a45cf7 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3b2.png differ diff --git a/src/ui/slint/assets/emoji/1f3b5.png b/src/ui/slint/assets/emoji/1f3b5.png new file mode 100644 index 0000000..676654b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3b5.png differ diff --git a/src/ui/slint/assets/emoji/1f3b8.png b/src/ui/slint/assets/emoji/1f3b8.png new file mode 100644 index 0000000..61d8678 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3b8.png differ diff --git a/src/ui/slint/assets/emoji/1f3c0.png b/src/ui/slint/assets/emoji/1f3c0.png new file mode 100644 index 0000000..b95eb37 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3c0.png differ diff --git a/src/ui/slint/assets/emoji/1f3c6.png b/src/ui/slint/assets/emoji/1f3c6.png new file mode 100644 index 0000000..8ef48f7 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f3c6.png differ diff --git a/src/ui/slint/assets/emoji/1f40d.png b/src/ui/slint/assets/emoji/1f40d.png new file mode 100644 index 0000000..64a76f9 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f40d.png differ diff --git a/src/ui/slint/assets/emoji/1f414.png b/src/ui/slint/assets/emoji/1f414.png new file mode 100644 index 0000000..d479df9 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f414.png differ diff --git a/src/ui/slint/assets/emoji/1f419.png b/src/ui/slint/assets/emoji/1f419.png new file mode 100644 index 0000000..53746a7 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f419.png differ diff --git a/src/ui/slint/assets/emoji/1f41b.png b/src/ui/slint/assets/emoji/1f41b.png new file mode 100644 index 0000000..672b473 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f41b.png differ diff --git a/src/ui/slint/assets/emoji/1f427.png b/src/ui/slint/assets/emoji/1f427.png new file mode 100644 index 0000000..3441292 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f427.png differ diff --git a/src/ui/slint/assets/emoji/1f42d.png b/src/ui/slint/assets/emoji/1f42d.png new file mode 100644 index 0000000..a4e05b6 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f42d.png differ diff --git a/src/ui/slint/assets/emoji/1f42f.png b/src/ui/slint/assets/emoji/1f42f.png new file mode 100644 index 0000000..1713b00 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f42f.png differ diff --git a/src/ui/slint/assets/emoji/1f430.png b/src/ui/slint/assets/emoji/1f430.png new file mode 100644 index 0000000..a0b1eb9 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f430.png differ diff --git a/src/ui/slint/assets/emoji/1f431.png b/src/ui/slint/assets/emoji/1f431.png new file mode 100644 index 0000000..0bb5f78 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f431.png differ diff --git a/src/ui/slint/assets/emoji/1f433.png b/src/ui/slint/assets/emoji/1f433.png new file mode 100644 index 0000000..b2e3584 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f433.png differ diff --git a/src/ui/slint/assets/emoji/1f435.png b/src/ui/slint/assets/emoji/1f435.png new file mode 100644 index 0000000..935b7ef Binary files /dev/null and b/src/ui/slint/assets/emoji/1f435.png differ diff --git a/src/ui/slint/assets/emoji/1f436.png b/src/ui/slint/assets/emoji/1f436.png new file mode 100644 index 0000000..bcd2c18 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f436.png differ diff --git a/src/ui/slint/assets/emoji/1f438.png b/src/ui/slint/assets/emoji/1f438.png new file mode 100644 index 0000000..d547d26 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f438.png differ diff --git a/src/ui/slint/assets/emoji/1f43b.png b/src/ui/slint/assets/emoji/1f43b.png new file mode 100644 index 0000000..b10e835 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f43b.png differ diff --git a/src/ui/slint/assets/emoji/1f43c.png b/src/ui/slint/assets/emoji/1f43c.png new file mode 100644 index 0000000..50c63d8 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f43c.png differ diff --git a/src/ui/slint/assets/emoji/1f440.png b/src/ui/slint/assets/emoji/1f440.png new file mode 100644 index 0000000..cf43537 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f440.png differ diff --git a/src/ui/slint/assets/emoji/1f447.png b/src/ui/slint/assets/emoji/1f447.png new file mode 100644 index 0000000..2006b7a Binary files /dev/null and b/src/ui/slint/assets/emoji/1f447.png differ diff --git a/src/ui/slint/assets/emoji/1f448.png b/src/ui/slint/assets/emoji/1f448.png new file mode 100644 index 0000000..98345be Binary files /dev/null and b/src/ui/slint/assets/emoji/1f448.png differ diff --git a/src/ui/slint/assets/emoji/1f449.png b/src/ui/slint/assets/emoji/1f449.png new file mode 100644 index 0000000..1240245 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f449.png differ diff --git a/src/ui/slint/assets/emoji/1f44a.png b/src/ui/slint/assets/emoji/1f44a.png new file mode 100644 index 0000000..f8e6a59 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f44a.png differ diff --git a/src/ui/slint/assets/emoji/1f44b.png b/src/ui/slint/assets/emoji/1f44b.png new file mode 100644 index 0000000..b09dbe1 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f44b.png differ diff --git a/src/ui/slint/assets/emoji/1f44c.png b/src/ui/slint/assets/emoji/1f44c.png new file mode 100644 index 0000000..83c9e10 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f44c.png differ diff --git a/src/ui/slint/assets/emoji/1f44d.png b/src/ui/slint/assets/emoji/1f44d.png new file mode 100644 index 0000000..c2ed661 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f44d.png differ diff --git a/src/ui/slint/assets/emoji/1f44e.png b/src/ui/slint/assets/emoji/1f44e.png new file mode 100644 index 0000000..05c05f0 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f44e.png differ diff --git a/src/ui/slint/assets/emoji/1f44f.png b/src/ui/slint/assets/emoji/1f44f.png new file mode 100644 index 0000000..729719f Binary files /dev/null and b/src/ui/slint/assets/emoji/1f44f.png differ diff --git a/src/ui/slint/assets/emoji/1f450.png b/src/ui/slint/assets/emoji/1f450.png new file mode 100644 index 0000000..4012ddb Binary files /dev/null and b/src/ui/slint/assets/emoji/1f450.png differ diff --git a/src/ui/slint/assets/emoji/1f451.png b/src/ui/slint/assets/emoji/1f451.png new file mode 100644 index 0000000..8132363 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f451.png differ diff --git a/src/ui/slint/assets/emoji/1f47b.png b/src/ui/slint/assets/emoji/1f47b.png new file mode 100644 index 0000000..1052429 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f47b.png differ diff --git a/src/ui/slint/assets/emoji/1f47d.png b/src/ui/slint/assets/emoji/1f47d.png new file mode 100644 index 0000000..449255a Binary files /dev/null and b/src/ui/slint/assets/emoji/1f47d.png differ diff --git a/src/ui/slint/assets/emoji/1f480.png b/src/ui/slint/assets/emoji/1f480.png new file mode 100644 index 0000000..218c1ea Binary files /dev/null and b/src/ui/slint/assets/emoji/1f480.png differ diff --git a/src/ui/slint/assets/emoji/1f48e.png b/src/ui/slint/assets/emoji/1f48e.png new file mode 100644 index 0000000..420d272 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f48e.png differ diff --git a/src/ui/slint/assets/emoji/1f494.png b/src/ui/slint/assets/emoji/1f494.png new file mode 100644 index 0000000..04d7bf7 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f494.png differ diff --git a/src/ui/slint/assets/emoji/1f495.png b/src/ui/slint/assets/emoji/1f495.png new file mode 100644 index 0000000..e745b4f Binary files /dev/null and b/src/ui/slint/assets/emoji/1f495.png differ diff --git a/src/ui/slint/assets/emoji/1f496.png b/src/ui/slint/assets/emoji/1f496.png new file mode 100644 index 0000000..b4cc8ed Binary files /dev/null and b/src/ui/slint/assets/emoji/1f496.png differ diff --git a/src/ui/slint/assets/emoji/1f499.png b/src/ui/slint/assets/emoji/1f499.png new file mode 100644 index 0000000..2206457 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f499.png differ diff --git a/src/ui/slint/assets/emoji/1f49a.png b/src/ui/slint/assets/emoji/1f49a.png new file mode 100644 index 0000000..f031c2a Binary files /dev/null and b/src/ui/slint/assets/emoji/1f49a.png differ diff --git a/src/ui/slint/assets/emoji/1f49b.png b/src/ui/slint/assets/emoji/1f49b.png new file mode 100644 index 0000000..3e885ae Binary files /dev/null and b/src/ui/slint/assets/emoji/1f49b.png differ diff --git a/src/ui/slint/assets/emoji/1f49c.png b/src/ui/slint/assets/emoji/1f49c.png new file mode 100644 index 0000000..be57600 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f49c.png differ diff --git a/src/ui/slint/assets/emoji/1f4a1.png b/src/ui/slint/assets/emoji/1f4a1.png new file mode 100644 index 0000000..16ee5c2 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4a1.png differ diff --git a/src/ui/slint/assets/emoji/1f4a4.png b/src/ui/slint/assets/emoji/1f4a4.png new file mode 100644 index 0000000..b048c8d Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4a4.png differ diff --git a/src/ui/slint/assets/emoji/1f4a5.png b/src/ui/slint/assets/emoji/1f4a5.png new file mode 100644 index 0000000..82d558b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4a5.png differ diff --git a/src/ui/slint/assets/emoji/1f4a9.png b/src/ui/slint/assets/emoji/1f4a9.png new file mode 100644 index 0000000..84aa759 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4a9.png differ diff --git a/src/ui/slint/assets/emoji/1f4aa.png b/src/ui/slint/assets/emoji/1f4aa.png new file mode 100644 index 0000000..9d8febc Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4aa.png differ diff --git a/src/ui/slint/assets/emoji/1f4ac.png b/src/ui/slint/assets/emoji/1f4ac.png new file mode 100644 index 0000000..98c299e Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4ac.png differ diff --git a/src/ui/slint/assets/emoji/1f4ad.png b/src/ui/slint/assets/emoji/1f4ad.png new file mode 100644 index 0000000..6a3f06e Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4ad.png differ diff --git a/src/ui/slint/assets/emoji/1f4af.png b/src/ui/slint/assets/emoji/1f4af.png new file mode 100644 index 0000000..92bc7bc Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4af.png differ diff --git a/src/ui/slint/assets/emoji/1f4bb.png b/src/ui/slint/assets/emoji/1f4bb.png new file mode 100644 index 0000000..18082d5 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4bb.png differ diff --git a/src/ui/slint/assets/emoji/1f4cc.png b/src/ui/slint/assets/emoji/1f4cc.png new file mode 100644 index 0000000..4c0e4af Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4cc.png differ diff --git a/src/ui/slint/assets/emoji/1f4ce.png b/src/ui/slint/assets/emoji/1f4ce.png new file mode 100644 index 0000000..6859e50 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4ce.png differ diff --git a/src/ui/slint/assets/emoji/1f4da.png b/src/ui/slint/assets/emoji/1f4da.png new file mode 100644 index 0000000..cf6479f Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4da.png differ diff --git a/src/ui/slint/assets/emoji/1f4dd.png b/src/ui/slint/assets/emoji/1f4dd.png new file mode 100644 index 0000000..040c212 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4dd.png differ diff --git a/src/ui/slint/assets/emoji/1f4f1.png b/src/ui/slint/assets/emoji/1f4f1.png new file mode 100644 index 0000000..69127fb Binary files /dev/null and b/src/ui/slint/assets/emoji/1f4f1.png differ diff --git a/src/ui/slint/assets/emoji/1f50b.png b/src/ui/slint/assets/emoji/1f50b.png new file mode 100644 index 0000000..c0137aa Binary files /dev/null and b/src/ui/slint/assets/emoji/1f50b.png differ diff --git a/src/ui/slint/assets/emoji/1f511.png b/src/ui/slint/assets/emoji/1f511.png new file mode 100644 index 0000000..5682ee5 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f511.png differ diff --git a/src/ui/slint/assets/emoji/1f512.png b/src/ui/slint/assets/emoji/1f512.png new file mode 100644 index 0000000..e9ac6fd Binary files /dev/null and b/src/ui/slint/assets/emoji/1f512.png differ diff --git a/src/ui/slint/assets/emoji/1f514.png b/src/ui/slint/assets/emoji/1f514.png new file mode 100644 index 0000000..c781d2d Binary files /dev/null and b/src/ui/slint/assets/emoji/1f514.png differ diff --git a/src/ui/slint/assets/emoji/1f517.png b/src/ui/slint/assets/emoji/1f517.png new file mode 100644 index 0000000..4f87a9b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f517.png differ diff --git a/src/ui/slint/assets/emoji/1f525.png b/src/ui/slint/assets/emoji/1f525.png new file mode 100644 index 0000000..99689e0 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f525.png differ diff --git a/src/ui/slint/assets/emoji/1f527.png b/src/ui/slint/assets/emoji/1f527.png new file mode 100644 index 0000000..e10e657 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f527.png differ diff --git a/src/ui/slint/assets/emoji/1f528.png b/src/ui/slint/assets/emoji/1f528.png new file mode 100644 index 0000000..e195cac Binary files /dev/null and b/src/ui/slint/assets/emoji/1f528.png differ diff --git a/src/ui/slint/assets/emoji/1f579-fe0f.png b/src/ui/slint/assets/emoji/1f579-fe0f.png new file mode 100644 index 0000000..08bcd8c Binary files /dev/null and b/src/ui/slint/assets/emoji/1f579-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/1f5a4.png b/src/ui/slint/assets/emoji/1f5a4.png new file mode 100644 index 0000000..7b1f419 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f5a4.png differ diff --git a/src/ui/slint/assets/emoji/1f600.png b/src/ui/slint/assets/emoji/1f600.png new file mode 100644 index 0000000..cc3158e Binary files /dev/null and b/src/ui/slint/assets/emoji/1f600.png differ diff --git a/src/ui/slint/assets/emoji/1f601.png b/src/ui/slint/assets/emoji/1f601.png new file mode 100644 index 0000000..9c287d1 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f601.png differ diff --git a/src/ui/slint/assets/emoji/1f602.png b/src/ui/slint/assets/emoji/1f602.png new file mode 100644 index 0000000..4a7b3cd Binary files /dev/null and b/src/ui/slint/assets/emoji/1f602.png differ diff --git a/src/ui/slint/assets/emoji/1f603.png b/src/ui/slint/assets/emoji/1f603.png new file mode 100644 index 0000000..753dae3 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f603.png differ diff --git a/src/ui/slint/assets/emoji/1f604.png b/src/ui/slint/assets/emoji/1f604.png new file mode 100644 index 0000000..6c621d9 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f604.png differ diff --git a/src/ui/slint/assets/emoji/1f605.png b/src/ui/slint/assets/emoji/1f605.png new file mode 100644 index 0000000..d8d7528 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f605.png differ diff --git a/src/ui/slint/assets/emoji/1f606.png b/src/ui/slint/assets/emoji/1f606.png new file mode 100644 index 0000000..e7367d5 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f606.png differ diff --git a/src/ui/slint/assets/emoji/1f607.png b/src/ui/slint/assets/emoji/1f607.png new file mode 100644 index 0000000..cdbd851 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f607.png differ diff --git a/src/ui/slint/assets/emoji/1f609.png b/src/ui/slint/assets/emoji/1f609.png new file mode 100644 index 0000000..47acef0 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f609.png differ diff --git a/src/ui/slint/assets/emoji/1f60a.png b/src/ui/slint/assets/emoji/1f60a.png new file mode 100644 index 0000000..bd7c6ac Binary files /dev/null and b/src/ui/slint/assets/emoji/1f60a.png differ diff --git a/src/ui/slint/assets/emoji/1f60b.png b/src/ui/slint/assets/emoji/1f60b.png new file mode 100644 index 0000000..b20b7de Binary files /dev/null and b/src/ui/slint/assets/emoji/1f60b.png differ diff --git a/src/ui/slint/assets/emoji/1f60c.png b/src/ui/slint/assets/emoji/1f60c.png new file mode 100644 index 0000000..210e0ff Binary files /dev/null and b/src/ui/slint/assets/emoji/1f60c.png differ diff --git a/src/ui/slint/assets/emoji/1f60d.png b/src/ui/slint/assets/emoji/1f60d.png new file mode 100644 index 0000000..3b31eed Binary files /dev/null and b/src/ui/slint/assets/emoji/1f60d.png differ diff --git a/src/ui/slint/assets/emoji/1f60e.png b/src/ui/slint/assets/emoji/1f60e.png new file mode 100644 index 0000000..6a9a1e3 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f60e.png differ diff --git a/src/ui/slint/assets/emoji/1f60f.png b/src/ui/slint/assets/emoji/1f60f.png new file mode 100644 index 0000000..f1e4abf Binary files /dev/null and b/src/ui/slint/assets/emoji/1f60f.png differ diff --git a/src/ui/slint/assets/emoji/1f610.png b/src/ui/slint/assets/emoji/1f610.png new file mode 100644 index 0000000..10578ab Binary files /dev/null and b/src/ui/slint/assets/emoji/1f610.png differ diff --git a/src/ui/slint/assets/emoji/1f611.png b/src/ui/slint/assets/emoji/1f611.png new file mode 100644 index 0000000..fd92311 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f611.png differ diff --git a/src/ui/slint/assets/emoji/1f612.png b/src/ui/slint/assets/emoji/1f612.png new file mode 100644 index 0000000..dbc6670 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f612.png differ diff --git a/src/ui/slint/assets/emoji/1f614.png b/src/ui/slint/assets/emoji/1f614.png new file mode 100644 index 0000000..c7be074 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f614.png differ diff --git a/src/ui/slint/assets/emoji/1f615.png b/src/ui/slint/assets/emoji/1f615.png new file mode 100644 index 0000000..6d6668b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f615.png differ diff --git a/src/ui/slint/assets/emoji/1f618.png b/src/ui/slint/assets/emoji/1f618.png new file mode 100644 index 0000000..386383f Binary files /dev/null and b/src/ui/slint/assets/emoji/1f618.png differ diff --git a/src/ui/slint/assets/emoji/1f61b.png b/src/ui/slint/assets/emoji/1f61b.png new file mode 100644 index 0000000..65c64ca Binary files /dev/null and b/src/ui/slint/assets/emoji/1f61b.png differ diff --git a/src/ui/slint/assets/emoji/1f61c.png b/src/ui/slint/assets/emoji/1f61c.png new file mode 100644 index 0000000..0ffeb7b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f61c.png differ diff --git a/src/ui/slint/assets/emoji/1f61f.png b/src/ui/slint/assets/emoji/1f61f.png new file mode 100644 index 0000000..1d40ebe Binary files /dev/null and b/src/ui/slint/assets/emoji/1f61f.png differ diff --git a/src/ui/slint/assets/emoji/1f620.png b/src/ui/slint/assets/emoji/1f620.png new file mode 100644 index 0000000..a417574 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f620.png differ diff --git a/src/ui/slint/assets/emoji/1f621.png b/src/ui/slint/assets/emoji/1f621.png new file mode 100644 index 0000000..9d7c543 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f621.png differ diff --git a/src/ui/slint/assets/emoji/1f622.png b/src/ui/slint/assets/emoji/1f622.png new file mode 100644 index 0000000..00d36f1 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f622.png differ diff --git a/src/ui/slint/assets/emoji/1f624.png b/src/ui/slint/assets/emoji/1f624.png new file mode 100644 index 0000000..2b17266 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f624.png differ diff --git a/src/ui/slint/assets/emoji/1f62a.png b/src/ui/slint/assets/emoji/1f62a.png new file mode 100644 index 0000000..f154968 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f62a.png differ diff --git a/src/ui/slint/assets/emoji/1f62c.png b/src/ui/slint/assets/emoji/1f62c.png new file mode 100644 index 0000000..45e4d75 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f62c.png differ diff --git a/src/ui/slint/assets/emoji/1f62d.png b/src/ui/slint/assets/emoji/1f62d.png new file mode 100644 index 0000000..9c89ddd Binary files /dev/null and b/src/ui/slint/assets/emoji/1f62d.png differ diff --git a/src/ui/slint/assets/emoji/1f62e.png b/src/ui/slint/assets/emoji/1f62e.png new file mode 100644 index 0000000..0b5cc96 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f62e.png differ diff --git a/src/ui/slint/assets/emoji/1f631.png b/src/ui/slint/assets/emoji/1f631.png new file mode 100644 index 0000000..f6c19cf Binary files /dev/null and b/src/ui/slint/assets/emoji/1f631.png differ diff --git a/src/ui/slint/assets/emoji/1f632.png b/src/ui/slint/assets/emoji/1f632.png new file mode 100644 index 0000000..f788742 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f632.png differ diff --git a/src/ui/slint/assets/emoji/1f633.png b/src/ui/slint/assets/emoji/1f633.png new file mode 100644 index 0000000..d32e8c2 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f633.png differ diff --git a/src/ui/slint/assets/emoji/1f634.png b/src/ui/slint/assets/emoji/1f634.png new file mode 100644 index 0000000..1b94ab1 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f634.png differ diff --git a/src/ui/slint/assets/emoji/1f637.png b/src/ui/slint/assets/emoji/1f637.png new file mode 100644 index 0000000..e92e87f Binary files /dev/null and b/src/ui/slint/assets/emoji/1f637.png differ diff --git a/src/ui/slint/assets/emoji/1f641.png b/src/ui/slint/assets/emoji/1f641.png new file mode 100644 index 0000000..f26092c Binary files /dev/null and b/src/ui/slint/assets/emoji/1f641.png differ diff --git a/src/ui/slint/assets/emoji/1f642.png b/src/ui/slint/assets/emoji/1f642.png new file mode 100644 index 0000000..19d9efd Binary files /dev/null and b/src/ui/slint/assets/emoji/1f642.png differ diff --git a/src/ui/slint/assets/emoji/1f643.png b/src/ui/slint/assets/emoji/1f643.png new file mode 100644 index 0000000..f4f9754 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f643.png differ diff --git a/src/ui/slint/assets/emoji/1f644.png b/src/ui/slint/assets/emoji/1f644.png new file mode 100644 index 0000000..68cdfbe Binary files /dev/null and b/src/ui/slint/assets/emoji/1f644.png differ diff --git a/src/ui/slint/assets/emoji/1f648.png b/src/ui/slint/assets/emoji/1f648.png new file mode 100644 index 0000000..61a57b7 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f648.png differ diff --git a/src/ui/slint/assets/emoji/1f64c.png b/src/ui/slint/assets/emoji/1f64c.png new file mode 100644 index 0000000..1db01c9 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f64c.png differ diff --git a/src/ui/slint/assets/emoji/1f64f.png b/src/ui/slint/assets/emoji/1f64f.png new file mode 100644 index 0000000..d4d3a6d Binary files /dev/null and b/src/ui/slint/assets/emoji/1f64f.png differ diff --git a/src/ui/slint/assets/emoji/1f680.png b/src/ui/slint/assets/emoji/1f680.png new file mode 100644 index 0000000..b207bb9 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f680.png differ diff --git a/src/ui/slint/assets/emoji/1f697.png b/src/ui/slint/assets/emoji/1f697.png new file mode 100644 index 0000000..9d64984 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f697.png differ diff --git a/src/ui/slint/assets/emoji/1f6e1-fe0f.png b/src/ui/slint/assets/emoji/1f6e1-fe0f.png new file mode 100644 index 0000000..09f84e1 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f6e1-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/1f911.png b/src/ui/slint/assets/emoji/1f911.png new file mode 100644 index 0000000..1e47b47 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f911.png differ diff --git a/src/ui/slint/assets/emoji/1f912.png b/src/ui/slint/assets/emoji/1f912.png new file mode 100644 index 0000000..ddd81b8 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f912.png differ diff --git a/src/ui/slint/assets/emoji/1f913.png b/src/ui/slint/assets/emoji/1f913.png new file mode 100644 index 0000000..5e1815e Binary files /dev/null and b/src/ui/slint/assets/emoji/1f913.png differ diff --git a/src/ui/slint/assets/emoji/1f914.png b/src/ui/slint/assets/emoji/1f914.png new file mode 100644 index 0000000..68740f0 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f914.png differ diff --git a/src/ui/slint/assets/emoji/1f916.png b/src/ui/slint/assets/emoji/1f916.png new file mode 100644 index 0000000..17cb47e Binary files /dev/null and b/src/ui/slint/assets/emoji/1f916.png differ diff --git a/src/ui/slint/assets/emoji/1f917.png b/src/ui/slint/assets/emoji/1f917.png new file mode 100644 index 0000000..8537850 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f917.png differ diff --git a/src/ui/slint/assets/emoji/1f919.png b/src/ui/slint/assets/emoji/1f919.png new file mode 100644 index 0000000..4b14e32 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f919.png differ diff --git a/src/ui/slint/assets/emoji/1f91d.png b/src/ui/slint/assets/emoji/1f91d.png new file mode 100644 index 0000000..7ea6169 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f91d.png differ diff --git a/src/ui/slint/assets/emoji/1f91e.png b/src/ui/slint/assets/emoji/1f91e.png new file mode 100644 index 0000000..ed64df5 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f91e.png differ diff --git a/src/ui/slint/assets/emoji/1f921.png b/src/ui/slint/assets/emoji/1f921.png new file mode 100644 index 0000000..ed5b0ec Binary files /dev/null and b/src/ui/slint/assets/emoji/1f921.png differ diff --git a/src/ui/slint/assets/emoji/1f922.png b/src/ui/slint/assets/emoji/1f922.png new file mode 100644 index 0000000..c77a608 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f922.png differ diff --git a/src/ui/slint/assets/emoji/1f923.png b/src/ui/slint/assets/emoji/1f923.png new file mode 100644 index 0000000..d7b9003 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f923.png differ diff --git a/src/ui/slint/assets/emoji/1f928.png b/src/ui/slint/assets/emoji/1f928.png new file mode 100644 index 0000000..dcd3415 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f928.png differ diff --git a/src/ui/slint/assets/emoji/1f929.png b/src/ui/slint/assets/emoji/1f929.png new file mode 100644 index 0000000..c8e5a26 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f929.png differ diff --git a/src/ui/slint/assets/emoji/1f92f.png b/src/ui/slint/assets/emoji/1f92f.png new file mode 100644 index 0000000..ee1e1f7 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f92f.png differ diff --git a/src/ui/slint/assets/emoji/1f933.png b/src/ui/slint/assets/emoji/1f933.png new file mode 100644 index 0000000..726180b Binary files /dev/null and b/src/ui/slint/assets/emoji/1f933.png differ diff --git a/src/ui/slint/assets/emoji/1f937.png b/src/ui/slint/assets/emoji/1f937.png new file mode 100644 index 0000000..d40cf90 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f937.png differ diff --git a/src/ui/slint/assets/emoji/1f970.png b/src/ui/slint/assets/emoji/1f970.png new file mode 100644 index 0000000..7cc68cb Binary files /dev/null and b/src/ui/slint/assets/emoji/1f970.png differ diff --git a/src/ui/slint/assets/emoji/1f97a.png b/src/ui/slint/assets/emoji/1f97a.png new file mode 100644 index 0000000..72ebc61 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f97a.png differ diff --git a/src/ui/slint/assets/emoji/1f981.png b/src/ui/slint/assets/emoji/1f981.png new file mode 100644 index 0000000..6a6890c Binary files /dev/null and b/src/ui/slint/assets/emoji/1f981.png differ diff --git a/src/ui/slint/assets/emoji/1f984.png b/src/ui/slint/assets/emoji/1f984.png new file mode 100644 index 0000000..63242d3 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f984.png differ diff --git a/src/ui/slint/assets/emoji/1f98a.png b/src/ui/slint/assets/emoji/1f98a.png new file mode 100644 index 0000000..ecb5ea0 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f98a.png differ diff --git a/src/ui/slint/assets/emoji/1f98b.png b/src/ui/slint/assets/emoji/1f98b.png new file mode 100644 index 0000000..93a50ed Binary files /dev/null and b/src/ui/slint/assets/emoji/1f98b.png differ diff --git a/src/ui/slint/assets/emoji/1f9e0.png b/src/ui/slint/assets/emoji/1f9e0.png new file mode 100644 index 0000000..00fbb29 Binary files /dev/null and b/src/ui/slint/assets/emoji/1f9e0.png differ diff --git a/src/ui/slint/assets/emoji/1f9e1.png b/src/ui/slint/assets/emoji/1f9e1.png new file mode 100644 index 0000000..4e0942a Binary files /dev/null and b/src/ui/slint/assets/emoji/1f9e1.png differ diff --git a/src/ui/slint/assets/emoji/2328-fe0f.png b/src/ui/slint/assets/emoji/2328-fe0f.png new file mode 100644 index 0000000..fdbff6c Binary files /dev/null and b/src/ui/slint/assets/emoji/2328-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/2600-fe0f.png b/src/ui/slint/assets/emoji/2600-fe0f.png new file mode 100644 index 0000000..c3595a7 Binary files /dev/null and b/src/ui/slint/assets/emoji/2600-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/2602-fe0f.png b/src/ui/slint/assets/emoji/2602-fe0f.png new file mode 100644 index 0000000..b5ca1b9 Binary files /dev/null and b/src/ui/slint/assets/emoji/2602-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/2615.png b/src/ui/slint/assets/emoji/2615.png new file mode 100644 index 0000000..c7dc089 Binary files /dev/null and b/src/ui/slint/assets/emoji/2615.png differ diff --git a/src/ui/slint/assets/emoji/261d-fe0f.png b/src/ui/slint/assets/emoji/261d-fe0f.png new file mode 100644 index 0000000..635e143 Binary files /dev/null and b/src/ui/slint/assets/emoji/261d-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/2699-fe0f.png b/src/ui/slint/assets/emoji/2699-fe0f.png new file mode 100644 index 0000000..877c0ab Binary files /dev/null and b/src/ui/slint/assets/emoji/2699-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/26a0-fe0f.png b/src/ui/slint/assets/emoji/26a0-fe0f.png new file mode 100644 index 0000000..8d0d556 Binary files /dev/null and b/src/ui/slint/assets/emoji/26a0-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/26a1.png b/src/ui/slint/assets/emoji/26a1.png new file mode 100644 index 0000000..2990504 Binary files /dev/null and b/src/ui/slint/assets/emoji/26a1.png differ diff --git a/src/ui/slint/assets/emoji/26bd.png b/src/ui/slint/assets/emoji/26bd.png new file mode 100644 index 0000000..cf46cb6 Binary files /dev/null and b/src/ui/slint/assets/emoji/26bd.png differ diff --git a/src/ui/slint/assets/emoji/26d4.png b/src/ui/slint/assets/emoji/26d4.png new file mode 100644 index 0000000..3cc4a7c Binary files /dev/null and b/src/ui/slint/assets/emoji/26d4.png differ diff --git a/src/ui/slint/assets/emoji/2702-fe0f.png b/src/ui/slint/assets/emoji/2702-fe0f.png new file mode 100644 index 0000000..cc321a5 Binary files /dev/null and b/src/ui/slint/assets/emoji/2702-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/2705.png b/src/ui/slint/assets/emoji/2705.png new file mode 100644 index 0000000..2ecb281 Binary files /dev/null and b/src/ui/slint/assets/emoji/2705.png differ diff --git a/src/ui/slint/assets/emoji/2708-fe0f.png b/src/ui/slint/assets/emoji/2708-fe0f.png new file mode 100644 index 0000000..f6c8a6e Binary files /dev/null and b/src/ui/slint/assets/emoji/2708-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/270a.png b/src/ui/slint/assets/emoji/270a.png new file mode 100644 index 0000000..c7b6508 Binary files /dev/null and b/src/ui/slint/assets/emoji/270a.png differ diff --git a/src/ui/slint/assets/emoji/270b.png b/src/ui/slint/assets/emoji/270b.png new file mode 100644 index 0000000..62f2655 Binary files /dev/null and b/src/ui/slint/assets/emoji/270b.png differ diff --git a/src/ui/slint/assets/emoji/270c-fe0f.png b/src/ui/slint/assets/emoji/270c-fe0f.png new file mode 100644 index 0000000..e3a614e Binary files /dev/null and b/src/ui/slint/assets/emoji/270c-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/270d-fe0f.png b/src/ui/slint/assets/emoji/270d-fe0f.png new file mode 100644 index 0000000..2aab4e7 Binary files /dev/null and b/src/ui/slint/assets/emoji/270d-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/2728.png b/src/ui/slint/assets/emoji/2728.png new file mode 100644 index 0000000..f51b1dc Binary files /dev/null and b/src/ui/slint/assets/emoji/2728.png differ diff --git a/src/ui/slint/assets/emoji/2744-fe0f.png b/src/ui/slint/assets/emoji/2744-fe0f.png new file mode 100644 index 0000000..27eca9b Binary files /dev/null and b/src/ui/slint/assets/emoji/2744-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/274c.png b/src/ui/slint/assets/emoji/274c.png new file mode 100644 index 0000000..cc30de2 Binary files /dev/null and b/src/ui/slint/assets/emoji/274c.png differ diff --git a/src/ui/slint/assets/emoji/2753.png b/src/ui/slint/assets/emoji/2753.png new file mode 100644 index 0000000..8418008 Binary files /dev/null and b/src/ui/slint/assets/emoji/2753.png differ diff --git a/src/ui/slint/assets/emoji/2757.png b/src/ui/slint/assets/emoji/2757.png new file mode 100644 index 0000000..3e9d9c1 Binary files /dev/null and b/src/ui/slint/assets/emoji/2757.png differ diff --git a/src/ui/slint/assets/emoji/2764-fe0f.png b/src/ui/slint/assets/emoji/2764-fe0f.png new file mode 100644 index 0000000..6858009 Binary files /dev/null and b/src/ui/slint/assets/emoji/2764-fe0f.png differ diff --git a/src/ui/slint/assets/emoji/2b50.png b/src/ui/slint/assets/emoji/2b50.png new file mode 100644 index 0000000..f1e201e Binary files /dev/null and b/src/ui/slint/assets/emoji/2b50.png differ diff --git a/src/ui/slint/assets/emoji/LICENSE b/src/ui/slint/assets/emoji/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/src/ui/slint/assets/emoji/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/ui/slint/assets/icons/LICENSE b/src/ui/slint/assets/icons/LICENSE new file mode 100644 index 0000000..718bb3f --- /dev/null +++ b/src/ui/slint/assets/icons/LICENSE @@ -0,0 +1,43 @@ +ISC License + +Copyright (c) 2026 Lucide Icons and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--- + +The following Lucide icons are derived from the Feather project: + +airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out + +The MIT License (MIT) (for the icons listed above) + +Copyright (c) 2013-present Cole Bemis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/ui/slint/assets/icons/at-sign.svg b/src/ui/slint/assets/icons/at-sign.svg new file mode 100644 index 0000000..fdd513d --- /dev/null +++ b/src/ui/slint/assets/icons/at-sign.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/audio-lines.svg b/src/ui/slint/assets/icons/audio-lines.svg new file mode 100644 index 0000000..1db0c53 --- /dev/null +++ b/src/ui/slint/assets/icons/audio-lines.svg @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/src/ui/slint/assets/icons/ban.svg b/src/ui/slint/assets/icons/ban.svg new file mode 100644 index 0000000..46cbb2c --- /dev/null +++ b/src/ui/slint/assets/icons/ban.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/bell.svg b/src/ui/slint/assets/icons/bell.svg new file mode 100644 index 0000000..aa91a2c --- /dev/null +++ b/src/ui/slint/assets/icons/bell.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/check.svg b/src/ui/slint/assets/icons/check.svg new file mode 100644 index 0000000..38fa0cc --- /dev/null +++ b/src/ui/slint/assets/icons/check.svg @@ -0,0 +1,15 @@ + + + + diff --git a/src/ui/slint/assets/icons/chevron-down.svg b/src/ui/slint/assets/icons/chevron-down.svg new file mode 100644 index 0000000..a8a6b5d --- /dev/null +++ b/src/ui/slint/assets/icons/chevron-down.svg @@ -0,0 +1,15 @@ + + + + diff --git a/src/ui/slint/assets/icons/circle.svg b/src/ui/slint/assets/icons/circle.svg new file mode 100644 index 0000000..4fd52d3 --- /dev/null +++ b/src/ui/slint/assets/icons/circle.svg @@ -0,0 +1,15 @@ + + + + diff --git a/src/ui/slint/assets/icons/corner-down-right.svg b/src/ui/slint/assets/icons/corner-down-right.svg new file mode 100644 index 0000000..fcd9091 --- /dev/null +++ b/src/ui/slint/assets/icons/corner-down-right.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/hash.svg b/src/ui/slint/assets/icons/hash.svg new file mode 100644 index 0000000..b8902b0 --- /dev/null +++ b/src/ui/slint/assets/icons/hash.svg @@ -0,0 +1,18 @@ + + + + + + + diff --git a/src/ui/slint/assets/icons/headphone-off.svg b/src/ui/slint/assets/icons/headphone-off.svg new file mode 100644 index 0000000..0525b1b --- /dev/null +++ b/src/ui/slint/assets/icons/headphone-off.svg @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/src/ui/slint/assets/icons/headphones.svg b/src/ui/slint/assets/icons/headphones.svg new file mode 100644 index 0000000..8c37ab5 --- /dev/null +++ b/src/ui/slint/assets/icons/headphones.svg @@ -0,0 +1,15 @@ + + + + diff --git a/src/ui/slint/assets/icons/house.svg b/src/ui/slint/assets/icons/house.svg new file mode 100644 index 0000000..32705ef --- /dev/null +++ b/src/ui/slint/assets/icons/house.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/image.svg b/src/ui/slint/assets/icons/image.svg new file mode 100644 index 0000000..cc6b429 --- /dev/null +++ b/src/ui/slint/assets/icons/image.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/ui/slint/assets/icons/key-round.svg b/src/ui/slint/assets/icons/key-round.svg new file mode 100644 index 0000000..6672612 --- /dev/null +++ b/src/ui/slint/assets/icons/key-round.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/log-out.svg b/src/ui/slint/assets/icons/log-out.svg new file mode 100644 index 0000000..d36a670 --- /dev/null +++ b/src/ui/slint/assets/icons/log-out.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/ui/slint/assets/icons/mic-off.svg b/src/ui/slint/assets/icons/mic-off.svg new file mode 100644 index 0000000..b1f4d20 --- /dev/null +++ b/src/ui/slint/assets/icons/mic-off.svg @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/src/ui/slint/assets/icons/mic.svg b/src/ui/slint/assets/icons/mic.svg new file mode 100644 index 0000000..0177087 --- /dev/null +++ b/src/ui/slint/assets/icons/mic.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/ui/slint/assets/icons/minus.svg b/src/ui/slint/assets/icons/minus.svg new file mode 100644 index 0000000..5b2110d --- /dev/null +++ b/src/ui/slint/assets/icons/minus.svg @@ -0,0 +1,15 @@ + + + + diff --git a/src/ui/slint/assets/icons/monitor.svg b/src/ui/slint/assets/icons/monitor.svg new file mode 100644 index 0000000..c6430cf --- /dev/null +++ b/src/ui/slint/assets/icons/monitor.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/ui/slint/assets/icons/palette.svg b/src/ui/slint/assets/icons/palette.svg new file mode 100644 index 0000000..3ee1dfd --- /dev/null +++ b/src/ui/slint/assets/icons/palette.svg @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/src/ui/slint/assets/icons/pencil.svg b/src/ui/slint/assets/icons/pencil.svg new file mode 100644 index 0000000..1c2a71b --- /dev/null +++ b/src/ui/slint/assets/icons/pencil.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/phone-off.svg b/src/ui/slint/assets/icons/phone-off.svg new file mode 100644 index 0000000..f71c35a --- /dev/null +++ b/src/ui/slint/assets/icons/phone-off.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/ui/slint/assets/icons/pin.svg b/src/ui/slint/assets/icons/pin.svg new file mode 100644 index 0000000..fc10661 --- /dev/null +++ b/src/ui/slint/assets/icons/pin.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/plus.svg b/src/ui/slint/assets/icons/plus.svg new file mode 100644 index 0000000..9b435a9 --- /dev/null +++ b/src/ui/slint/assets/icons/plus.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/reply.svg b/src/ui/slint/assets/icons/reply.svg new file mode 100644 index 0000000..28d571d --- /dev/null +++ b/src/ui/slint/assets/icons/reply.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/screen-share.svg b/src/ui/slint/assets/icons/screen-share.svg new file mode 100644 index 0000000..791e8f5 --- /dev/null +++ b/src/ui/slint/assets/icons/screen-share.svg @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/src/ui/slint/assets/icons/search.svg b/src/ui/slint/assets/icons/search.svg new file mode 100644 index 0000000..18a60c3 --- /dev/null +++ b/src/ui/slint/assets/icons/search.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/send.svg b/src/ui/slint/assets/icons/send.svg new file mode 100644 index 0000000..b033f22 --- /dev/null +++ b/src/ui/slint/assets/icons/send.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/settings.svg b/src/ui/slint/assets/icons/settings.svg new file mode 100644 index 0000000..446be5e --- /dev/null +++ b/src/ui/slint/assets/icons/settings.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/shield-check.svg b/src/ui/slint/assets/icons/shield-check.svg new file mode 100644 index 0000000..9e6840c --- /dev/null +++ b/src/ui/slint/assets/icons/shield-check.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/smile-plus.svg b/src/ui/slint/assets/icons/smile-plus.svg new file mode 100644 index 0000000..f167032 --- /dev/null +++ b/src/ui/slint/assets/icons/smile-plus.svg @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/src/ui/slint/assets/icons/smile.svg b/src/ui/slint/assets/icons/smile.svg new file mode 100644 index 0000000..25d77df --- /dev/null +++ b/src/ui/slint/assets/icons/smile.svg @@ -0,0 +1,18 @@ + + + + + + + diff --git a/src/ui/slint/assets/icons/trash-2.svg b/src/ui/slint/assets/icons/trash-2.svg new file mode 100644 index 0000000..9ad7f23 --- /dev/null +++ b/src/ui/slint/assets/icons/trash-2.svg @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/src/ui/slint/assets/icons/user-plus.svg b/src/ui/slint/assets/icons/user-plus.svg new file mode 100644 index 0000000..aaa4428 --- /dev/null +++ b/src/ui/slint/assets/icons/user-plus.svg @@ -0,0 +1,18 @@ + + + + + + + diff --git a/src/ui/slint/assets/icons/user.svg b/src/ui/slint/assets/icons/user.svg new file mode 100644 index 0000000..39dbf84 --- /dev/null +++ b/src/ui/slint/assets/icons/user.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/assets/icons/users.svg b/src/ui/slint/assets/icons/users.svg new file mode 100644 index 0000000..2dcf298 --- /dev/null +++ b/src/ui/slint/assets/icons/users.svg @@ -0,0 +1,18 @@ + + + + + + + diff --git a/src/ui/slint/assets/icons/volume-2.svg b/src/ui/slint/assets/icons/volume-2.svg new file mode 100644 index 0000000..72c1a23 --- /dev/null +++ b/src/ui/slint/assets/icons/volume-2.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/ui/slint/assets/icons/webhook.svg b/src/ui/slint/assets/icons/webhook.svg new file mode 100644 index 0000000..fdeeefd --- /dev/null +++ b/src/ui/slint/assets/icons/webhook.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/src/ui/slint/assets/icons/x.svg b/src/ui/slint/assets/icons/x.svg new file mode 100644 index 0000000..346a21a --- /dev/null +++ b/src/ui/slint/assets/icons/x.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/src/ui/slint/avatar-cropper.slint b/src/ui/slint/avatar-cropper.slint index a753777..3f6371d 100644 --- a/src/ui/slint/avatar-cropper.slint +++ b/src/ui/slint/avatar-cropper.slint @@ -38,7 +38,7 @@ export component AvatarCropper inherits Rectangle { padding: 18px; spacing: 8px; alignment: start; HorizontalLayout { Text { text: @tr("Crop photo"); color: Theme.text-primary; font-size: Theme.font-size + 5px; font-weight: 600; horizontal-stretch: 1; vertical-alignment: center; } - ActionButton { text: "×"; width: 30px; quiet: true; clicked => { root.cancel(); } } + ActionButton { text: @tr("Cancel"); icon: "x"; width: 30px; quiet: true; clicked => { root.cancel(); } } } Text { text: @tr("Drag the photo and adjust the zoom."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); } Rectangle { height: 4px; } @@ -95,7 +95,7 @@ export component AvatarCropper inherits Rectangle { Rectangle { height: 2px; } HorizontalLayout { spacing: 10px; - ActionButton { text: "−"; width: 32px; clicked => { root.set-zoom(root.zoom - 0.1); } } + ActionButton { text: "-"; width: 32px; clicked => { root.set-zoom(root.zoom - 0.1); } } AudioSlider { minimum: 1; maximum: 3; value <=> root.zoom; changed(value) => { root.zoom-changed(value); } } ActionButton { text: "+"; width: 32px; clicked => { root.set-zoom(root.zoom + 0.1); } } } diff --git a/src/ui/slint/avatar-view.slint b/src/ui/slint/avatar-view.slint index 0555706..b521265 100644 --- a/src/ui/slint/avatar-view.slint +++ b/src/ui/slint/avatar-view.slint @@ -1,16 +1,23 @@ import { Theme } from "theme.slint"; +/// The one avatar component used for every person in the app: user panel, messages, member +/// lists, voice cards, friends and settings. Shows the picture when there is one and the +/// initials otherwise. `mask` must be the colour of the surface behind the avatar. export component AvatarView inherits Rectangle { in property source; in property has-source; in property initials; in property mask: Theme.bg-base; + // "", "online", "idle", "dnd" or "offline": draws a presence dot at the bottom right. + in property presence; + // Draws a highlight ring around the avatar, used for the person currently speaking. + in property speaking; width: 34px; height: 34px; border-radius: self.width / 2; background: Theme.avatar-bg; clip: true; 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, Theme.font-size - 3px); horizontal-alignment: center; vertical-alignment: center; overflow: elide; } + 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; } // Explicit mask also works on software renderers that only clip rectangular bounds. Path { width: parent.width; height: parent.height; @@ -18,4 +25,25 @@ export component AvatarView inherits Rectangle { commands: "M0 0H320V320H0Z M320 160 A160 160 0 1 0 0 160 A160 160 0 1 0 320 160Z"; fill-rule: evenodd; fill: root.mask; } + if root.speaking : Rectangle { + width: parent.width; height: parent.height; + border-radius: self.width / 2; + border-width: Math.max(2px, root.width * 0.04); + border-color: Theme.success; + } +} + +/// Presence dot drawn over an avatar corner; kept outside AvatarView because the avatar clips. +export component PresenceDot inherits Rectangle { + in property presence; + in property ring: Theme.bg-base; + visible: root.presence != ""; + width: 12px; height: 12px; + border-radius: 6px; + background: root.ring; + Rectangle { + x: 2px; y: 2px; width: parent.width - 4px; height: parent.height - 4px; + border-radius: self.width / 2; + background: root.presence == "online" ? Theme.success : root.presence == "idle" ? Theme.accent : root.presence == "dnd" ? Theme.danger : Theme.text-disabled; + } } diff --git a/src/ui/slint/chat.slint b/src/ui/slint/chat.slint index d45455f..8b2ca71 100644 --- a/src/ui/slint/chat.slint +++ b/src/ui/slint/chat.slint @@ -1,15 +1,51 @@ -import { AvatarView } from "avatar-view.slint"; -import { Theme, ActionButton } from "theme.slint"; +import { AvatarView, PresenceDot } from "avatar-view.slint"; +import { Theme, ActionButton, Symbol } from "theme.slint"; +import { EmojiPicker } from "emoji-picker.slint"; +export struct ReactionItem { emoji: string, image: image, has_image: bool, count: int, mine: bool } export struct MessageItem { message_id: string, sender_id: string, sender_name: string, content: string, timestamp: string, is_own: bool, edited: bool, reply_to: string, avatar_text: string, show_author: bool, + reactions: [ReactionItem], } export struct DmConversationItem { dm_id: string, other_user_id: string, other_nickname: string, e2ee_enabled: bool, messages: [MessageItem], } -export struct MemberItem { user_id: string, nickname: string, status: string, avatar_text: string } +export struct MemberItem { user_id: string, nickname: string, status: string, presence: string, avatar_text: string, is_own: bool } + +component QuickReaction inherits Rectangle { + in property glyph; + in property label; + callback clicked(); + width: 30px; height: 28px; + border-radius: 6px; + background: touch.has-hover ? Theme.bg-hover : transparent; + accessible-role: button; + accessible-label: root.label; + Image { source: root.glyph; width: 18px; height: 18px; x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; } + touch := TouchArea { clicked => { root.clicked(); } } +} + +component ReactionChip inherits Rectangle { + in property reaction; + callback clicked(); + height: 24px; + width: content.preferred-width + 16px; + 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; + accessible-role: button; + accessible-label: root.reaction.emoji; + content := HorizontalLayout { + padding-left: 8px; padding-right: 8px; spacing: 5px; + if root.reaction.has_image : Image { source: root.reaction.image; width: 15px; height: 15px; y: (root.height - self.height) / 2; } + if !root.reaction.has_image : Text { text: root.reaction.emoji; vertical-alignment: center; font-size: Math.max(11px, Theme.font-size * 0.8125); color: Theme.text-primary; } + Text { text: root.reaction.count; vertical-alignment: center; color: root.reaction.mine ? Theme.accent : Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); font-weight: 600; } + } + touch := TouchArea { clicked => { root.clicked(); } } +} component MessageRow inherits Rectangle { in property message; @@ -24,42 +60,66 @@ component MessageRow inherits Rectangle { preferred-height: row-content.preferred-height; vertical-stretch: 0; background: row-touch.has-hover || row-focus.has-focus ? Theme.bg-hover : transparent; - row-touch := TouchArea { } - row-focus := FocusScope { } - row-content := HorizontalLayout { - padding-left: 22px; padding-right: 22px; - padding-top: root.message.show_author ? 9px : 2px; padding-bottom: root.message.show_author ? 9px : 2px; spacing: 13px; - AvatarView { - width: 34px; height: root.message.show_author ? 34px : 0px; visible: root.message.show_author; - source: root.own-avatar; has-source: root.has-own-avatar && root.message.is_own; - initials: root.message.avatar_text; mask: root.background; + row-focus := FocusScope { focus-on-click: false; } + // Content and action bar are children of the hover area: a sibling area would lose hover as + // soon as the pointer reaches a button or reaction chip. + row-touch := TouchArea { + row-content := HorizontalLayout { + padding-left: 22px; padding-right: 22px; + padding-top: root.message.show_author ? 9px : 2px; padding-bottom: root.message.show_author ? 9px : 2px; spacing: 13px; + AvatarView { + width: 34px; height: root.message.show_author ? 34px : 0px; visible: root.message.show_author; + source: root.own-avatar; has-source: root.has-own-avatar && root.message.is_own; + initials: root.message.avatar_text; mask: root.background; + } + VerticalLayout { + spacing: 4px; + if root.message.reply_to != "" : HorizontalLayout { + spacing: 6px; + Symbol { kind: "corner-down-right"; ink: Theme.text-muted; width: 13px; height: 13px; y: (parent.height - self.height) / 2; } + Text { text: root.message.reply_to; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); wrap: word-wrap; vertical-alignment: center; horizontal-stretch: 1; } + } + if root.message.show_author : HorizontalLayout { + spacing: 9px; + Text { text: root.message.sender_name; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.875); font-weight: 600; overflow: elide; vertical-alignment: center; } + Text { text: root.message.timestamp + (root.message.edited ? @tr(" · edited") : ""); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); vertical-alignment: center; } + Rectangle { horizontal-stretch: 1; } + } + Text { text: root.message.content; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); wrap: word-wrap; } + if root.message.reactions.length > 0 : HorizontalLayout { + spacing: 6px; alignment: start; padding-top: 2px; + for reaction in root.message.reactions: ReactionChip { + reaction: reaction; + clicked => { root.react(root.message.message_id, reaction.emoji); } + } + } + } } - VerticalLayout { - spacing: 4px; - if root.message.reply_to != "" : Text { - text: "↳ " + root.message.reply_to; - color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); wrap: word-wrap; + 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; + background: Theme.bg-surface; border-radius: 8px; + border-width: 1px; border-color: Theme.border; + 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); } } } - if root.message.show_author : HorizontalLayout { - spacing: 9px; - Text { text: root.message.sender_name; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.875); font-weight: 600; overflow: elide; } - Text { text: root.message.timestamp + (root.message.edited ? @tr(" · edited") : ""); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); } - Rectangle { horizontal-stretch: 1; } - } - Text { text: root.message.content; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); wrap: word-wrap; } } } - if root.actions-enabled && (row-touch.has-hover || row-focus.has-focus) : Rectangle { - x: parent.width - self.width - 16px; y: 0px; - width: root.message.is_own ? 245px : 136px; height: 32px; - background: Theme.bg-surface; border-radius: 6px; - border-width: 1px; border-color: Theme.border; - HorizontalLayout { - spacing: 3px; - ActionButton { text: "👍"; quiet: true; clicked => { root.react(root.message.message_id, "👍"); } } - ActionButton { text: @tr("Reply"); quiet: true; clicked => { root.reply-to-msg(root.message.message_id); } } - if root.message.is_own : ActionButton { text: @tr("Edit"); quiet: true; clicked => { root.edit-msg(root.message.message_id); } } - if root.message.is_own : ActionButton { text: @tr("Delete"); danger: true; quiet: true; clicked => { root.delete-msg(root.message.message_id); } } + reaction-popup := PopupWindow { + close-policy: PopupClosePolicy.close-on-click-outside; + width: 336px; height: 320px; + x: root.width - self.width - 16px; + y: root.absolute-position.y > 420px ? -self.height - 4px : 38px; + reaction-picker := EmojiPicker { + picked(glyph) => { reaction-popup.close(); root.react(root.message.message_id, glyph); } } } } @@ -95,13 +155,13 @@ export component ChatPanel inherits Rectangle { Rectangle { height: 56px; border-width: 1px; border-color: Theme.border; HorizontalLayout { - padding-left: 22px; padding-right: 16px; spacing: 12px; - Text { text: root.is-dm ? "@" : "#"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 1.4375); width: 20px; vertical-alignment: center; } + 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; } 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); } + 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; } - if !root.is-dm : ActionButton { text: @tr("Webhooks"); quiet: true; clicked => { root.open-webhooks(); } } - if !root.is-dm : ActionButton { text: @tr("Members"); active: root.members-visible; clicked => { root.toggle-members(); } } + if !root.is-dm : VerticalLayout { alignment: center; ActionButton { text: @tr("Webhooks"); icon: "webhook"; quiet: true; clicked => { root.open-webhooks(); } } } + if !root.is-dm : VerticalLayout { alignment: center; ActionButton { text: @tr("Members"); icon: "users"; active: root.members-visible; clicked => { root.toggle-members(); } } } } } HorizontalLayout { @@ -133,41 +193,65 @@ export component ChatPanel inherits Rectangle { height: 34px; background: Theme.bg-elevated; HorizontalLayout { padding-left: 16px; padding-right: 16px; spacing: 9px; - Text { text: @tr("Reply to {}", root.replying-to-sender); color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.75); } - Text { text: root.replying-to-content; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-stretch: 1; overflow: elide; } - ActionButton { text: "×"; quiet: true; width: 28px; clicked => { root.cancel-reply(); } } + Text { text: @tr("Reply to {}", root.replying-to-sender); color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.75); vertical-alignment: center; } + Text { text: root.replying-to-content; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-stretch: 1; overflow: elide; vertical-alignment: center; } + VerticalLayout { alignment: center; ActionButton { text: @tr("Cancel reply"); icon: "x"; quiet: true; width: 28px; height: 26px; clicked => { root.cancel-reply(); } } } } } Rectangle { - height: 92px; - VerticalLayout { - padding-left: 20px; padding-right: 20px; padding-top: 8px; spacing: 5px; - Rectangle { - background: Theme.bg-interactive; border-radius: 9px; - border-width: 1px; border-color: Theme.border; - HorizontalLayout { - padding: 10px; spacing: 10px; - editor := TextInput { - text <=> root.input-text; - single-line: false; - color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.9375); - horizontal-stretch: 1; wrap: word-wrap; - edited => { root.input-edited(self.text); } - key-pressed(event) => { - if event.text == "\n" && !event.modifiers.shift { - root.send-message(root.is-dm ? "" : root.active-channel-id, root.input-text); - return accept; - } - return reject; + height: composer.height + 24px; + composer := Rectangle { + x: 20px; y: 8px; + 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.with-alpha(0.6) : Theme.border; + HorizontalLayout { + padding-left: 14px; padding-right: 8px; padding-top: 11px; padding-bottom: 11px; spacing: 6px; + editor := TextInput { + text <=> root.input-text; + single-line: false; + color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.9375); + horizontal-stretch: 1; wrap: word-wrap; + selection-background-color: Theme.selected; selection-foreground-color: Theme.text-primary; + edited => { root.input-edited(self.text); } + key-pressed(event) => { + if event.text == "\n" && !event.modifiers.shift { + root.send-message(root.is-dm ? "" : root.active-channel-id, root.input-text); + return accept; } + return reject; } - ActionButton { - text: @tr("Send"); - clicked => { root.send-message(root.is-dm ? "" : root.active-channel-id, root.input-text); } + } + VerticalLayout { + alignment: end; + ActionButton { text: @tr("Emoji"); icon: "smile"; quiet: true; width: 32px; height: 30px; 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); } } + } + } + Text { + x: 14px; y: 11px; width: parent.width - 100px; + visible: root.input-text == ""; + text: @tr("Message"); + color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.9375); + } + emoji-popup := PopupWindow { + close-policy: PopupClosePolicy.close-on-click-outside; + width: 336px; height: 320px; + x: parent.width - self.width - 8px; + y: -self.height - 8px; + composer-picker := EmojiPicker { + picked(glyph) => { + editor.text = editor.text + glyph; + root.input-edited(editor.text); + emoji-popup.close(); + editor.focus(); } } } - Text { text: @tr("Enter to send · Shift+Enter for a new line"); color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.6875); height: 18px; } } } } @@ -176,13 +260,21 @@ export component ChatPanel inherits Rectangle { Flickable { content-width: self.width; VerticalLayout { - padding: 16px; spacing: 12px; - Text { text: @tr("Members — {}", root.members.length); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 28px; } + 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; } for member in root.members: HorizontalLayout { - height: 38px; spacing: 9px; - Rectangle { width: 28px; height: 28px; background: Theme.avatar-bg; border-radius: 11px; Text { text: member.avatar_text; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.6875); horizontal-alignment: center; vertical-alignment: center; } } + height: 40px; spacing: 10px; + Rectangle { + width: 30px; + AvatarView { + width: 30px; height: 30px; y: (parent.height - self.height) / 2; + source: root.own-avatar; has-source: root.has-own-avatar && member.is_own; + initials: member.avatar_text; mask: Theme.bg-surface; + } + PresenceDot { x: 19px; y: parent.height / 2 + 4px; presence: member.presence; ring: Theme.bg-surface; } + } VerticalLayout { - spacing: 1px; + spacing: 1px; alignment: center; Text { text: member.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.8125); overflow: elide; } Text { text: member.status; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); overflow: elide; } } diff --git a/src/ui/slint/connect.slint b/src/ui/slint/connect.slint index 9c6cb99..6019386 100644 --- a/src/ui/slint/connect.slint +++ b/src/ui/slint/connect.slint @@ -1,4 +1,4 @@ -import { Theme, ActionButton } from "theme.slint"; +import { Theme, ActionButton, Symbol } from "theme.slint"; export struct BookmarkItem { name: string, address: string } @@ -28,10 +28,11 @@ export component ConnectScreen inherits Rectangle { VerticalLayout { padding: 32px; spacing: 22px; HorizontalLayout { + spacing: 10px; 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; } + 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; } - ActionButton { text: @tr("Settings"); quiet: true; clicked => { root.open-settings(); } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Settings"); icon: "settings"; quiet: true; clicked => { root.open-settings(); } } } } Rectangle { vertical-stretch: 1; } HorizontalLayout { @@ -63,11 +64,26 @@ 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("Cancel"); height: 40px; clicked => { root.disconnect(); } } } - HorizontalLayout { + Rectangle { height: 30px; - ActionButton { text: root.auto-reconnect ? "✓" : "○"; width: 30px; height: 30px; quiet: true; clicked => { root.auto-reconnect = !root.auto-reconnect; root.auto-reconnect-changed(root.auto-reconnect); } } + accessible-role: checkbox; accessible-checked: root.auto-reconnect; accessible-label: @tr("Reconnect automatically"); + HorizontalLayout { + spacing: 9px; + Rectangle { + width: 20px; + Rectangle { + width: 18px; height: 18px; y: (parent.height - self.height) / 2; + border-radius: 5px; + background: root.auto-reconnect ? Theme.accent : Theme.bg-interactive; + border-width: 1px; border-color: root.auto-reconnect ? Theme.accent : Theme.text-disabled; + Symbol { visible: root.auto-reconnect; kind: "check"; ink: Theme.on-accent; width: 14px; height: 14px; x: 2px; y: 2px; } + } + } Text { text: @tr("Reconnect automatically"); color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); vertical-alignment: center; } Rectangle { horizontal-stretch: 1; } + } + // The whole row is one control, as users expect from a checkbox. + TouchArea { clicked => { root.auto-reconnect = !root.auto-reconnect; root.auto-reconnect-changed(root.auto-reconnect); } } } if root.connecting : Text { text: @tr("Connecting…"); color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.8125); } if root.status-text != "" : Text { text: root.status-text; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.8125); wrap: word-wrap; } @@ -75,7 +91,7 @@ export component ConnectScreen inherits Rectangle { HorizontalLayout { Text { text: @tr("Saved servers"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); font-weight: 600; } Rectangle { horizontal-stretch: 1; } - ActionButton { text: @tr("+ Save address"); quiet: true; clicked => { root.add-bookmark(root.address-input); } } + 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); } for server in root.bookmarks: HorizontalLayout { @@ -85,8 +101,8 @@ export component ConnectScreen inherits Rectangle { Text { text: server.name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); overflow: elide; } Text { text: server.address; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); overflow: elide; } } - ActionButton { text: @tr("Join"); quiet: true; clicked => { if !root.connecting { root.connect(server.address); } } } - ActionButton { text: "×"; width: 28px; quiet: true; clicked => { root.remove-bookmark(server.address); } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Join"); quiet: true; clicked => { if !root.connecting { root.connect(server.address); } } } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Remove saved server"); icon: "x"; width: 28px; quiet: true; clicked => { root.remove-bookmark(server.address); } } } } } } @@ -96,7 +112,7 @@ export component ConnectScreen inherits Rectangle { Text { text: @tr("Your server. Your community."); color: Theme.text-disabled; font-size: Math.max(11px, Theme.font-size * 0.75); horizontal-alignment: center; } } if root.trust-kind != 0 : Rectangle { - background: #000000a0; + background: Theme.overlay; TouchArea { } HorizontalLayout { Rectangle { horizontal-stretch: 1; } diff --git a/src/ui/slint/controls.slint b/src/ui/slint/controls.slint index 5409c95..3b803a3 100644 --- a/src/ui/slint/controls.slint +++ b/src/ui/slint/controls.slint @@ -1,4 +1,4 @@ -import { Theme, ActionButton } from "theme.slint"; +import { Theme, ActionButton, Symbol } from "theme.slint"; export component DeviceSelect inherits Rectangle { in property <[string]> model; @@ -13,10 +13,11 @@ export component DeviceSelect inherits Rectangle { HorizontalLayout { padding-left: 11px; padding-right: 11px; Text { text: root.model[root.current-index]; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.8125); vertical-alignment: center; overflow: elide; horizontal-stretch: 1; } - Text { text: "⌄"; color: Theme.text-muted; width: 16px; vertical-alignment: center; } + Rectangle { width: 16px; Symbol { kind: "chevron-down"; ink: Theme.text-muted; width: 16px; height: 16px; y: (parent.height - self.height) / 2; } } } TouchArea { clicked => { keyboard.focus(); popup.show(); } } keyboard := FocusScope { + focus-on-click: false; key-pressed(event) => { if event.text == " " || event.text == "\n" { popup.show(); return accept; } if event.text == Key.DownArrow || event.text == Key.UpArrow { @@ -66,6 +67,7 @@ export component AudioSlider inherits Rectangle { moved => { if self.pressed { root.update-value(root.minimum + Math.clamp((self.mouse-x - 8px) / (root.width - 16px), 0, 1) * (root.maximum - root.minimum)); } } } keyboard := FocusScope { + focus-on-click: false; key-pressed(event) => { if event.text == Key.LeftArrow || event.text == Key.RightArrow { root.update-value(root.value + (event.text == Key.RightArrow ? 1 : -1)); return accept; } return reject; diff --git a/src/ui/slint/emoji-picker.slint b/src/ui/slint/emoji-picker.slint new file mode 100644 index 0000000..758bd32 --- /dev/null +++ b/src/ui/slint/emoji-picker.slint @@ -0,0 +1,88 @@ +import { Theme, Symbol } from "theme.slint"; + +export struct EmojiItem { glyph: string, image: image, name: string } + +/// Emoji shown by the picker. Rust fills `shown` from the bundled catalog and answers `query` +/// (category index and search text), so searching works in English and Russian. +export global EmojiCatalog { + in-out property <[EmojiItem]> shown; + callback query(int, string); +} + +component CategoryTab inherits Rectangle { + in property glyph; + in property selected; + in property label; + callback clicked(); + height: 32px; + border-radius: 6px; + background: root.selected ? Theme.selected : touch.has-hover ? Theme.bg-hover : transparent; + accessible-role: button; + accessible-label: root.label; + Image { source: root.glyph; width: 20px; height: 20px; x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; } + touch := TouchArea { clicked => { root.clicked(); } } +} + +/// Emoji panel with categories and search. Place it inside a PopupWindow. +export component EmojiPicker inherits Rectangle { + callback picked(string); + in-out property category: 0; + width: 336px; + height: 320px; + background: Theme.bg-elevated; + border-radius: 10px; + border-width: 1px; + border-color: Theme.border; + init => { search-input.focus(); } + VerticalLayout { + padding: 10px; spacing: 8px; + Rectangle { + height: 32px; + background: Theme.bg-interactive; + border-radius: 6px; + border-width: 1px; + border-color: search-input.has-focus ? Theme.accent : Theme.border; + Symbol { kind: "search"; ink: Theme.text-muted; width: 16px; height: 16px; x: 9px; y: (parent.height - self.height) / 2; } + Text { + x: 33px; width: parent.width - 42px; height: parent.height; + visible: search-input.text == ""; + text: @tr("Search emoji"); + color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); + vertical-alignment: center; + } + search-input := TextInput { + x: 33px; y: (parent.height - self.height) / 2; width: parent.width - 42px; + single-line: true; color: Theme.text-primary; + font-size: Math.max(11px, Theme.font-size * 0.8125); + selection-background-color: Theme.selected; selection-foreground-color: Theme.text-primary; + edited => { EmojiCatalog.query(root.category, self.text); } + } + } + HorizontalLayout { + spacing: 4px; + CategoryTab { label: @tr("Smileys"); glyph: @image-url("assets/emoji/1f600.png"); selected: root.category == 0 && search-input.text == ""; clicked => { root.category = 0; search-input.text = ""; EmojiCatalog.query(0, ""); } } + CategoryTab { label: @tr("Gestures"); glyph: @image-url("assets/emoji/1f44d.png"); selected: root.category == 1 && search-input.text == ""; clicked => { root.category = 1; search-input.text = ""; EmojiCatalog.query(1, ""); } } + CategoryTab { label: @tr("Hearts and symbols"); glyph: @image-url("assets/emoji/2764-fe0f.png"); selected: root.category == 2 && search-input.text == ""; clicked => { root.category = 2; search-input.text = ""; EmojiCatalog.query(2, ""); } } + CategoryTab { label: @tr("Animals and food"); glyph: @image-url("assets/emoji/1f436.png"); selected: root.category == 3 && search-input.text == ""; clicked => { root.category = 3; search-input.text = ""; EmojiCatalog.query(3, ""); } } + CategoryTab { label: @tr("Objects and activities"); glyph: @image-url("assets/emoji/1f3ae.png"); selected: root.category == 4 && search-input.text == ""; clicked => { root.category = 4; search-input.text = ""; EmojiCatalog.query(4, ""); } } + } + Flickable { + content-width: self.width; + content-height: Math.max(self.height, Math.ceil(EmojiCatalog.shown.length / 8) * 37px); + for item[index] in EmojiCatalog.shown: Rectangle { + x: Math.mod(index, 8) * 37px; y: Math.floor(index / 8) * 37px; + width: 36px; height: 36px; border-radius: 6px; + background: cell.has-hover ? Theme.bg-hover : transparent; + accessible-role: button; + accessible-label: item.name; + Image { source: item.image; width: 26px; height: 26px; x: 5px; y: 5px; } + cell := TouchArea { clicked => { root.picked(item.glyph); } } + } + if EmojiCatalog.shown.length == 0 : Text { + text: @tr("Nothing found"); + color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); + horizontal-alignment: center; width: parent.width; y: 20px; + } + } + } +} diff --git a/src/ui/slint/friends.slint b/src/ui/slint/friends.slint index 4542c1d..719c549 100644 --- a/src/ui/slint/friends.slint +++ b/src/ui/slint/friends.slint @@ -1,6 +1,8 @@ -import { Theme, ActionButton } from "theme.slint"; +import { Theme, ActionButton, Symbol } from "theme.slint"; +import { ThemeInput } from "controls.slint"; +import { AvatarView, PresenceDot } from "avatar-view.slint"; -export struct FriendItem { user_id: string, nickname: string, status: string, status_label: string } +export struct FriendItem { user_id: string, nickname: string, status: string, status_label: string, avatar_text: string } export component FriendsPanel inherits Rectangle { in-out property <[FriendItem]> friends; @@ -22,11 +24,12 @@ export component FriendsPanel inherits Rectangle { height: 56px; border-width: 1px; border-color: Theme.border; HorizontalLayout { padding-left: 22px; padding-right: 16px; spacing: 10px; - Text { text: @tr("Friends"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; } - ActionButton { text: @tr("Online"); active: root.active-tab == "online"; quiet: true; clicked => { root.tab-changed("online"); } } - ActionButton { text: @tr("All"); active: root.active-tab == "all"; quiet: true; clicked => { root.tab-changed("all"); } } - ActionButton { text: @tr("Requests"); active: root.active-tab == "pending"; quiet: true; clicked => { root.tab-changed("pending"); } } - ActionButton { text: @tr("Blocked"); active: root.active-tab == "blocked"; quiet: true; clicked => { root.tab-changed("blocked"); } } + Symbol { kind: "users"; ink: Theme.text-muted; width: 20px; height: 20px; y: (parent.height - self.height) / 2; } + Text { text: @tr("Friends"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; vertical-alignment: center; } + VerticalLayout { alignment: center; ActionButton { text: @tr("Online"); active: root.active-tab == "online"; quiet: true; clicked => { root.tab-changed("online"); } } } + VerticalLayout { alignment: center; ActionButton { text: @tr("All"); active: root.active-tab == "all"; quiet: true; clicked => { root.tab-changed("all"); } } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Requests"); active: root.active-tab == "pending"; quiet: true; clicked => { root.tab-changed("pending"); } } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Blocked"); active: root.active-tab == "blocked"; quiet: true; clicked => { root.tab-changed("blocked"); } } } Rectangle { horizontal-stretch: 1; } } } @@ -34,13 +37,7 @@ export component FriendsPanel inherits Rectangle { padding: 22px; spacing: 16px; HorizontalLayout { spacing: 9px; - Rectangle { - height: 38px; background: Theme.bg-interactive; border-radius: 7px; - HorizontalLayout { - padding: 10px; - TextInput { text <=> root.add-friend-input; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); single-line: true; edited => { root.input-edited(self.text); } accepted => { root.add-friend(root.add-friend-input); } } - } - } + 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); } } } 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); } @@ -55,14 +52,18 @@ export component FriendsPanel inherits Rectangle { row-touch := TouchArea { } HorizontalLayout { padding: 10px; spacing: 12px; - Rectangle { width: 32px; height: 32px; background: Theme.avatar-bg; border-radius: 12px; Text { text: "@"; color: Theme.accent; horizontal-alignment: center; vertical-alignment: center; } } + Rectangle { + width: 36px; + AvatarView { width: 36px; height: 36px; y: (parent.height - self.height) / 2; initials: friend.avatar_text; mask: row-touch.has-hover ? Theme.bg-elevated : Theme.bg-base; } + PresenceDot { x: 25px; y: parent.height / 2 + 6px; presence: friend.status == "offline" ? "" : friend.status; ring: row-touch.has-hover ? Theme.bg-elevated : Theme.bg-base; } + } VerticalLayout { - spacing: 2px; horizontal-stretch: 1; + spacing: 2px; horizontal-stretch: 1; alignment: center; Text { text: friend.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); } Text { text: friend.status_label; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.6875); } } - ActionButton { text: @tr("Message"); quiet: true; clicked => { root.start-dm(friend.user_id); } } - ActionButton { text: @tr("Delete"); quiet: true; danger: true; clicked => { root.remove-friend(friend.user_id); } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Message"); quiet: true; clicked => { root.start-dm(friend.user_id); } } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Delete"); quiet: true; danger: true; clicked => { root.remove-friend(friend.user_id); } } } } } for friend in root.pending-requests: Rectangle { @@ -70,9 +71,9 @@ export component FriendsPanel inherits Rectangle { height: 58px; HorizontalLayout { padding: 10px; spacing: 10px; - Text { text: friend.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-stretch: 1; } - ActionButton { text: @tr("Accept"); clicked => { root.accept-friend(friend.user_id); } } - ActionButton { text: @tr("Decline"); danger: true; quiet: true; clicked => { root.decline-friend(friend.user_id); } } + Text { text: friend.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-stretch: 1; vertical-alignment: center; } + VerticalLayout { alignment: center; ActionButton { text: @tr("Accept"); clicked => { root.accept-friend(friend.user_id); } } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Decline"); danger: true; quiet: true; clicked => { root.decline-friend(friend.user_id); } } } } } for user in root.blocked-users: Rectangle { diff --git a/src/ui/slint/main.slint b/src/ui/slint/main.slint index 82c3b10..0dfd2e5 100644 --- a/src/ui/slint/main.slint +++ b/src/ui/slint/main.slint @@ -2,6 +2,7 @@ export { WebhookWindow, WebhookRow } from "webhooks.slint"; export { ScreenShareWindow, ScreenViewerWindow } from "screen-share.slint"; export { UnlockWindow } from "unlock.slint"; export { Theme } from "theme.slint"; +export { EmojiCatalog, EmojiItem } from "emoji-picker.slint"; import { Theme, ActionButton } from "theme.slint"; import { Sidebar, ChannelItem, GuildItem, DmItem } from "sidebar.slint"; import { ChatPanel, MessageItem, MemberItem } from "chat.slint"; @@ -17,6 +18,7 @@ export component MainWindow inherits Window { in-out property <[DmItem]> dm-conversations; in-out property username; in-out property user-status; + in-out property own-initials; in-out property active-channel-id; in-out property active-guild-idx; in-out property show-dms; @@ -227,6 +229,7 @@ export component MainWindow inherits Window { show-friends => { root.show-friends-view(); } own-avatar: root.own-avatar; has-avatar: root.has-avatar; + own-initials: root.own-initials; username: root.username; user-status: root.user-status; active-channel-id: root.active-channel-id; @@ -244,7 +247,7 @@ export component MainWindow inherits Window { HorizontalLayout { padding-left: 16px; padding-right: 10px; spacing: 12px; Text { text: root.status-text; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.75); wrap: word-wrap; vertical-alignment: center; horizontal-stretch: 1; } - ActionButton { text: "×"; width: 28px; quiet: true; clicked => { root.dismiss-status(); } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Dismiss"); icon: "x"; width: 28px; quiet: true; clicked => { root.dismiss-status(); } } } } } if root.show-chat : ChatPanel { @@ -295,6 +298,8 @@ export component MainWindow inherits Window { channel-name: root.voice-channel-name; activity-banner: root.activity-banner; joining: root.voice-joining; + own-avatar: root.own-avatar; + has-own-avatar: root.has-avatar; push-to-talk: root.vad-mode == 0; ptt-held(held) => { root.ptt-held(held); } toggle-mic => { root.toggle-mic(); } diff --git a/src/ui/slint/settings.slint b/src/ui/slint/settings.slint index 0ef205d..07ae296 100644 --- a/src/ui/slint/settings.slint +++ b/src/ui/slint/settings.slint @@ -19,7 +19,7 @@ component SettingsNav inherits Rectangle { accessible-label: root.label; HorizontalLayout { padding-left: 12px; padding-right: 12px; spacing: 11px; - Text { text: root.mark; color: root.active ? Theme.text-primary : Theme.text-muted; font-size: Theme.font-size + 2px; width: 23px; vertical-alignment: center; } + Rectangle { width: 23px; Symbol { kind: root.mark; ink: root.active ? Theme.text-primary : Theme.text-muted; width: 20px; height: 20px; y: (parent.height - self.height) / 2; } } VerticalLayout { spacing: 2px; alignment: center; Text { text: root.label; color: Theme.text-primary; font-size: Math.max(Theme.font-size - 2px, 11px); font-weight: root.active ? 600 : 400; overflow: elide; } @@ -27,7 +27,7 @@ component SettingsNav inherits Rectangle { } } touch := TouchArea { clicked => { keyboard.focus(); root.clicked(); } } - keyboard := FocusScope { key-pressed(event) => { if event.text == " " || event.text == "\n" { root.clicked(); return accept; } return reject; } } + keyboard := FocusScope { focus-on-click: false; key-pressed(event) => { if event.text == " " || event.text == "\n" { root.clicked(); return accept; } return reject; } } } export component SettingsWindow inherits Rectangle { @@ -99,9 +99,9 @@ export component SettingsWindow inherits Rectangle { 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; } - SettingsNav { label: @tr("Audio & microphone"); detail: @tr("Devices and voice input"); mark: "◖"; active: root.active-tab == "audio"; clicked => { root.active-tab = "audio"; } } - SettingsNav { label: @tr("Appearance"); detail: @tr("Themes, colours and text"); mark: "Aa"; active: root.active-tab == "appearance"; clicked => { root.active-tab = "appearance"; } } - SettingsNav { label: @tr("Profile and keys"); detail: @tr("Security and backup"); mark: "◇"; active: root.active-tab == "identity"; clicked => { root.active-tab = "identity"; } } + 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"; } } Rectangle { vertical-stretch: 1; } Rectangle { height: 1px; background: Theme.border; } Text { text: "VNOX"; color: Theme.text-secondary; font-size: Math.max(Theme.font-size - 3px, 11px); font-weight: 700; height: 30px; vertical-alignment: bottom; } @@ -122,7 +122,7 @@ export component SettingsWindow inherits Rectangle { Text { text: root.active-tab == "appearance" ? @tr("Make Vnox yours.") : root.active-tab == "identity" ? @tr("Your profile, kept safe.") : @tr("Make yourself heard, your way."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); } } Rectangle { horizontal-stretch: 1; } - ActionButton { text: "×"; width: 34px; text-size: 21px; quiet: true; clicked => { root.close(); } } + VerticalLayout { alignment: start; ActionButton { text: @tr("Close settings"); icon: "x"; width: 34px; height: 34px; quiet: true; clicked => { root.close(); } } } } } Rectangle { height: 1px; background: Theme.border; } diff --git a/src/ui/slint/settings/appearance.slint b/src/ui/slint/settings/appearance.slint index d897277..319cc2a 100644 --- a/src/ui/slint/settings/appearance.slint +++ b/src/ui/slint/settings/appearance.slint @@ -1,4 +1,4 @@ -import { Theme, ActionButton } from "../theme.slint"; +import { Theme, ActionButton, Symbol } from "../theme.slint"; import { AudioSlider, ThemeInput, ThemeEditor } from "../controls.slint"; component ThemeChoice inherits Rectangle { @@ -44,7 +44,7 @@ component ThemeChoice inherits Rectangle { Rectangle { x: 14px; y: 5px; width: Math.max(parent.width - 21px, 3px); height: 3px; border-radius: 1px; background: root.preview-ink.with-alpha(0.65); } } Text { x: 7px; y: 42px; text: "#"; color: root.preview-ink.with-alpha(0.4); font-size: 8px; } - Text { x: 7px; y: 59px; text: "♪"; color: root.preview-ink.with-alpha(0.4); font-size: 8px; } + Rectangle { x: 7px; y: 60px; width: 7px; height: 7px; border-radius: 3px; background: root.preview-ink.with-alpha(0.4); } Rectangle { x: 7px; y: 80px; width: 4px; height: 4px; border-radius: 2px; background: root.preview-accent; } Rectangle { x: 15px; y: 81px; width: Math.max(parent.width - 24px, 3px); height: 2px; background: root.preview-ink.with-alpha(0.3); } } @@ -67,11 +67,11 @@ component ThemeChoice inherits Rectangle { } HorizontalLayout { Text { text: root.label; color: Theme.text-primary; font-size: Math.max(Theme.font-size - 3px, 11px); font-weight: 500; overflow: elide; horizontal-stretch: 1; } - Text { text: root.selected ? "✓" : ""; color: Theme.accent; width: 16px; font-size: Math.max(Theme.font-size - 2px, 11px); } + Rectangle { width: 16px; Symbol { visible: root.selected; kind: "check"; ink: Theme.accent; width: 16px; height: 16px; y: (parent.height - self.height) / 2; } } } } pointer := TouchArea { clicked => { keyboard.focus(); root.clicked(); } } - keyboard := FocusScope { key-pressed(event) => { if event.text == " " || event.text == "\n" { root.clicked(); return accept; } return reject; } } + keyboard := FocusScope { focus-on-click: false; key-pressed(event) => { if event.text == " " || event.text == "\n" { root.clicked(); return accept; } return reject; } } } export component AppearanceSettings inherits Rectangle { diff --git a/src/ui/slint/settings/identity.slint b/src/ui/slint/settings/identity.slint index 2585449..00f7431 100644 --- a/src/ui/slint/settings/identity.slint +++ b/src/ui/slint/settings/identity.slint @@ -60,7 +60,7 @@ export component IdentitySettings inherits Rectangle { Rectangle { height: 24px; } HorizontalLayout { Text { text: @tr("Device security"); color: Theme.text-primary; font-size: Theme.font-size + 2px; font-weight: 600; horizontal-stretch: 1; } - Text { text: root.vault-enabled ? @tr("● Passphrase protected") : @tr("No passphrase"); color: root.vault-enabled ? Theme.success : Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); vertical-alignment: center; } + Text { text: root.vault-enabled ? @tr("Passphrase protected") : @tr("No passphrase"); color: root.vault-enabled ? Theme.success : Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); vertical-alignment: center; } } Rectangle { height: 6px; } Text { text: root.vault-enabled ? @tr("Vnox will ask for your passphrase to unlock your keys on startup.") : @tr("Add a passphrase to encrypt your saved secret key."); color: Theme.text-muted; font-size: Math.max(Theme.font-size - 3px, 11px); wrap: word-wrap; } diff --git a/src/ui/slint/sidebar.slint b/src/ui/slint/sidebar.slint index 9bc672c..c9105d6 100644 --- a/src/ui/slint/sidebar.slint +++ b/src/ui/slint/sidebar.slint @@ -1,5 +1,5 @@ -import { AvatarView } from "avatar-view.slint"; -import { Theme, ActionButton } from "theme.slint"; +import { AvatarView, PresenceDot } from "avatar-view.slint"; +import { Theme, ActionButton, Symbol } from "theme.slint"; export struct ChannelItem { channel_id: string, name: string, kind: string } export struct GuildItem { guild_id: string, name: string, short_name: string, selected: bool } @@ -7,7 +7,7 @@ export struct DmItem { dm_id: string, name: string, unread: int } component NavRow inherits Rectangle { in property label; - in property symbol: "#"; + in property symbol: "hash"; in property selected; in property unread; callback clicked(); @@ -20,12 +20,13 @@ component NavRow inherits Rectangle { accessible-label: label; HorizontalLayout { padding-left: 10px; padding-right: 10px; spacing: 10px; - Text { text: root.symbol; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 1.125); width: 20px; } - Text { text: root.label; color: root.selected || root.unread > 0 ? Theme.text-primary : Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-stretch: 1; overflow: elide; } - if root.unread > 0 : Text { text: root.unread; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.75); } + Symbol { kind: root.symbol; ink: root.selected ? Theme.text-primary : Theme.text-muted; width: 17px; height: 17px; y: (parent.height - self.height) / 2; } + Text { text: root.label; color: root.selected || root.unread > 0 ? Theme.text-primary : Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-stretch: 1; overflow: elide; vertical-alignment: center; } + if root.unread > 0 : Text { text: root.unread; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 0.75); vertical-alignment: center; font-weight: 600; } } touch := TouchArea { clicked => { keyboard.focus(); root.clicked(); } } keyboard := FocusScope { + focus-on-click: false; key-pressed(event) => { if event.text == " " || event.text == "\n" { root.clicked(); return accept; } return reject; @@ -41,6 +42,7 @@ export component Sidebar inherits Rectangle { in property has-avatar; in-out property username; in-out property user-status; + in property own-initials; in-out property active-channel-id; in-out property active-dm-id; in-out property active-guild-idx; @@ -69,7 +71,7 @@ export component Sidebar inherits Rectangle { background: Theme.bg-rail; VerticalLayout { padding: 9px; spacing: 11px; - ActionButton { text: @tr("Direct messages"); icon: "home"; height: 44px; text-size: 20px; active: root.show-dms; clicked => { root.show-friends(); } } + ActionButton { text: @tr("Direct messages"); icon: "house"; height: 44px; active: root.show-dms; clicked => { root.show-friends(); } } Rectangle { height: 1px; background: Theme.border; } ActionButton { text: "V"; height: 44px; text-size: 19px; active: !root.show-dms && root.active-guild-idx < 0; clicked => { root.guild-selected(-1); } } for guild[index] in root.guilds: ActionButton { @@ -79,7 +81,7 @@ export component Sidebar inherits Rectangle { clicked => { root.guild-selected(index); } } Rectangle { vertical-stretch: 1; } - ActionButton { text: @tr("Settings"); icon: "settings"; quiet: true; text-size: 19px; clicked => { root.open-settings(); } } + ActionButton { text: @tr("Settings"); icon: "settings"; quiet: true; clicked => { root.open-settings(); } } } } Rectangle { @@ -92,19 +94,19 @@ export component Sidebar inherits Rectangle { HorizontalLayout { padding-left: 17px; padding-right: 10px; spacing: 8px; Text { text: root.show-dms ? @tr("Direct messages") : root.active-guild-idx >= 0 && root.active-guild-idx < root.guilds.length ? root.guilds[root.active-guild-idx].name : root.node-name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; overflow: elide; horizontal-stretch: 1; vertical-alignment: center; } - ActionButton { text: @tr("Disconnect"); icon: "power"; width: 30px; quiet: true; clicked => { root.disconnect(); } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Disconnect from server"); icon: "log-out"; width: 32px; quiet: true; clicked => { root.disconnect(); } } } } } Flickable { content-width: self.width; VerticalLayout { padding: 10px; spacing: 3px; - if root.show-dms : NavRow { label: @tr("Friends"); symbol: "@"; clicked => { root.show-friends(); } } + 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 && root.dm-conversations.length == 0 : Text { text: @tr("Open a friend's profile to send a message."); wrap: word-wrap; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); } for dm in root.dm-conversations: NavRow { visible: root.show-dms; - label: dm.name; symbol: "@"; unread: dm.unread; + label: dm.name; symbol: "at-sign"; unread: dm.unread; selected: root.active-dm-id == dm.dm_id; clicked => { root.dm-selected(dm.dm_id); } } @@ -118,7 +120,7 @@ export component Sidebar inherits Rectangle { if !root.show-dms : Text { text: @tr("Voice rooms"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); height: 40px; vertical-alignment: bottom; } for ch in root.channels: NavRow { visible: !root.show-dms && ch.kind == "voice"; - label: ch.name; symbol: "◖"; + label: ch.name; symbol: "volume-2"; selected: root.voice-connected && root.voice-channel-name == ch.name; clicked => { root.channel-selected(ch.channel_id); } } @@ -132,7 +134,11 @@ export component Sidebar inherits Rectangle { border-width: 1px; border-color: Theme.border; VerticalLayout { padding: 10px; spacing: 5px; - Text { text: @tr("● Voice connected"); color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; } + HorizontalLayout { + spacing: 7px; + Rectangle { width: 8px; VerticalLayout { alignment: center; Rectangle { height: 8px; border-radius: 4px; background: Theme.success; } } } + Text { text: @tr("Voice connected"); color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; vertical-alignment: center; } + } Text { text: root.voice-channel-name; color: Theme.text-secondary; font-size: Math.max(11px, Theme.font-size * 0.6875); overflow: elide; } HorizontalLayout { spacing: 6px; @@ -146,15 +152,19 @@ export component Sidebar inherits Rectangle { background: Theme.bg-elevated; HorizontalLayout { padding: 9px; spacing: 5px; - AvatarView { width: 30px; height: 30px; source: root.own-avatar; has-source: root.has-avatar; initials: "●"; mask: Theme.bg-elevated; } - VerticalLayout { - spacing: 1px; horizontal-stretch: 1; - Text { text: root.username; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; overflow: elide; } - Text { text: root.user-status; color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.625); overflow: elide; } + Rectangle { + width: 34px; + AvatarView { width: 32px; height: 32px; y: (parent.height - self.height) / 2; source: root.own-avatar; has-source: root.has-avatar; initials: root.own-initials; mask: Theme.bg-elevated; } + PresenceDot { x: 21px; y: parent.height / 2 + 6px; presence: "online"; ring: Theme.bg-elevated; } } - ActionButton { text: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); icon: "mic"; width: 30px; danger: !root.mic-enabled; quiet: true; clicked => { root.toggle-mic(); } } - ActionButton { text: root.deafened ? @tr("Undeafen") : @tr("Deafen"); icon: "headphones"; width: 30px; danger: root.deafened; quiet: true; clicked => { root.toggle-deafen(); } } - ActionButton { text: @tr("Settings"); icon: "settings"; width: 30px; quiet: true; clicked => { root.open-settings(); } } + VerticalLayout { + spacing: 1px; horizontal-stretch: 1; alignment: center; + Text { text: root.username; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.8125); font-weight: 600; overflow: elide; } + Text { text: root.user-status; color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.6875); overflow: elide; } + } + VerticalLayout { alignment: center; ActionButton { text: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); icon: root.mic-enabled ? "mic" : "mic-off"; width: 30px; danger: !root.mic-enabled; quiet: true; clicked => { root.toggle-mic(); } } } + VerticalLayout { alignment: center; ActionButton { text: root.deafened ? @tr("Undeafen") : @tr("Deafen"); icon: root.deafened ? "headphone-off" : "headphones"; width: 30px; danger: root.deafened; quiet: true; clicked => { root.toggle-deafen(); } } } + VerticalLayout { alignment: center; ActionButton { text: @tr("Settings"); icon: "settings"; width: 30px; quiet: true; clicked => { root.open-settings(); } } } } } } diff --git a/src/ui/slint/theme.slint b/src/ui/slint/theme.slint index fa55308..575b47d 100644 --- a/src/ui/slint/theme.slint +++ b/src/ui/slint/theme.slint @@ -23,14 +23,71 @@ export global Theme { in-out property radius: 7px; } -export component Symbol inherits Rectangle { +/// Lucide icon (ISC license, see assets/icons/LICENSE) tinted with the theme ink colour. +export component Symbol inherits Image { in property kind; in property ink: Theme.text-secondary; - if kind == "mic" : Path { width: parent.width; height: parent.height; viewbox-width: 24; viewbox-height: 24; fill: transparent; stroke: root.ink; stroke-width: 1.7px; commands: "M9 11V5 A3 3 0 0 1 15 5 V11 A3 3 0 0 1 9 11 M5 10V12 A7 7 0 0 0 19 12 V10 M12 19V22 M8 22H16"; } - if kind == "headphones" : Path { width: parent.width; height: parent.height; viewbox-width: 24; viewbox-height: 24; fill: transparent; stroke: root.ink; stroke-width: 1.7px; commands: "M3 14V11 A9 9 0 0 1 21 11 V14 M3 13H7V21H3Z M17 13H21V21H17Z"; } - if kind == "settings" : Path { width: parent.width; height: parent.height; viewbox-width: 24; viewbox-height: 24; fill: transparent; stroke: root.ink; stroke-width: 1.7px; commands: "M9 3L8 6L5 7L3 10L5 12L4 15L7 17L10 16L12 18L15 16V13L17 11L16 8L13 7L12 3Z M14 11 A3 3 0 1 1 8 11 A3 3 0 1 1 14 11"; } - if kind == "power" : Path { width: parent.width; height: parent.height; viewbox-width: 24; viewbox-height: 24; fill: transparent; stroke: root.ink; stroke-width: 1.7px; commands: "M12 2V12 M6 5 A9 9 0 1 0 18 5"; } - if kind == "home" : Path { width: parent.width; height: parent.height; viewbox-width: 24; viewbox-height: 24; fill: transparent; stroke: root.ink; stroke-width: 1.7px; commands: "M2 10L12 2L22 10V22H2Z M9 22V13H15V22"; } + colorize: root.ink; + image-fit: contain; + source: kind == "mic" ? @image-url("assets/icons/mic.svg") : + kind == "mic-off" ? @image-url("assets/icons/mic-off.svg") : + kind == "headphones" ? @image-url("assets/icons/headphones.svg") : + kind == "headphone-off" ? @image-url("assets/icons/headphone-off.svg") : + kind == "settings" ? @image-url("assets/icons/settings.svg") : + kind == "log-out" ? @image-url("assets/icons/log-out.svg") : + kind == "pin" ? @image-url("assets/icons/pin.svg") : + kind == "reply" ? @image-url("assets/icons/reply.svg") : + kind == "pencil" ? @image-url("assets/icons/pencil.svg") : + kind == "trash-2" ? @image-url("assets/icons/trash-2.svg") : + kind == "smile" ? @image-url("assets/icons/smile.svg") : + kind == "smile-plus" ? @image-url("assets/icons/smile-plus.svg") : + kind == "plus" ? @image-url("assets/icons/plus.svg") : + kind == "search" ? @image-url("assets/icons/search.svg") : + kind == "hash" ? @image-url("assets/icons/hash.svg") : + kind == "volume-2" ? @image-url("assets/icons/volume-2.svg") : + kind == "phone-off" ? @image-url("assets/icons/phone-off.svg") : + kind == "users" ? @image-url("assets/icons/users.svg") : + kind == "house" ? @image-url("assets/icons/house.svg") : + kind == "webhook" ? @image-url("assets/icons/webhook.svg") : + kind == "monitor" ? @image-url("assets/icons/monitor.svg") : + kind == "screen-share" ? @image-url("assets/icons/screen-share.svg") : + kind == "x" ? @image-url("assets/icons/x.svg") : + kind == "check" ? @image-url("assets/icons/check.svg") : + kind == "chevron-down" ? @image-url("assets/icons/chevron-down.svg") : + kind == "at-sign" ? @image-url("assets/icons/at-sign.svg") : + kind == "user" ? @image-url("assets/icons/user.svg") : + kind == "send" ? @image-url("assets/icons/send.svg") : + kind == "user-plus" ? @image-url("assets/icons/user-plus.svg") : + kind == "ban" ? @image-url("assets/icons/ban.svg") : + kind == "circle" ? @image-url("assets/icons/circle.svg") : + kind == "corner-down-right" ? @image-url("assets/icons/corner-down-right.svg") : + kind == "audio-lines" ? @image-url("assets/icons/audio-lines.svg") : + kind == "palette" ? @image-url("assets/icons/palette.svg") : + kind == "key-round" ? @image-url("assets/icons/key-round.svg") : + kind == "minus" ? @image-url("assets/icons/minus.svg") : + kind == "shield-check" ? @image-url("assets/icons/shield-check.svg") : + kind == "image" ? @image-url("assets/icons/image.svg") : + kind == "bell" ? @image-url("assets/icons/bell.svg") : + @image-url("assets/icons/circle.svg"); +} + +/// Tooltip bubble content. Used inside Slint's built-in `Tooltip`, which shows it after a short +/// hover delay near the pointer and, unlike a PopupWindow, never swallows clicks. +export component TipBubble inherits Rectangle { + in property text; + background: Theme.bg-elevated; + border-radius: 6px; + border-width: 1px; + border-color: Theme.text-disabled.with-alpha(0.45); + HorizontalLayout { + padding-left: 10px; padding-right: 10px; padding-top: 5px; padding-bottom: 5px; + Text { + text: root.text; + color: Theme.text-primary; + font-size: Math.max(11px, Theme.font-size * 0.75); + vertical-alignment: center; + } + } } export component ActionButton inherits Rectangle { @@ -39,32 +96,44 @@ export component ActionButton inherits Rectangle { in property active: false; in property danger: false; in property quiet: false; + // Filled with the accent colour for the main action of a view. + in property primary: false; + // Shows the icon together with the text instead of using the text as a tooltip only. + in property labeled: false; in property text-size: 13px; + // Bubble text. Icon-only buttons show their label here by default. + in property tooltip: icon != "" && !labeled ? text : ""; callback clicked(); min-width: 30px; - preferred-width: icon == "" ? label.preferred-width + 22px : 32px; + horizontal-stretch: 0; + preferred-width: icon == "" ? label.preferred-width + 22px : labeled ? label.preferred-width + 48px : 32px; height: 32px; border-radius: 6px; - background: active ? Theme.selected : touch.has-hover ? Theme.bg-hover : quiet ? transparent : Theme.bg-interactive; + 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 ? 1px : 0px; border-color: Theme.accent; accessible-role: button; accessible-label: text; - Symbol { visible: root.icon != ""; kind: root.icon; ink: root.danger ? Theme.danger : Theme.text-secondary; width: 18px; height: 18px; x: (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: 18px; height: 18px; x: root.labeled ? 12px : (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; } label := Text { - visible: root.icon == ""; + visible: root.icon == "" || root.labeled; + x: root.labeled ? 36px : 0px; + width: root.labeled ? parent.width - 46px : parent.width; + height: parent.height; text: root.text; - color: root.danger ? Theme.danger : root.active ? Theme.text-primary : Theme.text-secondary; + color: root.primary ? Theme.on-accent : root.danger ? Theme.danger : root.active ? Theme.text-primary : Theme.text-secondary; font-size: Math.max(11px, root.text-size * Theme.scale); - horizontal-alignment: center; + horizontal-alignment: root.labeled ? left : center; vertical-alignment: center; overflow: elide; } touch := TouchArea { clicked => { keyboard.focus(); root.clicked(); } } keyboard := FocusScope { + focus-on-click: false; key-pressed(event) => { if event.text == " " || event.text == "\n" { root.clicked(); return accept; } return reject; } } + if root.tooltip != "" : Tooltip { TipBubble { text: root.tooltip; } } } diff --git a/src/ui/slint/unlock.slint b/src/ui/slint/unlock.slint index 54bacc8..1a7d689 100644 --- a/src/ui/slint/unlock.slint +++ b/src/ui/slint/unlock.slint @@ -2,7 +2,7 @@ import { Theme, ActionButton } from "theme.slint"; import { ThemeInput } from "controls.slint"; export component UnlockWindow inherits Window { - title: @tr("Vnox — unlock"); + title: @tr("Vnox: unlock"); icon: @image-url("assets/vnox-mark.svg"); preferred-width: 480px; preferred-height: 300px; diff --git a/src/ui/slint/voice.slint b/src/ui/slint/voice.slint index e830adf..60351e3 100644 --- a/src/ui/slint/voice.slint +++ b/src/ui/slint/voice.slint @@ -1,6 +1,64 @@ -import { Theme, ActionButton } from "theme.slint"; +import { AvatarView } from "avatar-view.slint"; +import { Theme, ActionButton, Symbol, TipBubble } from "theme.slint"; -export struct VoiceMemberItem { user_id: string, nickname: string, speaking: bool, avatar_text: string } +export struct VoiceMemberItem { user_id: string, nickname: string, speaking: bool, avatar_text: string, is_own: bool } + +/// Round control of the voice room bar. `off` shows the muted state highlighted in red. +component RoundControl inherits Rectangle { + in property icon; + in property tooltip; + in property off: false; + in property leave: false; + callback clicked(); + width: 52px; height: 52px; + border-radius: 26px; + background: root.leave ? (touch.has-hover ? Theme.danger.darker(10%) : Theme.danger) + : root.off ? Theme.danger.with-alpha(touch.has-hover ? 0.32 : 0.22) + : touch.has-hover ? Theme.bg-hover : Theme.bg-interactive; + border-width: keyboard.has-focus ? 2px : 1px; + border-color: keyboard.has-focus ? Theme.accent : root.off ? Theme.danger.with-alpha(0.5) : Theme.border; + accessible-role: button; + accessible-label: root.tooltip; + Symbol { + kind: root.icon; + ink: root.leave ? Theme.on-accent : root.off ? Theme.danger : Theme.text-primary; + width: 22px; height: 22px; + x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; + } + touch := TouchArea { clicked => { keyboard.focus(); root.clicked(); } } + keyboard := FocusScope { + focus-on-click: false; + key-pressed(event) => { + if event.text == " " || event.text == "\n" { root.clicked(); return accept; } + return reject; + } + } + if root.tooltip != "" : Tooltip { TipBubble { text: root.tooltip; } } +} + +component ParticipantCard inherits Rectangle { + in property member; + in property own-avatar; + in property has-own-avatar; + border-radius: 16px; + background: Theme.bg-elevated; + border-width: root.member.speaking ? 2px : 1px; + border-color: root.member.speaking ? Theme.success : Theme.border; + VerticalLayout { + padding: 18px; spacing: 10px; alignment: center; + HorizontalLayout { + alignment: center; + AvatarView { + width: 80px; height: 80px; + source: root.own-avatar; has-source: root.has-own-avatar && root.member.is_own; + 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.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; } + } +} export component VoicePanel inherits Rectangle { in-out property <[VoiceMemberItem]> members; @@ -10,77 +68,71 @@ export component VoicePanel inherits Rectangle { in-out property activity-banner; in property joining; in-out property push-to-talk; + in property own-avatar; + in property has-own-avatar; + private property gap: 14px; + private property columns: Math.max(1, Math.floor((grid.width + root.gap) / (210px + root.gap))); + private property card-width: (grid.width - (root.columns - 1) * root.gap) / root.columns; callback preview-screen(); callback ptt-held(bool); callback toggle-mic(); callback toggle-deafen(); callback leave-voice(); - background: Theme.bg-base; + background: @linear-gradient(180deg, Theme.bg-base 0%, Theme.bg-surface 100%); VerticalLayout { spacing: 0; Rectangle { height: 56px; border-width: 1px; border-color: Theme.border; HorizontalLayout { - padding-left: 22px; spacing: 12px; - Text { text: "◖"; color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 1.4375); width: 20px; vertical-alignment: center; } + padding-left: 22px; padding-right: 16px; spacing: 10px; + Symbol { kind: "volume-2"; ink: Theme.text-muted; width: 20px; height: 20px; y: (parent.height - self.height) / 2; } Text { text: root.channel-name; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0); font-weight: 600; vertical-alignment: center; } + Text { text: @tr("{n} participant" | "{n} participants" % root.members.length); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); vertical-alignment: center; } Rectangle { horizontal-stretch: 1; } - ActionButton { text: @tr("Screen preview"); clicked => { root.preview-screen(); } } } } VerticalLayout { padding: 24px; spacing: 16px; - Text { text: @tr("{n} participant" | "{n} participants" % root.members.length); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.8125); } - Flickable { + grid := Flickable { content-width: self.width; - VerticalLayout { - spacing: 12px; - for member in root.members: Rectangle { - height: 120px; border-radius: 12px; - background: Theme.bg-interactive; - border-width: member.speaking ? 2px : 1px; - border-color: member.speaking ? Theme.success : Theme.border; - HorizontalLayout { - padding: 24px; spacing: 18px; - Rectangle { - width: 58px; height: 58px; border-radius: 20px; background: Theme.avatar-bg; - Text { text: member.avatar_text; color: Theme.accent; font-size: Math.max(11px, Theme.font-size * 1.625); horizontal-alignment: center; vertical-alignment: center; } - } - VerticalLayout { - spacing: 5px; - Text { text: member.nickname; color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 1.0625); } - Text { text: member.speaking ? @tr("Speaking") : @tr("In voice"); color: member.speaking ? Theme.success : Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.75); } - } - Rectangle { horizontal-stretch: 1; } - } - } - if root.joining : Text { text: @tr("Joining voice…"); color: Theme.text-muted; font-size: Math.max(11px, Theme.font-size * 0.875); } - Rectangle { vertical-stretch: 1; } + content-height: Math.max(self.height, Math.ceil(root.members.length / root.columns) * (170px + root.gap)); + 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; + 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.push-to-talk : Rectangle { height: 46px; background: ptt-area.pressed ? Theme.voice-bg : Theme.bg-interactive; - border-radius: 8px; border-width: ptt-focus.has-focus ? 1px : 0px; border-color: Theme.accent; + border-radius: 10px; border-width: ptt-focus.has-focus ? 1px : 0px; border-color: Theme.accent; accessible-role: button; accessible-label: @tr("Push to talk"); - Text { text: ptt-area.pressed ? @tr("Microphone is transmitting") : @tr("Hold here to talk"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); horizontal-alignment: center; vertical-alignment: center; } + HorizontalLayout { + alignment: center; spacing: 10px; + Symbol { kind: "mic"; ink: ptt-area.pressed ? Theme.success : Theme.text-secondary; width: 18px; height: 18px; y: (parent.height - self.height) / 2; } + Text { text: ptt-area.pressed ? @tr("Microphone is transmitting") : @tr("Hold here to talk"); color: Theme.text-primary; font-size: Math.max(11px, Theme.font-size * 0.875); vertical-alignment: center; } + } ptt-area := TouchArea { clicked => { ptt-focus.focus(); } changed pressed => { root.ptt-held(self.pressed); } } ptt-focus := FocusScope { + focus-on-click: false; key-pressed(event) => { if event.text == " " { root.ptt-held(true); return accept; } return reject; } key-released(event) => { if event.text == " " { root.ptt-held(false); return accept; } return reject; } changed has-focus => { if !self.has-focus { root.ptt-held(false); } } } } - Text { text: root.activity-banner; color: Theme.success; font-size: Math.max(11px, Theme.font-size * 0.8125); height: 22px; } + 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 { - spacing: 10px; - Rectangle { horizontal-stretch: 1; } - ActionButton { text: root.mic-enabled ? @tr("Mute microphone") : @tr("Unmute microphone"); danger: !root.mic-enabled; clicked => { root.toggle-mic(); } } - ActionButton { text: root.deafened ? @tr("Undeafen") : @tr("Deafen"); danger: root.deafened; clicked => { root.toggle-deafen(); } } - ActionButton { text: @tr("Leave room"); danger: true; clicked => { root.leave-voice(); } } - Rectangle { horizontal-stretch: 1; } + 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(); } } + RoundControl { icon: "phone-off"; leave: true; tooltip: @tr("Leave room"); clicked => { root.leave-voice(); } } } } } diff --git a/src/ui/update.rs b/src/ui/update.rs index 2c64c44..db35e28 100644 --- a/src/ui/update.rs +++ b/src/ui/update.rs @@ -407,6 +407,35 @@ fn process_net_event(ui: &mut UiState, net: &NetHandle, event: NetEvent) { } } +/// Reaction click: removes the local user's reaction when it is already set, adds it otherwise. +pub fn reaction_command( + ui: &UiState, + own_user_id: &str, + channel_id: String, + message_id: String, + emoji: String, +) -> NetCommand { + let already = ui + .messages + .get(&channel_id) + .and_then(|messages| messages.iter().find(|m| m.message_id == message_id)) + .and_then(|m| m.reactions.get(&emoji)) + .is_some_and(|users| users.iter().any(|u| u == own_user_id)); + if already { + NetCommand::ReactionRemove { + channel_id, + message_id, + emoji, + } + } else { + NetCommand::ReactionAdd { + channel_id, + message_id, + emoji, + } + } +} + fn into_msg(m: ChatMsg) -> ChatMessage { ChatMessage { message_id: m.message_id, @@ -1070,3 +1099,42 @@ mod voice_pipeline_tests { assert!(!pipeline_should_stop(Some("a"), None)); } } + +#[cfg(test)] +mod reaction_tests { + use super::*; + + fn message_with(reactions: &[(&str, &[&str])]) -> ChatMessage { + ChatMessage { + message_id: "m1".into(), + sender_id: "other".into(), + content: "hi".into(), + timestamp: 0, + edited: false, + reactions: reactions + .iter() + .map(|(emoji, users)| { + ( + (*emoji).to_string(), + users.iter().map(|u| (*u).to_string()).collect(), + ) + }) + .collect(), + reply_to: None, + } + } + + #[test] + fn clicking_a_reaction_toggles_the_local_users_vote() { + let mut ui = UiState::default(); + ui.messages.insert( + "ch".into(), + vec![message_with(&[("👍", &["me", "x"]), ("🔥", &["x"])])], + ); + let command = + |emoji: &str| reaction_command(&ui, "me", "ch".into(), "m1".into(), emoji.into()); + assert!(matches!(command("👍"), NetCommand::ReactionRemove { .. })); + assert!(matches!(command("🔥"), NetCommand::ReactionAdd { .. })); + assert!(matches!(command("😀"), NetCommand::ReactionAdd { .. })); + } +} diff --git a/src/ui_smoke.rs b/src/ui_smoke.rs index da229f6..c12e630 100644 --- a/src/ui_smoke.rs +++ b/src/ui_smoke.rs @@ -39,6 +39,24 @@ fn render(window: &MainWindow, surface: &MinimalSoftwareWindow, name: &str) { } } +/// Moves to `(x, y)` and performs one complete left click, as a real pointer would. +fn click(window: &MainWindow, x: f32, y: f32) { + let position = slint::LogicalPosition::new(x, y); + window + .window() + .dispatch_event(WindowEvent::PointerMoved { position }); + window.window().dispatch_event(WindowEvent::PointerPressed { + position, + button: PointerEventButton::Left, + }); + window + .window() + .dispatch_event(WindowEvent::PointerReleased { + position, + button: PointerEventButton::Left, + }); +} + #[test] fn native_shell_keeps_drafts_settings_and_models_between_ticks() { let surface = MinimalSoftwareWindow::new(RepaintBufferType::NewBuffer); @@ -78,8 +96,10 @@ fn native_shell_keeps_drafts_settings_and_models_between_ticks() { ui.select_text_channel("general".into()); ui.messages.insert("general".into(), vec![ui::state::ChatMessage { message_id: "fixture-message".into(), sender_id: identity.pubkey_hex.clone(), - content: "Это содержимое создаётся только в headless-тесте. Длинное сообщение переносится по ширине окна и сохраняет естественную высоту строки без обрезки.\nНовая строка должна оставаться видимой.".into(), - timestamp: 0, edited: false, reactions: Default::default(), reply_to: None, + content: "Это содержимое создаётся только в headless-тесте. Длинное сообщение переносится по ширине окна и сохраняет естественную высоту строки без обрезки.\nНовая строка должна оставаться видимой. 😀👍❤️".into(), + timestamp: 0, edited: false, + reactions: [("👍".to_string(), vec!["someone-else".to_string()]), ("🔥".to_string(), vec![identity.pubkey_hex.clone(), "x".to_string()])].into_iter().collect(), + reply_to: None, }]); let state = Rc::new(RefCell::new(AppState { webhooks: None, @@ -104,6 +124,13 @@ fn native_shell_keeps_drafts_settings_and_models_between_ticks() { ); }; sync(); + // The local user must be listed as online, matching the status in the user panel. + let members = window.get_members(); + assert_eq!(members.row_count(), 1); + let me = members.row_data(0).unwrap(); + assert!(me.is_own); + assert_eq!(me.status, window.get_user_status()); + assert_eq!(me.presence, "online"); window.show().unwrap(); let scale = snapshot_scale(); window @@ -114,8 +141,56 @@ fn native_shell_keeps_drafts_settings_and_models_between_ticks() { surface.set_size(PhysicalSize::new(1280 * scale, 800 * scale)); render(&window, &surface, "native-chat"); + // Hovering a message reveals the action bar with reply, edit, delete and reactions. + window.window().dispatch_event(WindowEvent::PointerMoved { + position: slint::LogicalPosition::new(700.0, 120.0), + }); + render(&window, &surface, "native-chat-hover"); + // The bar must stay reachable and react to the first click on its buttons. + window.window().dispatch_event(WindowEvent::PointerMoved { + position: slint::LogicalPosition::new(973.0, 72.0), + }); + click(&window, 973.0, 72.0); + assert_eq!( + state.borrow().ui.replying_to_message.as_deref(), + Some("fixture-message"), + "reply in the message action bar" + ); + state.borrow_mut().ui.replying_to_message = None; + click(&window, 941.0, 72.0); + render(&window, &surface, "native-chat-reaction-picker"); + assert!( + window + .global::() + .get_shown() + .row_count() + >= 50, + "the picker must list the bundled emoji" + ); + // Choosing an emoji closes the picker, so the next click lands on the page again. + click(&window, 752.0, 197.0); + + // Regression for the "works from the second click" defect: a button must react to its very + // first click, even though nothing inside the window has focus yet. The settings button of + // the user panel sits at the bottom right of the sidebar. + click(&window, 308.0, 767.0); + assert!( + state.borrow().ui.settings_open, + "the first click on a button must activate it" + ); + state.borrow_mut().ui.settings_open = false; + sync(); + // A second, different button right after the first one must also react immediately. + click(&window, 32.0, 775.0); + assert!( + state.borrow().ui.settings_open, + "a click on another button must not be swallowed by focus handling" + ); + state.borrow_mut().ui.settings_open = false; + sync(); + // Drive the real native editor, not only the generated callback surface. - let position = slint::LogicalPosition::new(440.0, 740.0); + let position = slint::LogicalPosition::new(440.0, 760.0); window.window().dispatch_event(WindowEvent::PointerPressed { position, button: PointerEventButton::Left, @@ -338,6 +413,33 @@ fn native_shell_keeps_drafts_settings_and_models_between_ticks() { assert!(window.get_show_voice()); assert!(window.get_voice_connected()); render(&window, &surface, "native-voice"); + // Every screen must render with all built-in themes and the custom one, without leftovers + // of the default palette (grey patches, wrong backgrounds). Snapshots are reviewed by eye. + let forest = include_str!("../examples/themes/forest.css"); + for mode in ["light", "dark", "black", "custom"] { + window.invoke_theme_selected(mode.into()); + if mode == "custom" { + window.set_theme_css(forest.into()); + window.invoke_apply_theme(forest.into()); + } + window.invoke_show_voice_view(); + sync(); + render(&window, &surface, &format!("theme-{mode}-voice")); + window.invoke_channel_selected("general".into()); + sync(); + window.window().dispatch_event(WindowEvent::PointerMoved { + position: slint::LogicalPosition::new(700.0, 120.0), + }); + render(&window, &surface, &format!("theme-{mode}-chat")); + window.invoke_show_friends_view(); + sync(); + render(&window, &surface, &format!("theme-{mode}-friends")); + window.invoke_channel_selected("general".into()); + sync(); + } + window.invoke_reset_theme(); + window.invoke_show_voice_view(); + sync(); window.invoke_channel_selected("general".into()); sync(); assert!(window.get_show_chat()); diff --git a/translations/en/LC_MESSAGES/vnox-client.po b/translations/en/LC_MESSAGES/vnox-client.po index 8e70ef5..d9a49cf 100644 --- a/translations/en/LC_MESSAGES/vnox-client.po +++ b/translations/en/LC_MESSAGES/vnox-client.po @@ -5,9 +5,6 @@ msgstr "Content-Type: text/plain; charset=UTF-8\nLanguage: en\nPlural-Forms: npl msgid " · edited" msgstr " · edited" -msgid "+ Save address" -msgstr "+ Save address" - msgid "Accept" msgstr "Accept" @@ -23,6 +20,9 @@ msgstr "Add by ID" msgid "Add passphrase" msgstr "Add passphrase" +msgid "Add reaction" +msgstr "Add reaction" + msgid "Adjust text size throughout the app." msgstr "Adjust text size throughout the app." @@ -35,6 +35,9 @@ msgstr "All friends" msgid "An integration can post only in this channel, using its own identity." msgstr "An integration can post only in this channel, using its own identity." +msgid "Animals and food" +msgstr "Animals and food" + msgid "App theme" msgstr "App theme" @@ -85,6 +88,9 @@ msgstr "Cancel" msgid "Cancel broadcast" msgstr "Cancel broadcast" +msgid "Cancel reply" +msgstr "Cancel reply" + msgid "Change passphrase" msgstr "Change passphrase" @@ -121,6 +127,9 @@ msgstr "Choose your microphone and audio output." msgid "Close" msgstr "Close" +msgid "Close settings" +msgstr "Close settings" + msgid "Collapse" msgstr "Collapse" @@ -184,8 +193,11 @@ msgstr "Devices and voice input" msgid "Direct messages" msgstr "Direct messages" -msgid "Disconnect" -msgstr "Disconnect" +msgid "Disconnect from server" +msgstr "Disconnect from server" + +msgid "Dismiss" +msgstr "Dismiss" msgid "Drag the photo and adjust the zoom." msgstr "Drag the photo and adjust the zoom." @@ -193,15 +205,15 @@ msgstr "Drag the photo and adjust the zoom." msgid "Edit" msgstr "Edit" +msgid "Emoji" +msgstr "Emoji" + msgid "End-to-end encrypted" msgstr "End-to-end encrypted" msgid "Enter a local .css path to import or export a theme." msgstr "Enter a local .css path to import or export a theme." -msgid "Enter to send · Shift+Enter for a new line" -msgstr "Enter to send · Shift+Enter for a new line" - msgid "Enter your server address or choose a saved server." msgstr "Enter your server address or choose a saved server." @@ -223,15 +235,27 @@ msgstr "For example: /home/user/themes/my-vnox.css" msgid "Forget this server" msgstr "Forget this server" +msgid "Friend ID" +msgstr "Friend ID" + msgid "Friends" msgstr "Friends" +msgid "Gestures" +msgstr "Gestures" + msgid "GitHub updates" msgstr "GitHub updates" msgid "Headphones or speakers" msgstr "Headphones or speakers" +msgid "Heart" +msgstr "Heart" + +msgid "Hearts and symbols" +msgstr "Hearts and symbols" + msgid "Hide secret" msgstr "Hide secret" @@ -286,6 +310,9 @@ msgstr "LOCAL PREVIEW" msgid "Language" msgstr "Language" +msgid "Laugh" +msgstr "Laugh" + msgid "Leave" msgstr "Leave" @@ -298,6 +325,9 @@ msgstr "Less bandwidth" msgid "Light" msgstr "Light" +msgid "Like" +msgstr "Like" + msgid "Main variables: --vnox-bg, --vnox-surface, --vnox-text, --vnox-accent, --vnox-font-size. See the theme documentation for the full list." msgstr "Main variables: --vnox-bg, --vnox-surface, --vnox-text, --vnox-accent, --vnox-font-size. See the theme documentation for the full list." @@ -313,9 +343,6 @@ msgstr "Master switch, also covers connection and error tones" msgid "Members" msgstr "Members" -msgid "Members — {}" -msgstr "Members — {}" - msgid "Mentions" msgstr "Mentions" @@ -376,9 +403,15 @@ msgstr "No saved servers yet." msgid "No webhooks yet. Add an integration below." msgstr "No webhooks yet. Add an integration below." +msgid "Nothing found" +msgstr "Nothing found" + msgid "Nothing is being broadcast" msgstr "Nothing is being broadcast" +msgid "Objects and activities" +msgstr "Objects and activities" + msgid "One application" msgstr "One application" @@ -412,6 +445,9 @@ msgstr "Open microphone" msgid "Outgoing events" msgstr "Outgoing events" +msgid "Passphrase protected" +msgstr "Passphrase protected" + msgid "Photo" msgstr "Photo" @@ -466,6 +502,9 @@ msgstr "Refresh" msgid "Remove passphrase" msgstr "Remove passphrase" +msgid "Remove saved server" +msgstr "Remove saved server" + msgid "Repeat backup passphrase" msgstr "Repeat backup passphrase" @@ -505,6 +544,9 @@ msgstr "Rotate secret" msgid "Rotate this secret?" msgstr "Rotate this secret?" +msgid "Save address" +msgstr "Save address" + msgid "Save passphrase" msgstr "Save passphrase" @@ -520,6 +562,9 @@ msgstr "Screen capture is not available in this build." msgid "Screen preview" msgstr "Screen preview" +msgid "Search emoji" +msgstr "Search emoji" + msgid "Security and backup" msgstr "Security and backup" @@ -547,6 +592,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 "Smileys" +msgstr "Smileys" + msgid "Someone mentions you or everyone" msgstr "Someone mentions you or everyone" @@ -652,12 +700,15 @@ msgstr "Video, application audio and your microphone stay separate." msgid "Vnox will ask for your passphrase to unlock your keys on startup." msgstr "Vnox will ask for your passphrase to unlock your keys on startup." -msgid "Vnox — unlock" -msgstr "Vnox — unlock" +msgid "Vnox: unlock" +msgstr "Vnox: unlock" msgid "Voice activation" msgstr "Voice activation" +msgid "Voice connected" +msgstr "Voice connected" + msgid "Voice input" msgstr "Voice input" @@ -712,6 +763,11 @@ msgstr "Your server. Your community." msgid "Zoom {}%" msgstr "Zoom {}%" +msgid "{n} member" +msgid_plural "{n} members" +msgstr[0] "{n} member" +msgstr[1] "{n} members" + msgid "{n} participant" msgid_plural "{n} participants" msgstr[0] "{n} participant" @@ -719,9 +775,3 @@ msgstr[1] "{n} participants" msgid "{} kbps" msgstr "{} kbps" - -msgid "● Passphrase protected" -msgstr "● Passphrase protected" - -msgid "● Voice connected" -msgstr "● Voice connected" diff --git a/translations/ru.json b/translations/ru.json index 0e05c7c..a06671c 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -9,8 +9,6 @@ "No messages in this channel yet.": "В этом канале пока нет сообщений.", "Reply to ": "Ответ ", "Send": "Отправить", - "Enter to send · Shift+Enter for a new line": "Enter — отправить · Shift+Enter — новая строка", - "Members — ": "Участники — ", "Settings": "Настройки", "Connect to a server": "Подключиться к серверу", "Enter your server address or choose a saved server.": "Введи адрес своего сервера или выбери сохранённый.", @@ -34,7 +32,7 @@ "Blocked users": "Заблокированные пользователи", "Online friends": "Друзья в сети", "All friends": "Все друзья", - "Message": "Написать", + "Message": "Сообщение", "Accept": "Принять", "Decline": "Отклонить", "No friends yet. Add someone using their ID.": "Список друзей пока пуст. Добавь друга по его ID.", @@ -72,7 +70,6 @@ "Leave room": "Покинуть комнату", "Delete message?": "Удалить сообщение?", "This cannot be undone.": "Это действие нельзя отменить.", - "Vnox — unlock": "Vnox — разблокировка", "Unlock profile": "Разблокировать профиль", "Your keys on this device are protected by a passphrase.": "Ключи на этом устройстве защищены паролем.", "Profile passphrase": "Пароль профиля", @@ -93,7 +90,7 @@ "Choose when others can hear you.": "Определи, когда тебя слышат остальные.", "Voice activation": "Активация голосом", "Open microphone": "Открытый микрофон", - "Hold the talk button in a voice room. Release it to stop transmitting.": "Удерживай кнопку разговора в голосовой комнате. Отпусти — микрофон перестанет передавать звук.", + "Hold the talk button in a voice room. Release it to stop transmitting.": "Удерживай кнопку разговора в голосовой комнате. Отпусти - микрофон перестанет передавать звук.", "Your microphone transmits when speech is detected.": "Микрофон передаёт звук, когда обнаружен голос.", "Audio transmits continuously while the microphone is enabled.": "Звук передаётся постоянно, пока микрофон включён.", "Voice quality": "Качество голоса", @@ -233,7 +230,6 @@ "Do not disturb": "Не беспокоить", "Default": "По умолчанию", "Reply to {}": "Ответ {}", - "Members — {}": "Участники — {}", "Zoom {}%": "Масштаб {}%", "{} kbps": "{} кбит/с", "Screen preview": "Предпросмотр экрана", @@ -378,5 +374,32 @@ "Mentions": "Упоминания", "Someone mentions you or everyone": "Вас или всех упомянули", "Sound volume": "Громкость звуков", - "Play a test sound": "Проверить звук" + "Play a test sound": "Проверить звук", + "Add reaction": "Добавить реакцию", + "Animals and food": "Животные и еда", + "Cancel reply": "Отменить ответ", + "Close settings": "Закрыть настройки", + "Disconnect from server": "Отключиться от сервера", + "Dismiss": "Скрыть", + "Emoji": "Эмодзи", + "Gestures": "Жесты", + "Heart": "Сердце", + "Hearts and symbols": "Сердца и символы", + "Laugh": "Смех", + "Like": "Нравится", + "Nothing found": "Ничего не найдено", + "Objects and activities": "Предметы и занятия", + "Passphrase protected": "Защищено паролем", + "Remove saved server": "Убрать сохранённый сервер", + "Save address": "Сохранить адрес", + "Search emoji": "Поиск эмодзи", + "Smileys": "Смайлики", + "Vnox: unlock": "Vnox: разблокировка", + "Voice connected": "Голос подключён", + "{n} member": [ + "{n} участник", + "{n} участника", + "{n} участников" + ], + "Friend ID": "ID друга" } diff --git a/translations/ru/LC_MESSAGES/vnox-client.po b/translations/ru/LC_MESSAGES/vnox-client.po index 352f52c..d22255f 100644 --- a/translations/ru/LC_MESSAGES/vnox-client.po +++ b/translations/ru/LC_MESSAGES/vnox-client.po @@ -5,9 +5,6 @@ msgstr "Content-Type: text/plain; charset=UTF-8\nLanguage: ru\nPlural-Forms: npl msgid " · edited" msgstr " · изменено" -msgid "+ Save address" -msgstr "+ Сохранить адрес" - msgid "Accept" msgstr "Принять" @@ -23,6 +20,9 @@ msgstr "Добавить по ID" msgid "Add passphrase" msgstr "Добавить пароль" +msgid "Add reaction" +msgstr "Добавить реакцию" + msgid "Adjust text size throughout the app." msgstr "Меняет масштаб текста во всём приложении." @@ -35,6 +35,9 @@ msgstr "Все друзья" msgid "An integration can post only in this channel, using its own identity." msgstr "Интеграция публикует сообщения только в этом канале и от своего имени." +msgid "Animals and food" +msgstr "Животные и еда" + msgid "App theme" msgstr "Тема приложения" @@ -86,6 +89,9 @@ msgstr "Отмена" msgid "Cancel broadcast" msgstr "Отменить трансляцию" +msgid "Cancel reply" +msgstr "Отменить ответ" + msgid "Change passphrase" msgstr "Изменить пароль" @@ -122,6 +128,9 @@ msgstr "Выбери, откуда брать голос и куда вывод msgid "Close" msgstr "Закрыть" +msgid "Close settings" +msgstr "Закрыть настройки" + msgid "Collapse" msgstr "Свернуть" @@ -185,8 +194,11 @@ msgstr "Устройства и передача" msgid "Direct messages" msgstr "Личные сообщения" -msgid "Disconnect" -msgstr "Отключиться" +msgid "Disconnect from server" +msgstr "Отключиться от сервера" + +msgid "Dismiss" +msgstr "Скрыть" msgid "Drag the photo and adjust the zoom." msgstr "Перетащи фото и выбери масштаб." @@ -194,15 +206,15 @@ msgstr "Перетащи фото и выбери масштаб." msgid "Edit" msgstr "Править" +msgid "Emoji" +msgstr "Эмодзи" + msgid "End-to-end encrypted" msgstr "Сквозное шифрование" msgid "Enter a local .css path to import or export a theme." msgstr "Введи локальный путь к .css, чтобы импортировать тему или сохранить её в файл." -msgid "Enter to send · Shift+Enter for a new line" -msgstr "Enter — отправить · Shift+Enter — новая строка" - msgid "Enter your server address or choose a saved server." msgstr "Введи адрес своего сервера или выбери сохранённый." @@ -224,15 +236,27 @@ msgstr "Например: /home/user/themes/my-vnox.css" msgid "Forget this server" msgstr "Забыть этот сервер" +msgid "Friend ID" +msgstr "ID друга" + msgid "Friends" msgstr "Друзья" +msgid "Gestures" +msgstr "Жесты" + msgid "GitHub updates" msgstr "Обновления GitHub" msgid "Headphones or speakers" msgstr "Наушники или колонки" +msgid "Heart" +msgstr "Сердце" + +msgid "Hearts and symbols" +msgstr "Сердца и символы" + msgid "Hide secret" msgstr "Скрыть секрет" @@ -240,7 +264,7 @@ msgid "Hold here to talk" msgstr "Удерживай здесь, чтобы говорить" msgid "Hold the talk button in a voice room. Release it to stop transmitting." -msgstr "Удерживай кнопку разговора в голосовой комнате. Отпусти — микрофон перестанет передавать звук." +msgstr "Удерживай кнопку разговора в голосовой комнате. Отпусти - микрофон перестанет передавать звук." msgid "Import" msgstr "Импортировать" @@ -287,6 +311,9 @@ msgstr "ЛОКАЛЬНЫЙ ПРОСМОТР" msgid "Language" msgstr "Язык" +msgid "Laugh" +msgstr "Смех" + msgid "Leave" msgstr "Выйти" @@ -299,6 +326,9 @@ msgstr "Меньше трафика" msgid "Light" msgstr "Светлая" +msgid "Like" +msgstr "Нравится" + msgid "Main variables: --vnox-bg, --vnox-surface, --vnox-text, --vnox-accent, --vnox-font-size. See the theme documentation for the full list." msgstr "Основные переменные: --vnox-bg, --vnox-surface, --vnox-text, --vnox-accent, --vnox-font-size. Полный список описан в документации тем." @@ -314,14 +344,11 @@ msgstr "Общий переключатель, включая сигналы с msgid "Members" msgstr "Участники" -msgid "Members — {}" -msgstr "Участники — {}" - msgid "Mentions" msgstr "Упоминания" msgid "Message" -msgstr "Написать" +msgstr "Сообщение" msgid "Messages" msgstr "Сообщения" @@ -377,9 +404,15 @@ msgstr "Сохранённых серверов пока нет." msgid "No webhooks yet. Add an integration below." msgstr "Вебхуков пока нет. Добавьте интеграцию ниже." +msgid "Nothing found" +msgstr "Ничего не найдено" + msgid "Nothing is being broadcast" msgstr "Трансляция не ведётся" +msgid "Objects and activities" +msgstr "Предметы и занятия" + msgid "One application" msgstr "Одно приложение" @@ -413,6 +446,9 @@ msgstr "Открытый микрофон" msgid "Outgoing events" msgstr "Исходящие события" +msgid "Passphrase protected" +msgstr "Защищено паролем" + msgid "Photo" msgstr "Фото" @@ -467,6 +503,9 @@ msgstr "Обновить" msgid "Remove passphrase" msgstr "Убрать пароль" +msgid "Remove saved server" +msgstr "Убрать сохранённый сервер" + msgid "Repeat backup passphrase" msgstr "Повтори пароль копии" @@ -506,6 +545,9 @@ msgstr "Заменить секрет" msgid "Rotate this secret?" msgstr "Заменить этот секрет?" +msgid "Save address" +msgstr "Сохранить адрес" + msgid "Save passphrase" msgstr "Сохранить пароль" @@ -521,6 +563,9 @@ msgstr "Захват экрана недоступен в этой сборке. msgid "Screen preview" msgstr "Предпросмотр экрана" +msgid "Search emoji" +msgstr "Поиск эмодзи" + msgid "Security and backup" msgstr "Защита и резервная копия" @@ -548,6 +593,9 @@ msgstr "Звук демонстрации" msgid "Short tones for voice rooms, messages and connection changes. They stay silent while you are deafened." msgstr "Короткие сигналы для голосовых комнат, сообщений и смены состояния связи. Пока звук выключен, они молчат." +msgid "Smileys" +msgstr "Смайлики" + msgid "Someone mentions you or everyone" msgstr "Вас или всех упомянули" @@ -653,12 +701,15 @@ msgstr "Видео, звук приложения и микрофон перед msgid "Vnox will ask for your passphrase to unlock your keys on startup." msgstr "При запуске Vnox потребуется пароль для доступа к ключам." -msgid "Vnox — unlock" -msgstr "Vnox — разблокировка" +msgid "Vnox: unlock" +msgstr "Vnox: разблокировка" msgid "Voice activation" msgstr "Активация голосом" +msgid "Voice connected" +msgstr "Голос подключён" + msgid "Voice input" msgstr "Передача голоса" @@ -713,6 +764,12 @@ msgstr "Твой сервер. Твоё сообщество." msgid "Zoom {}%" msgstr "Масштаб {}%" +msgid "{n} member" +msgid_plural "{n} members" +msgstr[0] "{n} участник" +msgstr[1] "{n} участника" +msgstr[2] "{n} участников" + msgid "{n} participant" msgid_plural "{n} participants" msgstr[0] "{n} участник" @@ -721,9 +778,3 @@ msgstr[2] "{n} участников" msgid "{} kbps" msgstr "{} кбит/с" - -msgid "● Passphrase protected" -msgstr "● Защищено паролем" - -msgid "● Voice connected" -msgstr "● Голос подключён"