Move advanced settings into Preferences window
This commit is contained in:
parent
3711db148c
commit
0b470ea626
|
|
@ -64,7 +64,7 @@ Prepared slides are cached for reuse. The presenter shows loading progress, RAM
|
|||
and an ETA when available; decks larger than the RAM budget use a rolling buffer.
|
||||
Notes can come from the PDF or picture-folder sidecars. Themes and English/French
|
||||
controls are available in Menu. Optional shared slide zoom is available under
|
||||
**Menu → Preferences → Enable page zoom**; scroll to zoom, drag to pan, double-click
|
||||
**Menu → Enable page zoom**; scroll to zoom, drag to pan, double-click
|
||||
to reset on the current preview or Slides screen.
|
||||
|
||||
## Import your notes
|
||||
|
|
|
|||
|
|
@ -91,6 +91,10 @@ pub fn tr<'a>(ctx: &egui::Context, text: &'a str) -> &'a str {
|
|||
}
|
||||
"Appearance" => "Apparence",
|
||||
"Preferences" => "Préférences",
|
||||
"Preferences…" => "Préférences…",
|
||||
"Quick settings" => "Réglages rapides",
|
||||
"Memory and cache" => "Mémoire et cache",
|
||||
"Storage and preparation" => "Stockage et préparation",
|
||||
"Storage locations" => "Emplacements de stockage",
|
||||
"Preparing slide…" => "Préparation de la diapositive…",
|
||||
"Slide ready" => "Diapositive prête",
|
||||
|
|
|
|||
|
|
@ -830,6 +830,7 @@ pub fn presenter(ui: &mut Ui, s: &mut Studio, native: &mut UiState) {
|
|||
layout: s.layout.clone(),
|
||||
layout_open: s.layout_open,
|
||||
layout_target: None,
|
||||
preferences_open: s.preferences_open,
|
||||
menu_open: s.menu_open,
|
||||
};
|
||||
presenter_view(ui, s, native, &mut view, None);
|
||||
|
|
@ -838,6 +839,7 @@ pub fn presenter(ui: &mut Ui, s: &mut Studio, native: &mut UiState) {
|
|||
view.layout.timer_autostart = s.layout.timer_autostart;
|
||||
s.layout = view.layout;
|
||||
s.layout_open = view.layout_open;
|
||||
s.preferences_open = view.preferences_open;
|
||||
s.menu_open = view.menu_open;
|
||||
}
|
||||
/// A native presenter always edits and renders the layout of its own monitor.
|
||||
|
|
@ -1235,7 +1237,7 @@ fn presenter_view(
|
|||
(screen.bottom() - trigger.rect.bottom() - 16.)
|
||||
.clamp(80., 720.),
|
||||
)
|
||||
.show(ui, |ui| menu(ui, s));
|
||||
.show(ui, |ui| menu(ui, s, &mut view.preferences_open));
|
||||
});
|
||||
view.menu_open = menu_open;
|
||||
ui.add_sized(
|
||||
|
|
@ -1723,6 +1725,9 @@ fn presenter_view(
|
|||
.insert(rendered_layout_display.unwrap(), remote_view);
|
||||
}
|
||||
}
|
||||
if view.preferences_open {
|
||||
preferences_window(&ctx, s, &mut view.preferences_open);
|
||||
}
|
||||
if s.displays_open {
|
||||
let mut open = true;
|
||||
egui::Window::new(tr(&locale, "Displays"))
|
||||
|
|
@ -2367,7 +2372,208 @@ pub fn browser(ui: &mut Ui, s: &mut Studio, native: &mut UiState) {
|
|||
}
|
||||
}
|
||||
|
||||
fn menu(ui: &mut Ui, s: &mut Studio) {
|
||||
fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
|
||||
let locale = ctx.clone();
|
||||
let mut window_open = true;
|
||||
let mut close_requested = false;
|
||||
let screen = ctx.content_rect().size();
|
||||
egui::Window::new(tr(&locale, "Preferences"))
|
||||
.id(egui::Id::new("preferences-window"))
|
||||
.open(&mut window_open)
|
||||
.collapsible(false)
|
||||
.resizable(true)
|
||||
.default_size(Vec2::new(620., 640.).min(screen - Vec2::splat(32.)))
|
||||
.min_size(Vec2::new(360., 320.))
|
||||
.max_size((screen - Vec2::splat(24.)).max(Vec2::splat(1.)))
|
||||
.show(ctx, |ui| {
|
||||
ui.spacing_mut().item_spacing = Vec2::new(8., 8.);
|
||||
let scroll_height = (ui.available_height() - 52.).max(180.);
|
||||
egui::ScrollArea::vertical()
|
||||
.id_salt("preferences-scroll")
|
||||
.auto_shrink([false, false])
|
||||
.max_height(scroll_height)
|
||||
.show(ui, |ui| {
|
||||
layout_section(
|
||||
ui,
|
||||
if s.settings.language.french() {
|
||||
"Image des diapositives masquées"
|
||||
} else {
|
||||
"Blank Slides image"
|
||||
},
|
||||
|ui| {
|
||||
ui.label(if s.settings.blank_picture {
|
||||
if s.settings.language.french() {
|
||||
"Image personnalisée sélectionnée"
|
||||
} else {
|
||||
"Custom picture selected"
|
||||
}
|
||||
} else if s.settings.language.french() {
|
||||
"Écran noir"
|
||||
} else {
|
||||
"Solid black"
|
||||
});
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
if ui
|
||||
.add_enabled(
|
||||
s.initialized && !s.dialog_busy && !s.blank_busy,
|
||||
egui::Button::new(if s.settings.language.french() {
|
||||
"Choisir une image…"
|
||||
} else {
|
||||
"Choose picture…"
|
||||
}),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.actions.push(Action::PickBlankPicture);
|
||||
}
|
||||
if ui
|
||||
.add_enabled(
|
||||
s.initialized
|
||||
&& !s.dialog_busy
|
||||
&& (s.settings.blank_picture || s.blank_busy),
|
||||
egui::Button::new(if s.settings.language.french() {
|
||||
"Utiliser un écran noir"
|
||||
} else {
|
||||
"Use solid black"
|
||||
}),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.actions.push(Action::ClearBlankPicture);
|
||||
}
|
||||
if s.blank_busy {
|
||||
ui.spinner();
|
||||
}
|
||||
});
|
||||
ui.small(if s.settings.language.french() {
|
||||
"Une copie est conservée et ajustée à tous les écrans de diapositives, sur fond noir."
|
||||
} else {
|
||||
"A copy is saved and fitted to all Slides screens against a black background."
|
||||
});
|
||||
},
|
||||
);
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
ui.add_space(8.);
|
||||
layout_section(
|
||||
ui,
|
||||
if s.settings.language.french() {
|
||||
"Application PDF par défaut"
|
||||
} else {
|
||||
"Default PDF application"
|
||||
},
|
||||
|ui| {
|
||||
ui.label(if s.settings.language.french() {
|
||||
"Enregistre PDF Presenter et son icône pour les fichiers PDF de votre compte Windows."
|
||||
} else {
|
||||
"Register PDF Presenter and its icon for PDF files in your Windows account."
|
||||
});
|
||||
if ui
|
||||
.button(if s.settings.language.french() {
|
||||
"Définir comme application PDF par défaut…"
|
||||
} else {
|
||||
"Set as default PDF app…"
|
||||
})
|
||||
.clicked()
|
||||
{
|
||||
s.actions.push(Action::RegisterPdfAssociation);
|
||||
}
|
||||
ui.small(if s.settings.language.french() {
|
||||
"Windows ouvrira Applications par défaut : sélectionnez PDF Presenter pour .pdf afin de confirmer."
|
||||
} else {
|
||||
"Windows will open Default Apps; select PDF Presenter for .pdf to confirm."
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
ui.add_space(8.);
|
||||
layout_section(ui, tr(&locale, "Memory and cache"), |ui| {
|
||||
ui.label(tr(
|
||||
&locale,
|
||||
"RAM budget per process (presenter + output each use this allowance):",
|
||||
));
|
||||
if ui
|
||||
.add(
|
||||
egui::Slider::new(&mut s.settings.buffer_mib, 64..=16384)
|
||||
.text("MiB"),
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
s.remember_buffer_budget();
|
||||
}
|
||||
ui.small(tr(
|
||||
&locale,
|
||||
"Raise only within available RAM; OS paging can cause delays. Screen rendering is capped at 4096 px.",
|
||||
));
|
||||
ui.separator();
|
||||
let mut changed = false;
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.label(tr(&locale, "Maximum total size (MiB)"));
|
||||
changed |= ui
|
||||
.add(
|
||||
egui::DragValue::new(&mut s.settings.disk_cache.max_mib)
|
||||
.range(64..=1048576)
|
||||
.speed(64),
|
||||
)
|
||||
.changed();
|
||||
});
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.label(tr(&locale, "Expire after (days since rendering)"));
|
||||
changed |= ui
|
||||
.add(
|
||||
egui::DragValue::new(&mut s.settings.disk_cache.max_days)
|
||||
.range(1..=3650),
|
||||
)
|
||||
.changed();
|
||||
});
|
||||
if changed {
|
||||
s.remember_cache_policy();
|
||||
}
|
||||
ui.small(tr(
|
||||
&locale,
|
||||
"Oldest files are removed first. Active decks are protected and may exceed the limit. Automatic cleanup runs once at startup, after loading and preparation finish.",
|
||||
));
|
||||
if ui
|
||||
.add_enabled(
|
||||
!s.cache_busy && !s.loading && s.initialized,
|
||||
egui::Button::new(tr(&locale, "Expunge unused cache now")),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
s.clean_cache(true);
|
||||
}
|
||||
if s.cache_busy {
|
||||
ui.spinner();
|
||||
}
|
||||
ui.small(&s.cache_status);
|
||||
});
|
||||
ui.add_space(8.);
|
||||
layout_section(ui, tr(&locale, "Storage and preparation"), |ui| {
|
||||
ui.label(s.preparation_status());
|
||||
ui.separator();
|
||||
ui.label(format!(
|
||||
"{}: {}",
|
||||
if s.settings.language.french() {
|
||||
"Diapositives préparées"
|
||||
} else {
|
||||
"Processed slides"
|
||||
},
|
||||
s.cache_path.display()
|
||||
));
|
||||
ui.label(format!("Configuration: {}", s.settings_path.display()));
|
||||
});
|
||||
});
|
||||
ui.separator();
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
close_requested = ui
|
||||
.add(egui::Button::new(tr(&locale, "Close")).min_size(Vec2::new(100., 32.)))
|
||||
.clicked();
|
||||
});
|
||||
});
|
||||
*open = window_open && !close_requested;
|
||||
}
|
||||
|
||||
fn menu(ui: &mut Ui, s: &mut Studio, preferences_open: &mut bool) {
|
||||
let locale = ui.ctx().clone();
|
||||
ui.set_min_width(260.);
|
||||
let actions_before = s.actions.len();
|
||||
|
|
@ -2471,67 +2677,43 @@ fn menu(ui: &mut Ui, s: &mut Studio) {
|
|||
}
|
||||
});
|
||||
});
|
||||
ui.menu_button(tr(&locale,"Preferences"), |ui| {
|
||||
ui.with_layout(egui::Layout::top_down(egui::Align::Min), |ui| {
|
||||
ui.set_width(370.);
|
||||
ui.collapsing(if s.settings.language.french() { "Image des diapositives masquées" } else { "Blank slides" }, |ui| {
|
||||
ui.label(if s.settings.blank_picture {
|
||||
if s.settings.language.french() { "Image personnalisée sélectionnée" } else { "Custom picture selected" }
|
||||
} else if s.settings.language.french() { "Écran noir" } else { "Solid black" });
|
||||
if ui.add_enabled(s.initialized && !s.dialog_busy && !s.blank_busy, egui::Button::new(if s.settings.language.french() { "Choisir une image…" } else { "Choose picture…" })).clicked() {
|
||||
s.actions.push(Action::PickBlankPicture);
|
||||
}
|
||||
if ui.add_enabled(s.initialized && !s.dialog_busy && (s.settings.blank_picture || s.blank_busy), egui::Button::new(if s.settings.language.french() { "Utiliser un écran noir" } else { "Use solid black" })).clicked() {
|
||||
s.actions.push(Action::ClearBlankPicture);
|
||||
}
|
||||
ui.small(if s.settings.language.french() { "Une copie est conservée et ajustée à tous les écrans Diapositives, sur fond noir." } else { "A copy is saved and fitted to all Slides screens against a black background." });
|
||||
if s.blank_busy { ui.spinner(); }
|
||||
});
|
||||
ui.separator();
|
||||
#[cfg(target_os = "windows")]
|
||||
ui.group(|ui| {
|
||||
ui.strong(if s.settings.language.french() { "Application PDF par défaut" } else { "Default PDF application" });
|
||||
ui.label(if s.settings.language.french() { "Enregistre PDF Presenter et son icône pour les fichiers PDF de votre compte Windows." } else { "Register PDF Presenter and its icon for PDF files in your Windows account." });
|
||||
if ui.button(if s.settings.language.french() { "Définir comme application PDF par défaut…" } else { "Set as default PDF app…" }).clicked() {
|
||||
s.actions.push(Action::RegisterPdfAssociation);
|
||||
}
|
||||
ui.small(if s.settings.language.french() { "Windows ouvrira Applications par défaut : sélectionnez PDF Presenter pour .pdf afin de confirmer." } else { "Windows will open Default Apps; select PDF Presenter for .pdf to confirm." });
|
||||
});
|
||||
#[cfg(target_os = "windows")]
|
||||
ui.separator();
|
||||
let mut enabled = s.settings.zoom_enabled;
|
||||
if ui.checkbox(&mut enabled, tr(&locale, "Enable page zoom")).changed() { s.enable_zoom(enabled); }
|
||||
if ui.checkbox(&mut s.settings.zoom_keep_fitted_area, tr(&locale, "Keep fitted page area when zooming")).changed() {
|
||||
s.set_zoom(s.zoom.view);
|
||||
s.save_preferences();
|
||||
}
|
||||
ui.small(tr(&locale, "By default, zoom expands the page to fill the screen without stretching. Enable this option to keep the original page-shaped area."));
|
||||
ui.small(tr(&locale, "Zoom reuses buffered images: no extra PDF rendering or image memory. Enlarged slides may look softer. Software drawing can slow down on large or multiple displays."));
|
||||
ui.separator();
|
||||
if ui.checkbox(&mut s.settings.auto_show,tr(&locale,"Show slides automatically when opening a document")).changed() {s.save_preferences();}
|
||||
ui.separator();
|
||||
ui.label(tr(&locale,"RAM budget per process (presenter + output each use this allowance):"));
|
||||
if ui.add(egui::Slider::new(&mut s.settings.buffer_mib,64..=16384).text("MiB")).changed() {s.remember_buffer_budget();}
|
||||
ui.small(tr(&locale,"Raise only within available RAM; OS paging can cause delays. Screen rendering is capped at 4096 px."));
|
||||
ui.separator();
|
||||
ui.collapsing(tr(&locale, "Disk cache"), |ui| {
|
||||
let mut changed = false;
|
||||
ui.label(tr(&locale, "Maximum total size (MiB)"));
|
||||
changed |= ui.add(egui::DragValue::new(&mut s.settings.disk_cache.max_mib).range(64..=1048576).speed(64)).changed();
|
||||
ui.label(tr(&locale, "Expire after (days since rendering)"));
|
||||
changed |= ui.add(egui::DragValue::new(&mut s.settings.disk_cache.max_days).range(1..=3650)).changed();
|
||||
if changed { s.remember_cache_policy(); }
|
||||
ui.small(tr(&locale, "Oldest files are removed first. Active decks are protected and may exceed the limit. Automatic cleanup runs once at startup, after loading and preparation finish."));
|
||||
if ui.add_enabled(!s.cache_busy && !s.loading && s.initialized, egui::Button::new(tr(&locale, "Expunge unused cache now"))).clicked() { s.clean_cache(true); }
|
||||
ui.small(&s.cache_status);
|
||||
});
|
||||
ui.label(s.preparation_status());
|
||||
ui.collapsing(tr(&locale,"Storage locations"), |ui| {
|
||||
ui.label(format!("{}: {}",if s.settings.language.french(){"Diapositives préparées"}else{"Processed slides"},s.cache_path.display()));
|
||||
ui.label(format!("Configuration: {}",s.settings_path.display()));
|
||||
});
|
||||
});
|
||||
});
|
||||
ui.separator();
|
||||
ui.label(
|
||||
egui::RichText::new(tr(&locale, "Quick settings"))
|
||||
.small()
|
||||
.strong()
|
||||
.color(ui.visuals().weak_text_color()),
|
||||
);
|
||||
let mut enabled = s.settings.zoom_enabled;
|
||||
if ui
|
||||
.checkbox(&mut enabled, tr(&locale, "Enable page zoom"))
|
||||
.changed()
|
||||
{
|
||||
s.enable_zoom(enabled);
|
||||
}
|
||||
if ui
|
||||
.checkbox(
|
||||
&mut s.settings.zoom_keep_fitted_area,
|
||||
tr(&locale, "Keep fitted page area when zooming"),
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
s.set_zoom(s.zoom.view);
|
||||
s.save_preferences();
|
||||
}
|
||||
if ui
|
||||
.checkbox(
|
||||
&mut s.settings.auto_show,
|
||||
tr(&locale, "Show slides automatically when opening a document"),
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
s.save_preferences();
|
||||
}
|
||||
if ui.button(tr(&locale, "Preferences…")).clicked() {
|
||||
*preferences_open = true;
|
||||
ui.close();
|
||||
}
|
||||
if s.settings.zoom_enabled {
|
||||
ui.menu_button(tr(&locale, "Page zoom"), |ui| {
|
||||
let mut scale = s.zoom.view.scale;
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ pub struct PresenterView {
|
|||
pub layout: Layout,
|
||||
pub layout_open: bool,
|
||||
pub layout_target: Option<String>,
|
||||
pub preferences_open: bool,
|
||||
pub menu_open: bool,
|
||||
}
|
||||
pub struct Studio {
|
||||
|
|
@ -135,6 +136,7 @@ pub struct Studio {
|
|||
pub visible_thumbs: HashSet<usize>,
|
||||
pub layout_open: bool,
|
||||
pub displays_open: bool,
|
||||
pub preferences_open: bool,
|
||||
pub menu_open: bool,
|
||||
pub browser_open: bool,
|
||||
pub browser_selected: usize,
|
||||
|
|
@ -249,6 +251,7 @@ impl Studio {
|
|||
visible_thumbs: HashSet::new(),
|
||||
layout_open: false,
|
||||
displays_open: false,
|
||||
preferences_open: false,
|
||||
menu_open: false,
|
||||
browser_open: false,
|
||||
browser_selected: 0,
|
||||
|
|
|
|||
|
|
@ -62,10 +62,11 @@ fn native_ui_renders_real_previews_notes_and_all_control_panels() {
|
|||
let mut s = studio();
|
||||
let mut ui = UiState::default();
|
||||
for size in [Vec2::new(1280., 900.), Vec2::new(800., 600.)] {
|
||||
for panel in 0..4 {
|
||||
for panel in 0..5 {
|
||||
s.menu_open = panel == 1;
|
||||
s.layout_open = panel == 2;
|
||||
s.displays_open = panel == 3;
|
||||
s.preferences_open = panel == 4;
|
||||
s.jump = "12".into();
|
||||
let output = ctx.run_ui(input(size), |root| {
|
||||
presenter_ui::presenter(root, &mut s, &mut ui)
|
||||
|
|
@ -455,7 +456,7 @@ fn output_recovery_buttons_dispatch_without_presenter_data() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn nested_settings_remain_interactive_and_menu_still_dismisses() {
|
||||
fn quick_settings_and_preferences_window_remain_interactive() {
|
||||
fn position(shapes: &[egui::epaint::ClippedShape], label: &str) -> Pos2 {
|
||||
fn find(shape: &egui::Shape, label: &str) -> Option<Pos2> {
|
||||
match shape {
|
||||
|
|
@ -518,20 +519,26 @@ fn nested_settings_remain_interactive_and_menu_still_dismisses() {
|
|||
pdf_presenter::localization::Language::System
|
||||
);
|
||||
assert!(s.menu_open);
|
||||
click(&mut s, "Preferences");
|
||||
let zoom_enabled = s.settings.zoom_enabled;
|
||||
click(&mut s, "Enable page zoom");
|
||||
assert_eq!(s.settings.zoom_enabled, !zoom_enabled);
|
||||
assert!(s.menu_open);
|
||||
let fitted = s.settings.zoom_keep_fitted_area;
|
||||
click(&mut s, "Keep fitted page area when zooming");
|
||||
assert_eq!(s.settings.zoom_keep_fitted_area, !fitted);
|
||||
assert!(s.menu_open);
|
||||
let auto_show = s.settings.auto_show;
|
||||
click(&mut s, "Show slides automatically when opening a document");
|
||||
assert_eq!(s.settings.auto_show, !auto_show);
|
||||
assert!(s.menu_open);
|
||||
click(&mut s, "Disk cache");
|
||||
click(&mut s, "Maximum total size (MiB)");
|
||||
click(&mut s, "Expire after (days since rendering)");
|
||||
click(&mut s, "Preferences…");
|
||||
assert!(s.preferences_open);
|
||||
assert!(!s.menu_open);
|
||||
click(&mut s, "Expunge unused cache now");
|
||||
assert!(s.cache_busy, "The Preferences button must submit cleanup");
|
||||
assert!(s.menu_open);
|
||||
click(&mut s, "Disk cache");
|
||||
click(&mut s, "Storage locations");
|
||||
assert!(s.menu_open);
|
||||
assert!(s.cache_busy, "The Preferences window must submit cleanup");
|
||||
assert!(s.preferences_open);
|
||||
click(&mut s, "Close");
|
||||
assert!(!s.preferences_open);
|
||||
click(&mut s, "Reset timer");
|
||||
assert!(!s.timer.running(std::time::Instant::now(), s.timer_limit()));
|
||||
assert!(
|
||||
|
|
@ -1698,6 +1705,44 @@ fn presenter_layouts_are_display_scoped_and_save_actions_keep_the_origin() {
|
|||
assert_eq!(s.take_presenter_view("two").layout, restored);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preferences_window_stays_on_the_presenter_that_opened_it() {
|
||||
fn contains(shape: &egui::Shape, label: &str) -> bool {
|
||||
match shape {
|
||||
egui::Shape::Text(text) => text.galley.text() == label,
|
||||
egui::Shape::Vec(shapes) => shapes.iter().any(|shape| contains(shape, label)),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
let mut s = studio();
|
||||
s.routes.presenter = vec!["one".into(), "two".into()];
|
||||
s.routes.presentation.clear();
|
||||
let mut first = s.take_presenter_view("one");
|
||||
first.preferences_open = true;
|
||||
s.presenter_views.insert("one".into(), first);
|
||||
let second = s.take_presenter_view("two");
|
||||
s.presenter_views.insert("two".into(), second);
|
||||
let contexts = [Context::default(), Context::default()];
|
||||
let mut natives = [UiState::default(), UiState::default()];
|
||||
let size = Vec2::new(1280., 900.);
|
||||
let mut render = |index: usize, display: &str| {
|
||||
let mut output = contexts[index].run_ui(input(size), |ui| {
|
||||
presenter_ui::presenter_on_display(ui, &mut s, &mut natives[index], display)
|
||||
});
|
||||
for _ in 0..2 {
|
||||
output = contexts[index].run_ui(input(size), |ui| {
|
||||
presenter_ui::presenter_on_display(ui, &mut s, &mut natives[index], display)
|
||||
});
|
||||
}
|
||||
output
|
||||
.shapes
|
||||
.iter()
|
||||
.any(|shape| contains(&shape.shape, "Memory and cache"))
|
||||
};
|
||||
assert!(render(0, "one"));
|
||||
assert!(!render(1, "two"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn any_presenter_can_edit_and_save_another_presenter_layout() {
|
||||
fn find(shape: &egui::Shape, label: &str) -> Option<Pos2> {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
- Disclose the project's MIT license, LLM-generated or LLM-assisted development,
|
||||
human review and professional use in the public README.
|
||||
- Replace the crowded Preferences submenu with a resizable, scrollable Preferences
|
||||
window for blank-output artwork, Windows PDF integration, RAM, disk cache, cleanup,
|
||||
preparation status and storage paths. Each Presenter owns its own window instance.
|
||||
- Keep page zoom, fitted-area zoom behavior and automatic Slides output as direct
|
||||
quick settings in Menu.
|
||||
- Linux formatting, Clippy, tests, build, rustdoc and Python helper checks pass.
|
||||
Headless line coverage is 68.51%, below the 75% floor; no application behavior
|
||||
changed, and physical-display validation was not run.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,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… → Set as default PDF app…** to register the
|
||||
portable executable for the current user. Windows opens
|
||||
Default Apps for the required confirmation. Once PDF Presenter is selected for
|
||||
`.pdf`, Explorer uses the icon embedded in `pdf-presenter.exe` for PDF files. Keep
|
||||
|
|
@ -73,7 +73,7 @@ presenter is withheld to protect notes. Reconnect an operator screen, or restart
|
|||
windowed rehearsal after verifying privacy. Duplicate monitor names are distinguished
|
||||
by enumeration order; verify identical models.
|
||||
|
||||
Output is enabled by default when opening a document. Menu → Preferences → Show slides
|
||||
Output is enabled by default when opening a document. Menu → Show slides
|
||||
automatically lets you save an opt-out. **Show slides** restores blanked output; **Blank slides** or B hides it. Navigation
|
||||
preserves blanking. Until an uncached requested slide is ready, output holds the last
|
||||
usable frame. The footer distinguishes requested and acknowledged displayed slides. A red
|
||||
|
|
@ -173,10 +173,10 @@ Opening a show starts two supervised preparation workers. The current slide gets
|
|||
Then the **entire deck** is prepared at the largest connected role screen's pixel
|
||||
edge, preserving slide aspect ratio. Smaller screens use that same frame scaled to
|
||||
fit; separate copies for every smaller resolution would waste RAM. The current
|
||||
renderer limit is 4096 pixels per side, shown in Menu → Preferences. Resolution changes start a
|
||||
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 locations shows its
|
||||
Processed frames are kept in the application's persistent cache; **Menu → Preferences… → Storage and preparation** 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
|
||||
|
|
@ -196,7 +196,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 → RAM budget controls the decoded-slide allowance for **each process**, default
|
||||
**Menu → Preferences… → Memory and cache** 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
|
||||
|
|
@ -242,6 +242,9 @@ dependency/font notices without launching a window.
|
|||
## Appearance and language
|
||||
|
||||
Menu opens a dropdown below its button; click outside or press Escape to dismiss it.
|
||||
Page zoom, fitted-area zoom and automatic Slides output stay in this dropdown for
|
||||
quick access. **Preferences…** opens a separate resizable window for blank-output
|
||||
artwork, RAM and cache controls, preparation/storage details and Windows integration.
|
||||
Displays uses numbered screen cards with direct Unused / Presenter / Slides
|
||||
choices. Repeat a role to mirror it, then choose **Apply changes** and confirm with
|
||||
**Keep changes**.
|
||||
|
|
@ -369,14 +372,14 @@ and [format contract](interfaces/presentation-notes.md#importing-txt-and-markdow
|
|||
|
||||
## Zoom and move around a slide
|
||||
|
||||
Zoom is **off by default**. Enable **Menu → Preferences → Enable page zoom**.
|
||||
Zoom is **off by default**. Enable **Menu → Enable page zoom**.
|
||||
The preference is saved globally; it does not change presentation visibility.
|
||||
|
||||
By default, zoom expands the page into the available screen area without stretching.
|
||||
For example, an A4 portrait page fills a widescreen display as you zoom in; drag to
|
||||
see the cropped top/bottom. Each screen adapts to its own dimensions. To retain
|
||||
the original page-shaped area and its margins, enable **Menu → Preferences →
|
||||
Keep fitted page area when zooming**. This choice is saved globally. It changes
|
||||
the original page-shaped area and its margins, enable **Menu → Keep fitted page
|
||||
area when zooming**. This choice is saved globally. It changes
|
||||
the visible area, not the cached image resolution.
|
||||
|
||||
- On the **current slide preview** or any **Slides screen**, scroll up/down
|
||||
|
|
@ -403,8 +406,8 @@ cache rewrite or disk access is triggered by changing the zoom. This prioritizes
|
|||
response time; text/images may look softer when enlarged, especially while only a
|
||||
low-resolution preview is available. Normal background preparation continues.
|
||||
|
||||
The Preferences disclaimer explains that software drawing can slow down on large
|
||||
or multiple displays. If three consecutive zoomed frames take over 33 ms each to
|
||||
Software drawing can slow down on large or multiple displays. If three consecutive
|
||||
zoomed frames take over 33 ms each to
|
||||
render/present on a window, a **Zoom performance** warning appears on the presenter
|
||||
with reset, disable and keep-enabled choices. This is a detected frame-budget
|
||||
warning, not proof that zoom caused the delay. It does not blank or interrupt the
|
||||
|
|
@ -412,7 +415,7 @@ output. It cannot predict compositor/hardware delays or guarantee a frame rate.
|
|||
|
||||
### Disk cache cleanup
|
||||
|
||||
In **Menu → Preferences → Disk cache**, set the maximum total size in MiB and
|
||||
In **Menu → Preferences… → Memory and cache**, 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
|
||||
|
|
@ -422,7 +425,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 **Preferences → Blank slides → Choose picture…** to replace the
|
||||
Choose **Menu → Preferences… → 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