Add importable language and theme packs
This commit is contained in:
parent
3ca73d86cd
commit
00c8ed0697
|
|
@ -95,6 +95,15 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arbitrary"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed"
|
||||
dependencies = [
|
||||
"derive_arbitrary",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arrayref"
|
||||
version = "0.3.9"
|
||||
|
|
@ -670,7 +679,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deckstride"
|
||||
version = "0.1.100"
|
||||
version = "0.1.101"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"chrono",
|
||||
|
|
@ -697,6 +706,18 @@ dependencies = [
|
|||
"winit",
|
||||
"winresource",
|
||||
"x11-dl",
|
||||
"zip",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_arbitrary"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b034bd7d5f032402a2479444dcc6f74e36a03f31854d41680fb240ef682a1ac"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4319,6 +4340,21 @@ dependencies = [
|
|||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "2.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744"
|
||||
dependencies = [
|
||||
"arbitrary",
|
||||
"crc32fast",
|
||||
"crossbeam-utils",
|
||||
"flate2",
|
||||
"indexmap",
|
||||
"memchr",
|
||||
"zopfli",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zlib-rs"
|
||||
version = "0.6.8"
|
||||
|
|
@ -4331,6 +4367,18 @@ version = "1.0.23"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
||||
|
||||
[[package]]
|
||||
name = "zopfli"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"crc32fast",
|
||||
"log",
|
||||
"simd-adler32",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zune-core"
|
||||
version = "0.5.3"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ default-members = ["crates/deckstride"]
|
|||
resolver = "3"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.100"
|
||||
version = "0.1.101"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://proxy.dandaedre.com/gitea/idle-org/deckstride"
|
||||
|
|
|
|||
15
README.md
15
README.md
|
|
@ -45,7 +45,7 @@ slow document operation does not have to freeze navigation.
|
|||
| **Notes that belong to the presentation** | Read notes from a sidecar or the PDF, import TXT/Markdown, and double-click the notes pane to edit the current slide. Notes automatically fit the available space. |
|
||||
| **Presentation-aware desktop behavior** | Deckstride asks supported operating systems to keep the display awake and reports whether protection is active. Closing Presenter also closes its Slides windows. |
|
||||
| **Portable by design** | The release binaries include the PDF renderer and application dependencies. Keep the extracted folder anywhere convenient; no Rust or separate PDF software is required. |
|
||||
| **Themes and languages** | Choose from 20 built-in palettes and English, French, Spanish, Japanese, Simplified Chinese, German or Brazilian Portuguese. System language detection stays offline. |
|
||||
| **Themes and languages** | Choose from 20 built-in palettes and seven interface languages, or import bounded offline language/theme packs. |
|
||||
|
||||
On Windows, multi-screen output, per-screen layouts, zoom, tools, and unplugging then
|
||||
reconnecting displays have been tested in extended use. Linux and macOS use the same
|
||||
|
|
@ -142,6 +142,19 @@ Useful controls:
|
|||
[Notes file formats →](docs/interfaces/presentation-notes.md) ·
|
||||
[Preparation, cache and RAM behavior →](docs/user-guide.md#preparation-processed-slides-and-ram)
|
||||
|
||||
## Add languages and themes
|
||||
|
||||
Open **Preferences → General → Appearance** and choose **Import language pack…**
|
||||
or **Import theme pack…**. Imported choices appear in the existing Language and
|
||||
Theme selectors without restarting Deckstride. Packs stay offline and contain data
|
||||
only.
|
||||
|
||||
Editable examples and ready-to-import ZIPs:
|
||||
|
||||
- [Language pack example](docs/packs/deckstride-language-pack.zip)
|
||||
- [Theme pack example](docs/packs/deckstride-theme-pack.zip)
|
||||
- [Pack format and limits](docs/packs/README.md)
|
||||
|
||||
## Open source
|
||||
|
||||
Deckstride is independent open-source software under the [MIT license](LICENSE).
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ hayro = "=0.9.0"
|
|||
chrono = "0.4"
|
||||
rfd = "=0.15.4"
|
||||
sysinfo = { version = "=0.37.2", default-features = false, features = ["system"] }
|
||||
zip = { version = "2", default-features = false, features = ["deflate"] }
|
||||
|
||||
[target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "macos"))'.dependencies]
|
||||
keepawake = "=0.6.1"
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ pub mod studio;
|
|||
|
||||
/// Presenter interface language.
|
||||
pub mod localization;
|
||||
/// Bounded runtime language and theme packs.
|
||||
pub mod packs;
|
||||
/// Standalone presenter palettes.
|
||||
pub mod theme;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,12 @@ enum ResolvedLanguage {
|
|||
PtBr,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
struct ActiveLanguage {
|
||||
builtin: ResolvedLanguage,
|
||||
pack: Option<String>,
|
||||
}
|
||||
|
||||
fn language_id() -> egui::Id {
|
||||
egui::Id::new("deckstride-language")
|
||||
}
|
||||
|
|
@ -100,19 +106,31 @@ fn system_language() -> ResolvedLanguage {
|
|||
}
|
||||
|
||||
pub fn apply(ctx: &egui::Context, language: &Language) {
|
||||
apply_selected(ctx, language, None);
|
||||
}
|
||||
|
||||
pub fn apply_selected(ctx: &egui::Context, language: &Language, pack: Option<&str>) {
|
||||
let resolved = language.resolved();
|
||||
let previous = ctx.data(|data| data.get_temp::<ResolvedLanguage>(language_id()));
|
||||
if previous == Some(resolved) {
|
||||
let active = ActiveLanguage {
|
||||
builtin: resolved,
|
||||
pack: pack.map(str::to_owned),
|
||||
};
|
||||
let previous = ctx.data(|data| data.get_temp::<ActiveLanguage>(language_id()));
|
||||
if previous.as_ref() == Some(&active) {
|
||||
return;
|
||||
}
|
||||
if matches!(resolved, ResolvedLanguage::Ja | ResolvedLanguage::ZhCn) {
|
||||
if pack.is_none() && matches!(resolved, ResolvedLanguage::Ja | ResolvedLanguage::ZhCn) {
|
||||
ctx.set_fonts(cjk_fonts(resolved));
|
||||
} else if previous
|
||||
.is_some_and(|language| matches!(language, ResolvedLanguage::Ja | ResolvedLanguage::ZhCn))
|
||||
{
|
||||
} else if previous.is_some_and(|language| {
|
||||
language.pack.is_none()
|
||||
&& matches!(
|
||||
language.builtin,
|
||||
ResolvedLanguage::Ja | ResolvedLanguage::ZhCn
|
||||
)
|
||||
}) {
|
||||
ctx.set_fonts(egui::FontDefinitions::default());
|
||||
}
|
||||
ctx.data_mut(|data| data.insert_temp(language_id(), resolved));
|
||||
ctx.data_mut(|data| data.insert_temp(language_id(), active));
|
||||
}
|
||||
|
||||
fn cjk_fonts(language: ResolvedLanguage) -> egui::FontDefinitions {
|
||||
|
|
@ -136,10 +154,18 @@ fn cjk_fonts(language: ResolvedLanguage) -> egui::FontDefinitions {
|
|||
}
|
||||
|
||||
pub fn tr<'a>(ctx: &egui::Context, text: &'a str) -> &'a str {
|
||||
match ctx
|
||||
.data(|data| data.get_temp::<ResolvedLanguage>(language_id()))
|
||||
.unwrap_or(ResolvedLanguage::En)
|
||||
let active = ctx
|
||||
.data(|data| data.get_temp::<ActiveLanguage>(language_id()))
|
||||
.unwrap_or(ActiveLanguage {
|
||||
builtin: ResolvedLanguage::En,
|
||||
pack: None,
|
||||
});
|
||||
if let Some(locale) = active.pack
|
||||
&& let Some(translated) = crate::packs::translation(&locale, text)
|
||||
{
|
||||
return translated;
|
||||
}
|
||||
match active.builtin {
|
||||
ResolvedLanguage::En => text,
|
||||
ResolvedLanguage::Fr => fr(text),
|
||||
ResolvedLanguage::Es => es(text),
|
||||
|
|
@ -152,7 +178,8 @@ pub fn tr<'a>(ctx: &egui::Context, text: &'a str) -> &'a str {
|
|||
|
||||
pub fn display_revert_countdown(ctx: &egui::Context, seconds: u64) -> String {
|
||||
match ctx
|
||||
.data(|data| data.get_temp::<ResolvedLanguage>(language_id()))
|
||||
.data(|data| data.get_temp::<ActiveLanguage>(language_id()))
|
||||
.map(|active| active.builtin)
|
||||
.unwrap_or(ResolvedLanguage::En)
|
||||
{
|
||||
ResolvedLanguage::Fr => {
|
||||
|
|
|
|||
|
|
@ -194,7 +194,9 @@ struct NativeWindow {
|
|||
zoom_slow: bool,
|
||||
presentation_base: Option<PresentationBase>,
|
||||
applied_theme: Option<crate::theme::Theme>,
|
||||
applied_theme_pack: Option<Option<String>>,
|
||||
applied_language: Option<crate::localization::Language>,
|
||||
applied_language_pack: Option<Option<String>>,
|
||||
#[cfg(target_os = "linux")]
|
||||
browser_parent: Option<WindowId>,
|
||||
}
|
||||
|
|
@ -256,7 +258,9 @@ impl NativeWindow {
|
|||
zoom_slow: false,
|
||||
presentation_base: None,
|
||||
applied_theme: None,
|
||||
applied_theme_pack: None,
|
||||
applied_language: None,
|
||||
applied_language_pack: None,
|
||||
#[cfg(target_os = "linux")]
|
||||
browser_parent: None,
|
||||
})
|
||||
|
|
@ -340,13 +344,27 @@ impl NativeWindow {
|
|||
return Err("Display exceeds 40 megapixels".into());
|
||||
}
|
||||
if let Some(s) = studio.as_ref() {
|
||||
if self.applied_theme != Some(s.settings.theme) {
|
||||
s.settings.theme.apply(&self.ctx);
|
||||
if self.applied_theme != Some(s.settings.theme)
|
||||
|| self.applied_theme_pack.as_ref() != Some(&s.settings.theme_pack)
|
||||
{
|
||||
crate::theme::apply_selected(
|
||||
&self.ctx,
|
||||
s.settings.theme,
|
||||
s.settings.theme_pack.as_deref(),
|
||||
);
|
||||
self.applied_theme = Some(s.settings.theme);
|
||||
self.applied_theme_pack = Some(s.settings.theme_pack.clone());
|
||||
}
|
||||
if self.applied_language != Some(s.settings.language) {
|
||||
crate::localization::apply(&self.ctx, &s.settings.language);
|
||||
if self.applied_language != Some(s.settings.language)
|
||||
|| self.applied_language_pack.as_ref() != Some(&s.settings.language_pack)
|
||||
{
|
||||
crate::localization::apply_selected(
|
||||
&self.ctx,
|
||||
&s.settings.language,
|
||||
s.settings.language_pack.as_deref(),
|
||||
);
|
||||
self.applied_language = Some(s.settings.language);
|
||||
self.applied_language_pack = Some(s.settings.language_pack.clone());
|
||||
}
|
||||
}
|
||||
let input = self.input.take_egui_input(&self.window);
|
||||
|
|
@ -1171,7 +1189,11 @@ impl App {
|
|||
#[cfg(target_os = "windows")]
|
||||
if matches!(
|
||||
action,
|
||||
Action::Pick(_) | Action::PickNotes | Action::PickBlankPicture
|
||||
Action::Pick(_)
|
||||
| Action::PickNotes
|
||||
| Action::PickBlankPicture
|
||||
| Action::PickLanguagePack
|
||||
| Action::PickThemePack
|
||||
) && !s.dialog_busy
|
||||
{
|
||||
use winit::raw_window_handle::{HasWindowHandle, RawWindowHandle};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,698 @@
|
|||
//! Bounded, data-only language and theme packs compatible with Canvas Pilot manifests.
|
||||
use crate::theme::Palette;
|
||||
use egui::Color32;
|
||||
use serde::Deserialize;
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::{
|
||||
collections::{BTreeMap, BTreeSet},
|
||||
io::Read,
|
||||
path::{Path, PathBuf},
|
||||
sync::{LazyLock, RwLock},
|
||||
};
|
||||
|
||||
const MAX_ARCHIVE: u64 = 2 * 1024 * 1024;
|
||||
const MAX_EXPANDED: u64 = 4 * 1024 * 1024;
|
||||
const MAX_PACKS: usize = 32;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct LanguageManifest {
|
||||
version: u32,
|
||||
id: String,
|
||||
revision: u64,
|
||||
languages: Vec<LanguageDescription>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct LanguageDescription {
|
||||
pub locale: String,
|
||||
pub name: String,
|
||||
pub native_name: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct InstalledLanguagePack {
|
||||
pub id: String,
|
||||
pub revision: u64,
|
||||
pub languages: Vec<LanguageDescription>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct LanguagePack {
|
||||
manifest: LanguageManifest,
|
||||
catalogs: BTreeMap<String, BTreeMap<String, &'static str>>,
|
||||
path: PathBuf,
|
||||
fingerprint: [u8; 32],
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct ThemeManifest {
|
||||
version: u32,
|
||||
id: String,
|
||||
revision: u64,
|
||||
themes: Vec<ThemeDescription>,
|
||||
#[serde(default)]
|
||||
notices: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct ThemeDescription {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub light: bool,
|
||||
colors: ThemeColors,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct ThemeColors {
|
||||
canvas: String,
|
||||
banner: String,
|
||||
grid: String,
|
||||
layer: String,
|
||||
bg: String,
|
||||
panel: String,
|
||||
field: String,
|
||||
line: String,
|
||||
text: String,
|
||||
muted: String,
|
||||
cyan: String,
|
||||
amber: String,
|
||||
purple: String,
|
||||
pattern: [String; 2],
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct InstalledThemePack {
|
||||
pub id: String,
|
||||
pub revision: u64,
|
||||
pub themes: Vec<ThemeDescription>,
|
||||
pub notices: String,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct ThemePack {
|
||||
manifest: ThemeManifest,
|
||||
path: PathBuf,
|
||||
fingerprint: [u8; 32],
|
||||
}
|
||||
|
||||
static LANGUAGE_PACKS: LazyLock<RwLock<Vec<LanguagePack>>> =
|
||||
LazyLock::new(|| RwLock::new(Vec::new()));
|
||||
static THEME_PACKS: LazyLock<RwLock<Vec<ThemePack>>> = LazyLock::new(|| RwLock::new(Vec::new()));
|
||||
#[derive(Default)]
|
||||
struct InternPool {
|
||||
values: BTreeMap<String, &'static str>,
|
||||
bytes: usize,
|
||||
}
|
||||
static INTERNED: LazyLock<RwLock<InternPool>> = LazyLock::new(Default::default);
|
||||
|
||||
pub fn valid_id(id: &str) -> bool {
|
||||
!id.is_empty()
|
||||
&& id.len() <= 63
|
||||
&& id
|
||||
.bytes()
|
||||
.all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit() || byte == b'-')
|
||||
&& !id.starts_with('-')
|
||||
&& !id.ends_with('-')
|
||||
}
|
||||
|
||||
pub fn valid_theme_choice(id: &str) -> bool {
|
||||
id.split_once('/')
|
||||
.is_some_and(|(pack, theme)| valid_id(pack) && valid_id(theme))
|
||||
}
|
||||
|
||||
fn bounded_read(path: &Path) -> Result<Vec<u8>, String> {
|
||||
let mut bytes = Vec::new();
|
||||
std::fs::File::open(path)
|
||||
.map_err(|error| error.to_string())?
|
||||
.take(MAX_ARCHIVE + 1)
|
||||
.read_to_end(&mut bytes)
|
||||
.map_err(|error| error.to_string())?;
|
||||
if bytes.len() as u64 > MAX_ARCHIVE {
|
||||
return Err("Pack exceeds 2 MiB".into());
|
||||
}
|
||||
Ok(bytes)
|
||||
}
|
||||
|
||||
fn fingerprint(bytes: &[u8]) -> [u8; 32] {
|
||||
Sha256::digest(bytes).into()
|
||||
}
|
||||
|
||||
fn intern(text: String) -> Result<&'static str, String> {
|
||||
let mut pool = INTERNED.write().unwrap();
|
||||
if let Some(value) = pool.values.get(&text) {
|
||||
return Ok(value);
|
||||
}
|
||||
if pool.bytes.saturating_add(text.len()) > 32 * 1024 * 1024 {
|
||||
return Err(
|
||||
"Runtime language-pack text limit reached; restart before importing more".into(),
|
||||
);
|
||||
}
|
||||
let leaked = Box::leak(text.clone().into_boxed_str());
|
||||
pool.bytes += text.len();
|
||||
pool.values.insert(text, leaked);
|
||||
Ok(leaked)
|
||||
}
|
||||
|
||||
fn parse_language(bytes: &[u8], path: PathBuf) -> Result<LanguagePack, String> {
|
||||
if bytes.len() as u64 > MAX_ARCHIVE {
|
||||
return Err("Language pack exceeds 2 MiB".into());
|
||||
}
|
||||
let mut zip = zip::ZipArchive::new(std::io::Cursor::new(bytes)).map_err(|e| e.to_string())?;
|
||||
if zip.is_empty() || zip.len() > 17 {
|
||||
return Err("Expected manifest.json and at most 16 catalogs".into());
|
||||
}
|
||||
let mut entries = BTreeMap::new();
|
||||
let mut expanded = 0_u64;
|
||||
for index in 0..zip.len() {
|
||||
let mut entry = zip.by_index(index).map_err(|e| e.to_string())?;
|
||||
let name = entry.name().to_owned();
|
||||
if name.contains(['/', '\\'])
|
||||
|| !name.ends_with(".json")
|
||||
|| entry.is_dir()
|
||||
|| entry
|
||||
.unix_mode()
|
||||
.is_some_and(|mode| mode & 0o170000 == 0o120000)
|
||||
{
|
||||
return Err("Pack entries must be regular JSON files at the ZIP root".into());
|
||||
}
|
||||
let mut data = Vec::new();
|
||||
(&mut entry)
|
||||
.take(MAX_EXPANDED.saturating_sub(expanded) + 1)
|
||||
.read_to_end(&mut data)
|
||||
.map_err(|e| e.to_string())?;
|
||||
expanded += data.len() as u64;
|
||||
if expanded > MAX_EXPANDED {
|
||||
return Err("Expanded language pack exceeds 4 MiB".into());
|
||||
}
|
||||
if entries.insert(name, data).is_some() {
|
||||
return Err("Duplicate ZIP entry".into());
|
||||
}
|
||||
}
|
||||
let manifest: LanguageManifest = serde_json::from_slice(
|
||||
&entries
|
||||
.remove("manifest.json")
|
||||
.ok_or("Missing manifest.json")?,
|
||||
)
|
||||
.map_err(|e| e.to_string())?;
|
||||
if manifest.version != 2
|
||||
|| manifest.revision == 0
|
||||
|| !valid_id(&manifest.id)
|
||||
|| manifest.languages.is_empty()
|
||||
|| manifest.languages.len() > 16
|
||||
{
|
||||
return Err("Invalid language-pack manifest or unsupported version".into());
|
||||
}
|
||||
let builtins = ["system", "en", "fr", "es", "ja", "zh-cn", "de", "pt-br"];
|
||||
let mut locales = BTreeSet::new();
|
||||
let mut catalogs = BTreeMap::new();
|
||||
for language in &manifest.languages {
|
||||
if !valid_id(&language.locale)
|
||||
|| builtins.contains(&language.locale.as_str())
|
||||
|| !locales.insert(language.locale.clone())
|
||||
{
|
||||
return Err("Invalid, duplicate, or built-in locale identifier".into());
|
||||
}
|
||||
for name in [&language.name, &language.native_name] {
|
||||
if name.trim().is_empty() || name.len() > 160 || name.chars().any(char::is_control) {
|
||||
return Err("Invalid language display name".into());
|
||||
}
|
||||
}
|
||||
let messages: BTreeMap<String, String> = serde_json::from_slice(
|
||||
&entries
|
||||
.remove(&format!("{}.json", language.locale))
|
||||
.ok_or("Missing language catalog")?,
|
||||
)
|
||||
.map_err(|e| e.to_string())?;
|
||||
if messages.is_empty() || messages.len() > 4096 {
|
||||
return Err("Language catalog is empty or too large".into());
|
||||
}
|
||||
let mut checked = BTreeMap::new();
|
||||
for (key, value) in messages {
|
||||
if key.trim().is_empty()
|
||||
|| key.len() > 16_384
|
||||
|| key.chars().any(char::is_control)
|
||||
|| value.trim().is_empty()
|
||||
|| value.len() > 16_384
|
||||
|| value
|
||||
.chars()
|
||||
.any(|c| c.is_control() && c != '\n' && c != '\t')
|
||||
{
|
||||
return Err("Invalid translation key or text".into());
|
||||
}
|
||||
checked.insert(key, intern(value)?);
|
||||
}
|
||||
catalogs.insert(language.locale.clone(), checked);
|
||||
}
|
||||
if !entries.is_empty() {
|
||||
return Err("Unexpected files in language pack".into());
|
||||
}
|
||||
Ok(LanguagePack {
|
||||
manifest,
|
||||
catalogs,
|
||||
path,
|
||||
fingerprint: fingerprint(bytes),
|
||||
})
|
||||
}
|
||||
|
||||
fn color(text: &str) -> Result<Color32, String> {
|
||||
if text.len() != 7
|
||||
|| !text.starts_with('#')
|
||||
|| !text[1..].bytes().all(|byte| byte.is_ascii_hexdigit())
|
||||
{
|
||||
return Err(format!("Expected opaque #RRGGBB color: {text}"));
|
||||
}
|
||||
let value = u32::from_str_radix(&text[1..], 16).map_err(|e| e.to_string())?;
|
||||
Ok(Color32::from_rgb(
|
||||
(value >> 16) as u8,
|
||||
(value >> 8) as u8,
|
||||
value as u8,
|
||||
))
|
||||
}
|
||||
|
||||
impl ThemeColors {
|
||||
fn palette(&self) -> Result<Palette, String> {
|
||||
Ok(Palette {
|
||||
canvas: color(&self.canvas)?,
|
||||
banner: color(&self.banner)?,
|
||||
grid: color(&self.grid)?,
|
||||
layer: color(&self.layer)?,
|
||||
bg: color(&self.bg)?,
|
||||
panel: color(&self.panel)?,
|
||||
field: color(&self.field)?,
|
||||
line: color(&self.line)?,
|
||||
text: color(&self.text)?,
|
||||
muted: color(&self.muted)?,
|
||||
cyan: color(&self.cyan)?,
|
||||
amber: color(&self.amber)?,
|
||||
purple: color(&self.purple)?,
|
||||
pattern: [color(&self.pattern[0])?, color(&self.pattern[1])?],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_theme(bytes: &[u8], path: PathBuf) -> Result<ThemePack, String> {
|
||||
if bytes.len() as u64 > MAX_ARCHIVE {
|
||||
return Err("Theme pack exceeds 2 MiB".into());
|
||||
}
|
||||
let mut zip = zip::ZipArchive::new(std::io::Cursor::new(bytes)).map_err(|e| e.to_string())?;
|
||||
if zip.len() != 1 {
|
||||
return Err("Expected only manifest.json in the theme pack".into());
|
||||
}
|
||||
let mut entry = zip.by_index(0).map_err(|e| e.to_string())?;
|
||||
if entry.name() != "manifest.json"
|
||||
|| entry.is_dir()
|
||||
|| entry
|
||||
.unix_mode()
|
||||
.is_some_and(|mode| mode & 0o170000 == 0o120000)
|
||||
{
|
||||
return Err("Expected a regular manifest.json at the ZIP root".into());
|
||||
}
|
||||
let mut data = Vec::new();
|
||||
(&mut entry)
|
||||
.take(MAX_EXPANDED + 1)
|
||||
.read_to_end(&mut data)
|
||||
.map_err(|e| e.to_string())?;
|
||||
if data.len() as u64 > MAX_EXPANDED {
|
||||
return Err("Expanded theme pack exceeds 4 MiB".into());
|
||||
}
|
||||
let manifest: ThemeManifest = serde_json::from_slice(&data).map_err(|e| e.to_string())?;
|
||||
if manifest.version != 1
|
||||
|| manifest.revision == 0
|
||||
|| !valid_id(&manifest.id)
|
||||
|| manifest.themes.is_empty()
|
||||
|| manifest.themes.len() > 16
|
||||
|| manifest.notices.len() > 65_536
|
||||
|| manifest
|
||||
.notices
|
||||
.chars()
|
||||
.any(|c| c.is_control() && !matches!(c, '\n' | '\r' | '\t'))
|
||||
{
|
||||
return Err("Invalid theme-pack manifest or unsupported version".into());
|
||||
}
|
||||
let mut ids = BTreeSet::new();
|
||||
for theme in &manifest.themes {
|
||||
if !valid_id(&theme.id)
|
||||
|| !ids.insert(theme.id.clone())
|
||||
|| theme.name.trim().is_empty()
|
||||
|| theme.name.len() > 160
|
||||
|| theme.name.chars().any(char::is_control)
|
||||
{
|
||||
return Err("Invalid or duplicate theme identifier/name".into());
|
||||
}
|
||||
theme.colors.palette()?;
|
||||
}
|
||||
Ok(ThemePack {
|
||||
manifest,
|
||||
path,
|
||||
fingerprint: fingerprint(bytes),
|
||||
})
|
||||
}
|
||||
|
||||
fn zip_paths(directory: &Path) -> Result<Vec<PathBuf>, String> {
|
||||
let entries = match std::fs::read_dir(directory) {
|
||||
Ok(entries) => entries,
|
||||
Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(Vec::new()),
|
||||
Err(error) => return Err(error.to_string()),
|
||||
};
|
||||
let mut paths: Vec<_> = entries
|
||||
.filter_map(Result::ok)
|
||||
.map(|entry| entry.path())
|
||||
.filter(|path| path.extension().is_some_and(|extension| extension == "zip"))
|
||||
.collect();
|
||||
paths.sort();
|
||||
if paths.len() > MAX_PACKS {
|
||||
return Err("Too many packs (maximum 32)".into());
|
||||
}
|
||||
Ok(paths)
|
||||
}
|
||||
|
||||
pub fn load(root: &Path) -> Vec<String> {
|
||||
let mut errors = Vec::new();
|
||||
let mut languages = Vec::new();
|
||||
match zip_paths(&root.join("language-packs")) {
|
||||
Ok(paths) => {
|
||||
for path in paths {
|
||||
match bounded_read(&path).and_then(|bytes| parse_language(&bytes, path.clone())) {
|
||||
Ok(pack)
|
||||
if !languages.iter().any(|old: &LanguagePack| {
|
||||
old.manifest.id == pack.manifest.id
|
||||
|| old.manifest.languages.iter().any(|old_language| {
|
||||
pack.manifest
|
||||
.languages
|
||||
.iter()
|
||||
.any(|new| new.locale == old_language.locale)
|
||||
})
|
||||
}) =>
|
||||
{
|
||||
languages.push(pack)
|
||||
}
|
||||
Ok(_) => errors.push(format!("{}: duplicate pack or locale", path.display())),
|
||||
Err(error) => errors.push(format!("{}: {error}", path.display())),
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(error) => errors.push(error),
|
||||
}
|
||||
let mut themes = Vec::new();
|
||||
match zip_paths(&root.join("theme-packs")) {
|
||||
Ok(paths) => {
|
||||
for path in paths {
|
||||
match bounded_read(&path).and_then(|bytes| parse_theme(&bytes, path.clone())) {
|
||||
Ok(pack)
|
||||
if !themes
|
||||
.iter()
|
||||
.any(|old: &ThemePack| old.manifest.id == pack.manifest.id) =>
|
||||
{
|
||||
themes.push(pack)
|
||||
}
|
||||
Ok(_) => errors.push(format!("{}: duplicate pack identifier", path.display())),
|
||||
Err(error) => errors.push(format!("{}: {error}", path.display())),
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(error) => errors.push(error),
|
||||
}
|
||||
*LANGUAGE_PACKS.write().unwrap() = languages;
|
||||
*THEME_PACKS.write().unwrap() = themes;
|
||||
errors
|
||||
}
|
||||
|
||||
fn install_bytes(
|
||||
directory: &Path,
|
||||
id: &str,
|
||||
revision: u64,
|
||||
previous: Option<(PathBuf, u64, [u8; 32])>,
|
||||
bytes: &[u8],
|
||||
) -> Result<PathBuf, String> {
|
||||
let destination = previous
|
||||
.as_ref()
|
||||
.map(|(path, _, _)| path.clone())
|
||||
.unwrap_or_else(|| directory.join(format!("{id}.zip")));
|
||||
if let Some((_, old_revision, _)) = &previous
|
||||
&& revision <= *old_revision
|
||||
{
|
||||
return Err(format!(
|
||||
"Installed revision {old_revision} is not older than revision {revision}"
|
||||
));
|
||||
}
|
||||
if previous.is_none() && destination.exists() {
|
||||
return Err("Pack destination already exists; remove or rename it before importing".into());
|
||||
}
|
||||
if let Some((_, _, expected)) = previous
|
||||
&& fingerprint(&bounded_read(&destination)?) != expected
|
||||
{
|
||||
return Err("Installed pack changed on disk; restart before updating it".into());
|
||||
}
|
||||
if !destination.exists() && zip_paths(directory).is_ok_and(|paths| paths.len() >= MAX_PACKS) {
|
||||
return Err("Too many packs (maximum 32)".into());
|
||||
}
|
||||
crate::settings::atomic_write(&destination, bytes)?;
|
||||
Ok(destination)
|
||||
}
|
||||
|
||||
pub fn install_language(root: &Path, source: &Path) -> Result<String, String> {
|
||||
let bytes = bounded_read(source)?;
|
||||
let parsed = parse_language(&bytes, PathBuf::new())?;
|
||||
let installed = LANGUAGE_PACKS.read().unwrap().clone();
|
||||
for old in &installed {
|
||||
if old.manifest.id != parsed.manifest.id
|
||||
&& old.manifest.languages.iter().any(|old_language| {
|
||||
parsed
|
||||
.manifest
|
||||
.languages
|
||||
.iter()
|
||||
.any(|new| new.locale == old_language.locale)
|
||||
})
|
||||
{
|
||||
return Err(format!(
|
||||
"Locale belongs to installed pack {}",
|
||||
old.manifest.id
|
||||
));
|
||||
}
|
||||
}
|
||||
let previous = installed
|
||||
.iter()
|
||||
.find(|pack| pack.manifest.id == parsed.manifest.id)
|
||||
.map(|pack| (pack.path.clone(), pack.manifest.revision, pack.fingerprint));
|
||||
let directory = root.join("language-packs");
|
||||
let path = install_bytes(
|
||||
&directory,
|
||||
&parsed.manifest.id,
|
||||
parsed.manifest.revision,
|
||||
previous,
|
||||
&bytes,
|
||||
)?;
|
||||
let id = parsed.manifest.id.clone();
|
||||
let parsed = parse_language(&bytes, path)?;
|
||||
let mut packs = LANGUAGE_PACKS.write().unwrap();
|
||||
packs.retain(|pack| pack.manifest.id != id);
|
||||
packs.push(parsed);
|
||||
packs.sort_by(|a, b| a.manifest.id.cmp(&b.manifest.id));
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
pub fn install_theme(root: &Path, source: &Path) -> Result<String, String> {
|
||||
let bytes = bounded_read(source)?;
|
||||
let parsed = parse_theme(&bytes, PathBuf::new())?;
|
||||
let installed = THEME_PACKS.read().unwrap().clone();
|
||||
let previous = installed
|
||||
.iter()
|
||||
.find(|pack| pack.manifest.id == parsed.manifest.id)
|
||||
.map(|pack| (pack.path.clone(), pack.manifest.revision, pack.fingerprint));
|
||||
let directory = root.join("theme-packs");
|
||||
let path = install_bytes(
|
||||
&directory,
|
||||
&parsed.manifest.id,
|
||||
parsed.manifest.revision,
|
||||
previous,
|
||||
&bytes,
|
||||
)?;
|
||||
let id = parsed.manifest.id.clone();
|
||||
let parsed = parse_theme(&bytes, path)?;
|
||||
let mut packs = THEME_PACKS.write().unwrap();
|
||||
packs.retain(|pack| pack.manifest.id != id);
|
||||
packs.push(parsed);
|
||||
packs.sort_by(|a, b| a.manifest.id.cmp(&b.manifest.id));
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
pub fn language_packs() -> Vec<InstalledLanguagePack> {
|
||||
LANGUAGE_PACKS
|
||||
.read()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|pack| InstalledLanguagePack {
|
||||
id: pack.manifest.id.clone(),
|
||||
revision: pack.manifest.revision,
|
||||
languages: pack.manifest.languages.clone(),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn theme_packs() -> Vec<InstalledThemePack> {
|
||||
THEME_PACKS
|
||||
.read()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|pack| InstalledThemePack {
|
||||
id: pack.manifest.id.clone(),
|
||||
revision: pack.manifest.revision,
|
||||
themes: pack.manifest.themes.clone(),
|
||||
notices: pack.manifest.notices.clone(),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn translation(locale: &str, source: &str) -> Option<&'static str> {
|
||||
LANGUAGE_PACKS
|
||||
.read()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.find_map(|pack| pack.catalogs.get(locale)?.get(source).copied())
|
||||
}
|
||||
|
||||
pub fn language_name(locale: &str) -> Option<String> {
|
||||
LANGUAGE_PACKS.read().unwrap().iter().find_map(|pack| {
|
||||
pack.manifest
|
||||
.languages
|
||||
.iter()
|
||||
.find(|language| language.locale == locale)
|
||||
.map(|language| format!("{} — {}", language.native_name, language.name))
|
||||
})
|
||||
}
|
||||
|
||||
pub fn theme_choices() -> Vec<(String, String)> {
|
||||
THEME_PACKS
|
||||
.read()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.flat_map(|pack| {
|
||||
pack.manifest.themes.iter().map(|theme| {
|
||||
(
|
||||
format!("{}/{}", pack.manifest.id, theme.id),
|
||||
theme.name.clone(),
|
||||
)
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn packed_theme(choice: &str) -> Option<(Palette, bool, String)> {
|
||||
let (pack_id, theme_id) = choice.split_once('/')?;
|
||||
THEME_PACKS.read().unwrap().iter().find_map(|pack| {
|
||||
if pack.manifest.id != pack_id {
|
||||
return None;
|
||||
}
|
||||
let theme = pack
|
||||
.manifest
|
||||
.themes
|
||||
.iter()
|
||||
.find(|theme| theme.id == theme_id)?;
|
||||
Some((
|
||||
theme.colors.palette().ok()?,
|
||||
theme.light,
|
||||
theme.name.clone(),
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
pub fn pack_root(settings_path: &Path) -> Result<&Path, String> {
|
||||
settings_path
|
||||
.parent()
|
||||
.ok_or("Settings directory unavailable".into())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::io::Write;
|
||||
|
||||
fn archive(files: &[(&str, &[u8])]) -> Vec<u8> {
|
||||
let mut writer = zip::ZipWriter::new(std::io::Cursor::new(Vec::new()));
|
||||
for (name, bytes) in files {
|
||||
writer
|
||||
.start_file(*name, zip::write::SimpleFileOptions::default())
|
||||
.unwrap();
|
||||
writer.write_all(bytes).unwrap();
|
||||
}
|
||||
writer.finish().unwrap().into_inner()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn example_packs_install_load_and_resolve() {
|
||||
let temp = tempfile::tempdir().unwrap();
|
||||
let language = temp.path().join("language.zip");
|
||||
let theme = temp.path().join("theme.zip");
|
||||
std::fs::write(
|
||||
&language,
|
||||
include_bytes!("../../../docs/packs/deckstride-language-pack.zip"),
|
||||
)
|
||||
.unwrap();
|
||||
std::fs::write(
|
||||
&theme,
|
||||
include_bytes!("../../../docs/packs/deckstride-theme-pack.zip"),
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
install_language(temp.path(), &language).unwrap(),
|
||||
"example-language"
|
||||
);
|
||||
assert_eq!(translation("eo-example", "Close"), Some("Fermi"));
|
||||
assert_eq!(install_theme(temp.path(), &theme).unwrap(), "example-theme");
|
||||
assert!(packed_theme("example-theme/night").is_some());
|
||||
assert!(load(temp.path()).is_empty());
|
||||
assert_eq!(language_packs()[0].revision, 1);
|
||||
assert_eq!(theme_packs()[0].revision, 1);
|
||||
let ctx = egui::Context::default();
|
||||
crate::localization::apply_selected(
|
||||
&ctx,
|
||||
&crate::localization::Language::En,
|
||||
Some("eo-example"),
|
||||
);
|
||||
assert_eq!(crate::localization::tr(&ctx, "Close"), "Fermi");
|
||||
crate::theme::apply_selected(
|
||||
&ctx,
|
||||
crate::theme::Theme::Midra,
|
||||
Some("example-theme/night"),
|
||||
);
|
||||
assert_eq!(
|
||||
ctx.global_style().visuals.panel_fill,
|
||||
color("#101820").unwrap()
|
||||
);
|
||||
let mut manifest: serde_json::Value = serde_json::from_str(include_str!(
|
||||
"../../../docs/packs/language-example/manifest.json"
|
||||
))
|
||||
.unwrap();
|
||||
manifest["revision"] = 2.into();
|
||||
let updated = archive(&[
|
||||
("manifest.json", &serde_json::to_vec(&manifest).unwrap()),
|
||||
(
|
||||
"eo-example.json",
|
||||
include_bytes!("../../../docs/packs/language-example/eo-example.json"),
|
||||
),
|
||||
]);
|
||||
std::fs::write(
|
||||
temp.path().join("language-packs/example-language.zip"),
|
||||
b"changed",
|
||||
)
|
||||
.unwrap();
|
||||
std::fs::write(&language, updated).unwrap();
|
||||
assert!(
|
||||
install_language(temp.path(), &language)
|
||||
.unwrap_err()
|
||||
.contains("changed on disk")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn malformed_and_traversing_archives_are_rejected() {
|
||||
let bad = archive(&[("../manifest.json", b"{}")]);
|
||||
assert!(parse_language(&bad, PathBuf::new()).is_err());
|
||||
assert!(parse_theme(&bad, PathBuf::new()).is_err());
|
||||
}
|
||||
}
|
||||
|
|
@ -2415,31 +2415,133 @@ fn appearance_preferences(ui: &mut Ui, s: &mut Studio) {
|
|||
.show(ui, |ui| {
|
||||
ui.label(tr(&locale, "Theme"));
|
||||
egui::ComboBox::from_id_salt("preferences-theme")
|
||||
.selected_text(s.settings.theme.name())
|
||||
.selected_text(match s.settings.theme_pack.as_deref() {
|
||||
Some(choice) => crate::packs::packed_theme(choice)
|
||||
.map_or_else(|| format!("{choice} (unavailable)"), |(_, _, name)| name),
|
||||
None => s.settings.theme.name().to_owned(),
|
||||
})
|
||||
.show_ui(ui, |ui| {
|
||||
for theme in crate::theme::Theme::ALL {
|
||||
changed |= ui
|
||||
.selectable_value(&mut s.settings.theme, theme, theme.name())
|
||||
.changed();
|
||||
if ui
|
||||
.selectable_label(
|
||||
s.settings.theme_pack.is_none() && s.settings.theme == theme,
|
||||
theme.name(),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.settings.theme = theme;
|
||||
s.settings.theme_pack = None;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
let packed = crate::packs::theme_choices();
|
||||
if !packed.is_empty() {
|
||||
ui.separator();
|
||||
}
|
||||
for (choice, name) in packed {
|
||||
if ui
|
||||
.selectable_label(
|
||||
s.settings.theme_pack.as_deref() == Some(choice.as_str()),
|
||||
name,
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.settings.theme_pack = Some(choice);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.end_row();
|
||||
ui.label(tr(&locale, "Language"));
|
||||
egui::ComboBox::from_id_salt("preferences-language")
|
||||
.selected_text(s.settings.language.name())
|
||||
.selected_text(match s.settings.language_pack.as_deref() {
|
||||
Some(locale) => crate::packs::language_name(locale)
|
||||
.unwrap_or_else(|| format!("{locale} (unavailable)")),
|
||||
None => s.settings.language.name().to_owned(),
|
||||
})
|
||||
.show_ui(ui, |ui| {
|
||||
for language in crate::localization::Language::ALL {
|
||||
changed |= ui
|
||||
.selectable_value(
|
||||
&mut s.settings.language,
|
||||
language,
|
||||
if ui
|
||||
.selectable_label(
|
||||
s.settings.language_pack.is_none()
|
||||
&& s.settings.language == language,
|
||||
language.name(),
|
||||
)
|
||||
.changed();
|
||||
.clicked()
|
||||
{
|
||||
s.settings.language = language;
|
||||
s.settings.language_pack = None;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
let packed: Vec<_> = crate::packs::language_packs()
|
||||
.into_iter()
|
||||
.flat_map(|pack| pack.languages)
|
||||
.collect();
|
||||
if !packed.is_empty() {
|
||||
ui.separator();
|
||||
}
|
||||
for language in packed {
|
||||
let name = format!("{} — {}", language.native_name, language.name);
|
||||
if ui
|
||||
.selectable_label(
|
||||
s.settings.language_pack.as_deref()
|
||||
== Some(language.locale.as_str()),
|
||||
name,
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.settings.language_pack = Some(language.locale);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.end_row();
|
||||
});
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
if ui
|
||||
.add_enabled(
|
||||
s.initialized && !s.dialog_busy,
|
||||
egui::Button::new(tr(&locale, "Import language pack…")),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.actions.push(Action::PickLanguagePack);
|
||||
}
|
||||
if ui
|
||||
.add_enabled(
|
||||
s.initialized && !s.dialog_busy,
|
||||
egui::Button::new(tr(&locale, "Import theme pack…")),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.actions.push(Action::PickThemePack);
|
||||
}
|
||||
});
|
||||
let language_packs = crate::packs::language_packs();
|
||||
let theme_packs = crate::packs::theme_packs();
|
||||
if !language_packs.is_empty() || !theme_packs.is_empty() {
|
||||
egui::CollapsingHeader::new(tr(&locale, "Installed packs"))
|
||||
.id_salt("installed-appearance-packs")
|
||||
.show(ui, |ui| {
|
||||
for pack in language_packs {
|
||||
ui.label(format!(
|
||||
"{} · r{} · {} language(s)",
|
||||
pack.id,
|
||||
pack.revision,
|
||||
pack.languages.len()
|
||||
));
|
||||
}
|
||||
for pack in theme_packs {
|
||||
ui.label(format!(
|
||||
"{} · r{} · {} theme(s)",
|
||||
pack.id,
|
||||
pack.revision,
|
||||
pack.themes.len()
|
||||
));
|
||||
}
|
||||
});
|
||||
}
|
||||
ui.separator();
|
||||
for (label, color) in [
|
||||
(
|
||||
|
|
@ -2463,6 +2565,16 @@ fn appearance_preferences(ui: &mut Ui, s: &mut Studio) {
|
|||
if changed {
|
||||
s.new_output = true;
|
||||
s.save_preferences();
|
||||
crate::theme::apply_selected(
|
||||
&locale,
|
||||
s.settings.theme,
|
||||
s.settings.theme_pack.as_deref(),
|
||||
);
|
||||
crate::localization::apply_selected(
|
||||
&locale,
|
||||
&s.settings.language,
|
||||
s.settings.language_pack.as_deref(),
|
||||
);
|
||||
ui.ctx().request_repaint();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -286,7 +286,9 @@ pub struct Settings {
|
|||
pub zoom_enabled: bool,
|
||||
pub zoom_keep_fitted_area: bool,
|
||||
pub theme: crate::theme::Theme,
|
||||
pub theme_pack: Option<String>,
|
||||
pub language: crate::localization::Language,
|
||||
pub language_pack: Option<String>,
|
||||
}
|
||||
/// Choose a per-process decoded-frame budget from available physical RAM.
|
||||
/// Prefer 15%, with a soft 512 MiB floor that never exceeds 20% (except the
|
||||
|
|
@ -337,7 +339,9 @@ impl Default for Settings {
|
|||
zoom_enabled: false,
|
||||
zoom_keep_fitted_area: false,
|
||||
theme: Default::default(),
|
||||
theme_pack: None,
|
||||
language: Default::default(),
|
||||
language_pack: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -346,6 +350,17 @@ impl Settings {
|
|||
if self.version != 1 {
|
||||
return Err(format!("Unsupported settings version {}", self.version));
|
||||
}
|
||||
if self
|
||||
.theme_pack
|
||||
.as_deref()
|
||||
.is_some_and(|choice| !crate::packs::valid_theme_choice(choice))
|
||||
|| self
|
||||
.language_pack
|
||||
.as_deref()
|
||||
.is_some_and(|locale| !crate::packs::valid_id(locale))
|
||||
{
|
||||
return Err("Invalid language or theme pack choice".into());
|
||||
}
|
||||
self.disk_cache.validate()?;
|
||||
if !(64..=16384).contains(&self.buffer_mib) {
|
||||
return Err("RAM buffer must be 64–16384 MiB per process".into());
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ pub enum Action {
|
|||
Pick(bool),
|
||||
PickNotes,
|
||||
PickBlankPicture,
|
||||
PickLanguagePack,
|
||||
PickThemePack,
|
||||
SetBlankPicture(PathBuf),
|
||||
ClearBlankPicture,
|
||||
#[cfg(target_os = "windows")]
|
||||
|
|
@ -221,6 +223,14 @@ impl Studio {
|
|||
settings_path = dir.path().join("settings.toml");
|
||||
cache_path = dir.path().join("cache");
|
||||
}
|
||||
let pack_errors = if smoke {
|
||||
Vec::new()
|
||||
} else {
|
||||
settings_path
|
||||
.parent()
|
||||
.map(crate::packs::load)
|
||||
.unwrap_or_else(|| vec!["Settings directory unavailable for packs".into()])
|
||||
};
|
||||
let io = Bridge::with_program(Duration::from_secs(10), worker_program.clone());
|
||||
io.submit(0, 0, Request::LoadSettings(settings_path.clone()));
|
||||
Self {
|
||||
|
|
@ -247,7 +257,14 @@ impl Studio {
|
|||
blank_picture: None,
|
||||
blank_busy: false,
|
||||
blank_loader: Bridge::with_program(Duration::from_secs(15), worker_program.clone()),
|
||||
status: "Ready — open a PDF or picture folder, or drop it here.".into(),
|
||||
status: if pack_errors.is_empty() {
|
||||
"Ready — open a PDF or picture folder, or drop it here.".into()
|
||||
} else {
|
||||
format!(
|
||||
"Some language/theme packs were skipped: {}",
|
||||
pack_errors.join("; ")
|
||||
)
|
||||
},
|
||||
awake_status: "Sleep protection starting…".into(),
|
||||
generation: 0,
|
||||
frames: HashMap::new(),
|
||||
|
|
@ -631,6 +648,25 @@ impl Studio {
|
|||
self.status = "Choose a TXT or Markdown notes file.".into();
|
||||
}
|
||||
}
|
||||
pack_action @ (Action::PickLanguagePack | Action::PickThemePack) => {
|
||||
if self.initialized && !self.dialog_busy {
|
||||
let language = matches!(pack_action, Action::PickLanguagePack);
|
||||
self.dialog_busy = self.dialog.submit(
|
||||
0,
|
||||
if language { 3 } else { 4 },
|
||||
Request::PickPack {
|
||||
language,
|
||||
owner: self.dialog_owner,
|
||||
},
|
||||
);
|
||||
self.status = if language {
|
||||
"Choose a Deckstride language-pack ZIP."
|
||||
} else {
|
||||
"Choose a Deckstride theme-pack ZIP."
|
||||
}
|
||||
.into();
|
||||
}
|
||||
}
|
||||
Action::ImportNotes(import) => {
|
||||
if self.loading
|
||||
|| self.notes_editor.is_some()
|
||||
|
|
@ -1313,6 +1349,19 @@ impl Studio {
|
|||
if let Some(path) = p.reply.picked {
|
||||
if c.tag == 2 {
|
||||
self.execute(Action::SetBlankPicture(path));
|
||||
} else if c.tag == 3 || c.tag == 4 {
|
||||
let result =
|
||||
crate::packs::pack_root(&self.settings_path).and_then(|root| {
|
||||
if c.tag == 3 {
|
||||
crate::packs::install_language(root, &path)
|
||||
.map(|id| format!("Installed language pack {id}."))
|
||||
} else {
|
||||
crate::packs::install_theme(root, &path)
|
||||
.map(|id| format!("Installed theme pack {id}."))
|
||||
}
|
||||
});
|
||||
self.status = result
|
||||
.unwrap_or_else(|error| format!("Could not install pack: {error}"));
|
||||
} else if c.tag == 1 {
|
||||
if c.generation == self.generation {
|
||||
self.execute(Action::ImportNotes(path));
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@ pub struct Palette {
|
|||
pub purple: Color32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
enum AppliedTheme {
|
||||
Builtin(Theme),
|
||||
Pack(String),
|
||||
}
|
||||
|
||||
impl Theme {
|
||||
pub const ALL: [Self; 20] = [
|
||||
Self::Midra,
|
||||
|
|
@ -276,54 +282,78 @@ impl Theme {
|
|||
}
|
||||
}
|
||||
pub fn apply(&self, ctx: &egui::Context) {
|
||||
let applied = egui::Id::new("deckstride-theme");
|
||||
if ctx.data(|data| data.get_temp::<Self>(applied)) == Some(*self) {
|
||||
return;
|
||||
}
|
||||
let p = self.palette();
|
||||
let mut v = if self.is_light() {
|
||||
egui::Visuals::light()
|
||||
} else {
|
||||
egui::Visuals::dark()
|
||||
};
|
||||
v.override_text_color = Some(p.text);
|
||||
v.panel_fill = p.bg;
|
||||
v.window_fill = p.panel;
|
||||
v.extreme_bg_color = p.field;
|
||||
v.faint_bg_color = p.bg;
|
||||
v.hyperlink_color = p.cyan;
|
||||
v.warn_fg_color = p.amber;
|
||||
v.error_fg_color = if self.is_light() {
|
||||
Color32::from_rgb(165, 30, 40)
|
||||
} else {
|
||||
Color32::LIGHT_RED
|
||||
};
|
||||
v.window_stroke = egui::Stroke::new(1_f32, p.line);
|
||||
v.selection.bg_fill = p.purple;
|
||||
v.selection.stroke.color = p.text;
|
||||
for (w, fill) in [
|
||||
(&mut v.widgets.noninteractive, p.panel),
|
||||
(&mut v.widgets.inactive, p.field),
|
||||
(&mut v.widgets.hovered, p.panel.lerp_to_gamma(p.text, 0.08)),
|
||||
(&mut v.widgets.active, p.purple),
|
||||
(&mut v.widgets.open, p.panel),
|
||||
] {
|
||||
w.bg_fill = fill;
|
||||
w.weak_bg_fill = fill;
|
||||
w.bg_stroke = egui::Stroke::new(
|
||||
if *self == Self::HighContrast {
|
||||
2_f32
|
||||
} else {
|
||||
1_f32
|
||||
},
|
||||
p.line,
|
||||
);
|
||||
w.fg_stroke = egui::Stroke::new(1_f32, p.text);
|
||||
}
|
||||
ctx.set_visuals(v);
|
||||
ctx.data_mut(|data| data.insert_temp(applied, *self));
|
||||
apply_palette(
|
||||
ctx,
|
||||
AppliedTheme::Builtin(*self),
|
||||
self.palette(),
|
||||
self.is_light(),
|
||||
*self == Self::HighContrast,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn apply_selected(ctx: &egui::Context, builtin: Theme, packed: Option<&str>) {
|
||||
if let Some(choice) = packed
|
||||
&& let Some((palette, light, _)) = crate::packs::packed_theme(choice)
|
||||
{
|
||||
apply_palette(
|
||||
ctx,
|
||||
AppliedTheme::Pack(choice.to_owned()),
|
||||
palette,
|
||||
light,
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
builtin.apply(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
fn apply_palette(
|
||||
ctx: &egui::Context,
|
||||
choice: AppliedTheme,
|
||||
p: Palette,
|
||||
light: bool,
|
||||
high_contrast: bool,
|
||||
) {
|
||||
let applied = egui::Id::new("deckstride-theme");
|
||||
if ctx.data(|data| data.get_temp::<AppliedTheme>(applied)) == Some(choice.clone()) {
|
||||
return;
|
||||
}
|
||||
let mut v = if light {
|
||||
egui::Visuals::light()
|
||||
} else {
|
||||
egui::Visuals::dark()
|
||||
};
|
||||
v.override_text_color = Some(p.text);
|
||||
v.panel_fill = p.bg;
|
||||
v.window_fill = p.panel;
|
||||
v.extreme_bg_color = p.field;
|
||||
v.faint_bg_color = p.bg;
|
||||
v.hyperlink_color = p.cyan;
|
||||
v.warn_fg_color = p.amber;
|
||||
v.error_fg_color = if light {
|
||||
Color32::from_rgb(165, 30, 40)
|
||||
} else {
|
||||
Color32::LIGHT_RED
|
||||
};
|
||||
v.window_stroke = egui::Stroke::new(1_f32, p.line);
|
||||
v.selection.bg_fill = p.purple;
|
||||
v.selection.stroke.color = p.text;
|
||||
for (w, fill) in [
|
||||
(&mut v.widgets.noninteractive, p.panel),
|
||||
(&mut v.widgets.inactive, p.field),
|
||||
(&mut v.widgets.hovered, p.panel.lerp_to_gamma(p.text, 0.08)),
|
||||
(&mut v.widgets.active, p.purple),
|
||||
(&mut v.widgets.open, p.panel),
|
||||
] {
|
||||
w.bg_fill = fill;
|
||||
w.weak_bg_fill = fill;
|
||||
w.bg_stroke = egui::Stroke::new(if high_contrast { 2_f32 } else { 1_f32 }, p.line);
|
||||
w.fg_stroke = egui::Stroke::new(1_f32, p.text);
|
||||
}
|
||||
ctx.set_visuals(v);
|
||||
ctx.data_mut(|data| data.insert_temp(applied, choice));
|
||||
}
|
||||
fn sotv_palette(colors: [u32; 8], light: bool) -> Palette {
|
||||
let [bg, panel, field, layer, text, subtle, accent, line] =
|
||||
colors.map(|hex| Color32::from_rgb((hex >> 16) as u8, (hex >> 8) as u8, hex as u8));
|
||||
|
|
|
|||
|
|
@ -56,6 +56,10 @@ pub enum Request {
|
|||
PickNotes {
|
||||
owner: Option<isize>,
|
||||
},
|
||||
PickPack {
|
||||
language: bool,
|
||||
owner: Option<isize>,
|
||||
},
|
||||
PrepareNotes {
|
||||
path: PathBuf,
|
||||
cache: PathBuf,
|
||||
|
|
@ -277,6 +281,23 @@ pub fn run() -> Result<(), String> {
|
|||
.add_filter("Notes (TXT, Markdown)", &["txt", "md"])
|
||||
.pick_file();
|
||||
}
|
||||
Request::PickPack { language, owner } => {
|
||||
reply.picked = picker_dialog(owner)?
|
||||
.set_title(if language {
|
||||
"Import language pack"
|
||||
} else {
|
||||
"Import theme pack"
|
||||
})
|
||||
.add_filter(
|
||||
if language {
|
||||
"Language pack"
|
||||
} else {
|
||||
"Theme pack"
|
||||
},
|
||||
&["zip"],
|
||||
)
|
||||
.pick_file();
|
||||
}
|
||||
Request::PrepareNotes {
|
||||
path,
|
||||
cache,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ fn settings_roundtrip_preserves_project_overrides_and_hidden_bars() {
|
|||
settings.buffer_mib = 2048;
|
||||
settings.auto_show = false;
|
||||
settings.theme = deckstride::theme::Theme::CorporateLight;
|
||||
settings.theme_pack = Some("example-theme/night".into());
|
||||
settings.language = deckstride::localization::Language::Fr;
|
||||
settings.language_pack = Some("eo-example".into());
|
||||
let mut project = Layout::default();
|
||||
project.previous.show = true; // Explicit opt-in survives saving and loading.
|
||||
project.current.show = false;
|
||||
|
|
@ -46,7 +48,9 @@ fn settings_roundtrip_preserves_project_overrides_and_hidden_bars() {
|
|||
assert_eq!(loaded.buffer_mib, 2048);
|
||||
assert!(!loaded.auto_show);
|
||||
assert_eq!(loaded.theme, settings.theme);
|
||||
assert_eq!(loaded.theme_pack, settings.theme_pack);
|
||||
assert_eq!(loaded.language, settings.language);
|
||||
assert_eq!(loaded.language_pack, settings.language_pack);
|
||||
let bytes = std::fs::read(&path).unwrap();
|
||||
settings.version = 2;
|
||||
assert!(settings::write(&path, &settings).is_err());
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
### 0.1.101
|
||||
|
||||
- Import bounded, data-only language and theme ZIP packs from Preferences. Packs use
|
||||
Canvas Pilot-compatible manifests, persist beside settings, load offline at startup
|
||||
and appear in the existing selectors without restarting.
|
||||
- Add editable example packs, ready-to-import ZIPs and pack-format documentation.
|
||||
|
||||
### 0.1.100
|
||||
|
||||
- Keep the Preferences window size stable while the pointer moves by removing a
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
# Deckstride language and theme packs
|
||||
|
||||
Install either example from **Preferences → General → Appearance**. Packs remain
|
||||
ZIP files and are copied into Deckstride's configuration directory; they contain
|
||||
data only and are never extracted or executed.
|
||||
|
||||
## Language pack
|
||||
|
||||
`deckstride-language-pack.zip` uses the same version-2 manifest shape as Canvas
|
||||
Pilot: `manifest.json` and one root `<locale>.json` per language. Catalog keys are
|
||||
Deckstride's exact visible English source strings, and missing keys fall back to
|
||||
English. A pack may contain 1–16 languages. Pack/locale IDs use lowercase ASCII
|
||||
letters, digits and hyphens. Increase the positive `revision` to publish an update.
|
||||
|
||||
Limits: 2 MiB ZIP, 4 MiB expanded data, 32 installed packs, 4,096 messages per
|
||||
catalog, and no paths, directories, symlinks or unexpected files.
|
||||
|
||||
## Theme pack
|
||||
|
||||
`deckstride-theme-pack.zip` is a Canvas Pilot format-1 theme pack containing one
|
||||
root `manifest.json`. It can contain 1–16 complete themes. Colors are opaque
|
||||
`#RRGGBB` values using the shared Canvas Pilot roles. `light` selects egui's light
|
||||
or dark base behavior. Keep license and attribution text in `notices`.
|
||||
|
||||
Limits: 2 MiB ZIP, 4 MiB manifest, 32 installed packs, and no executable content.
|
||||
|
||||
Higher revisions replace an installed pack with the same ID. Equal or older
|
||||
revisions are rejected, preventing accidental downgrades. Invalid packs are skipped
|
||||
at startup and reported in the Presenter status line.
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"Preferences": "Agordoj",
|
||||
"General": "Ĝenerala",
|
||||
"Performance": "Rendimento",
|
||||
"Storage": "Konservejo",
|
||||
"Theme": "Etoso",
|
||||
"Language": "Lingvo",
|
||||
"Close": "Fermi",
|
||||
"Menu": "Menuo",
|
||||
"Presenter": "Prezentanto",
|
||||
"Slides": "Lumbildoj",
|
||||
"Previous": "Antaŭa",
|
||||
"Next": "Sekva",
|
||||
"Show slides": "Montri lumbildojn",
|
||||
"Blank slides": "Kaŝi lumbildojn"
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"version": 2,
|
||||
"id": "example-language",
|
||||
"revision": 1,
|
||||
"languages": [
|
||||
{
|
||||
"locale": "eo-example",
|
||||
"name": "Example Esperanto",
|
||||
"native_name": "Ekzempla Esperanto"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"version": 1,
|
||||
"id": "example-theme",
|
||||
"revision": 1,
|
||||
"themes": [
|
||||
{
|
||||
"id": "night",
|
||||
"name": "Example Night",
|
||||
"light": false,
|
||||
"colors": {
|
||||
"canvas": "#15202b",
|
||||
"banner": "#203040",
|
||||
"grid": "#3e5870",
|
||||
"layer": "#26394a",
|
||||
"pattern": ["#24384a", "#182634"],
|
||||
"bg": "#101820",
|
||||
"panel": "#192733",
|
||||
"field": "#0d151c",
|
||||
"line": "#42627d",
|
||||
"text": "#eef7ff",
|
||||
"muted": "#aec7d9",
|
||||
"cyan": "#65d9ef",
|
||||
"amber": "#f0c674",
|
||||
"purple": "#554b9a"
|
||||
}
|
||||
}
|
||||
],
|
||||
"notices": "Original example palette for Deckstride. CC0-1.0; attribution is not required."
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ folder in a permanent location and run `python3 install-linux-launcher.py` there
|
|||
Python is only needed for this optional installer; no administrator privileges
|
||||
are required.
|
||||
|
||||
On Windows, use **Menu → Preferences… → Set as default PDF app…** to register the
|
||||
On Windows, use **Menu → Preferences… → General → Set as default PDF app…** to register the
|
||||
portable executable for the current user. Windows opens
|
||||
Default Apps for the required confirmation. Once Deckstride is selected for
|
||||
`.pdf`, Explorer uses the icon embedded in `deckstride.exe` for PDF files. Keep
|
||||
|
|
@ -27,7 +27,7 @@ To update, close Deckstride, download and extract the new portable release,
|
|||
and run its executable. Settings and saved layouts live in your user configuration
|
||||
directory, outside the extracted folder. If you installed the Linux launcher, rerun
|
||||
its installer from the new location so it points to the updated binary.
|
||||
**Menu → Preferences… → Storage and preparation** shows the full path of the
|
||||
**Menu → Preferences… → Storage** shows the full path of the
|
||||
currently running executable, so you can find its portable folder when updating or
|
||||
removing the application.
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ fit; separate copies for every smaller resolution would waste RAM. The current
|
|||
renderer limit is 4096 pixels per side, shown in the Preferences window. Resolution changes start a
|
||||
new preparation pass with a new buffer identity.
|
||||
|
||||
Processed frames are kept in the application's persistent cache; **Menu → Preferences… → Storage and preparation** shows its
|
||||
Processed frames are kept in the application's persistent cache; **Menu → Preferences… → Storage** shows its
|
||||
location. Reopening with unchanged source contents, resolution and renderer reuses
|
||||
those frames without PDF rasterization or image decoding. It still verifies source
|
||||
identity/checksums and reads frames into RAM: a restart cannot literally take zero
|
||||
|
|
@ -243,7 +243,7 @@ Navigation then performs no application slide-file reads, PDF rendering or image
|
|||
decoding. Raster composition still happens, and the OS can page memory under pressure.
|
||||
The entire deck stays resident when it fits the configured RAM budget.
|
||||
|
||||
**Menu → Preferences… → Memory and cache** controls the decoded-slide allowance for **each process**, default
|
||||
**Menu → Preferences… → Performance** controls the decoded-slide allowance for **each process**, default
|
||||
15% of available RAM, with a soft 512 MiB minimum that yields when it would
|
||||
exceed 20% of available RAM. The adjustable range is 64–16384 MiB. Saved budgets
|
||||
are preserved; the automatic default is chosen when no budget has been saved. Presenter and output can each consume
|
||||
|
|
@ -300,18 +300,26 @@ The numbered screen rectangles in **Displays** reflect each monitor’s pixel as
|
|||
ratio, so portrait, standard and ultrawide displays are easier to distinguish.
|
||||
They represent proportions, not physical screen size.
|
||||
|
||||
Menu → Appearance → Theme offers the same 20 built-in palettes as Canvas Pilot,
|
||||
including light, dark and High Contrast. Menu → Appearance → Language offers System,
|
||||
English, French, Spanish, Japanese, Simplified Chinese, German and Brazilian
|
||||
**Preferences → General → Appearance** offers the same 20 built-in palettes as
|
||||
Canvas Pilot, including light, dark and High Contrast. Its Language selector offers
|
||||
System, English, French, Spanish, Japanese, Simplified Chinese, German and Brazilian
|
||||
Portuguese. System uses the native OS locale when it matches one of these choices and
|
||||
otherwise falls back to English. Traditional Chinese is not silently treated as
|
||||
Simplified Chinese. Choices are saved globally and apply to all presenter/browser
|
||||
windows; slides are never recolored.
|
||||
|
||||
Translations are built into the executable and need no runtime file reads. Japanese
|
||||
and Chinese use the bundled Noto Sans CJK font, loaded only when one of those languages
|
||||
is active. Theme styles and language fonts are rebuilt only when their selection
|
||||
changes. Detailed worker and operating-system diagnostics remain verbatim.
|
||||
Choose **Import language pack…** or **Import theme pack…** in the same section to
|
||||
install a bounded ZIP. Installed languages and themes join the selectors immediately
|
||||
and load offline on later starts. Higher revisions update a pack; equal or older
|
||||
revisions are rejected. The ZIP is copied beside settings and is never extracted or
|
||||
executed. The [pack guide](packs/README.md) includes editable sources and
|
||||
ready-to-import examples.
|
||||
|
||||
Built-in translations need no runtime file reads; imported catalogs are read once at
|
||||
startup and retained in memory. Japanese and Chinese use the bundled Noto Sans CJK
|
||||
font, loaded only when one of those built-in languages is active. Theme styles and
|
||||
language fonts are rebuilt only when their selection changes. Detailed worker and
|
||||
operating-system diagnostics remain verbatim.
|
||||
|
||||
All slides opens a windowed browser above fullscreen windows and requests focus.
|
||||
Opening it again restores/focuses the existing browser. Its Close button dismisses it; Escape requests application quit confirmation.
|
||||
|
|
@ -467,7 +475,7 @@ output. It cannot predict compositor/hardware delays or guarantee a frame rate.
|
|||
|
||||
### Disk cache cleanup
|
||||
|
||||
In **Menu → Preferences… → Memory and cache**, set the maximum total size in MiB and
|
||||
In **Menu → Preferences… → Performance**, set the maximum total size in MiB and
|
||||
lifetime in days since rendering (defaults: 10 GiB and 30 days). Automatic cleanup runs once at startup, after initial document loading and slide
|
||||
preparation complete, deleting expired files and then the oldest files to meet the
|
||||
size target. Changing limits takes effect at the next startup; manual expunge remains
|
||||
|
|
@ -477,7 +485,7 @@ background. Active decks are protected and may temporarily exceed either limit.
|
|||
The cleanup report shows removed and remaining data; deleted slides regenerate
|
||||
when reopened. Source documents and presenter notes are preserved.
|
||||
|
||||
Choose **Menu → Preferences… → Blank Slides image → Choose picture…** to replace the
|
||||
Choose **Menu → Preferences… → General → Blank Slides image → Choose picture…** to replace the
|
||||
black blanking screen with your own picture on every Slides screen. The app
|
||||
saves a copy, fits the whole image against black, and remembers it across restarts.
|
||||
The original may then be moved or removed. Use **Use solid black** to reset.
|
||||
|
|
|
|||
Loading…
Reference in New Issue