Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Merge main into fix/rail-page-zoom-fields

RiceDee808ba7128756
diff --cc crates/ui-egui/src/chrome.rs
index eb795c833,59525aae7..56125d570
--- a/crates/ui-egui/src/chrome.rs
+++ b/crates/ui-egui/src/chrome.rs
@@@ -592,14 -572,26 +592,19 @@@ pub fn right_rail(app: &mut PdfCraftApp
let view = &mut app.views[index];
let mut page_display = None;
let rail = Rail::new(egui::Id::unique("rail"))
- .edge(Edge::End)
+ .edge(app.side_panels.rail_edge())
- .frame(egui::Frame::NONE.fill(t.chrome).inner_margin(egui::Margin::symmetric(6, 8)).stroke(Stroke::new(1.0, t.divider)))
+ .width(49.0)
+ .frame(egui::Frame::NONE.fill(t.chrome).inner_margin(egui::Margin::symmetric(1, 8)).stroke(Stroke::new(1.0, t.divider)))
.show(ui, &items, app.right.as_ref(), |ui| {
// Page navigation cluster at the bottom, a panel of its own so that in a short
// window the buttons above scroll instead of running into it (#3282).
ui.with_layout(Layout::bottom_up(Align::Center), |ui| {
ui.spacing_mut().item_spacing.y = 2.0;
+ let right = app.side_panels.rail_on_right();
+ let dock_tip = if right { tl!("Dock navigation rail on Left") } else { tl!("Dock navigation rail on Right") };
+ if icons::button(ui, if right { "panel-left" } else { "panel-right" }, 32.0, false, dock_tip).clicked() {
+ app.side_panels.rail_side = if right { crate::side_panels::ToolsSide::Left } else { crate::side_panels::ToolsSide::Right };
+ }
- let tip = crate::commands::key_tip(ui.ctx(), tl!("Zoom out ({key})"), crate::commands::ZOOM_OUT);
- if icons::button(ui, "zoom-out", 32.0, false, &tip).clicked() {
- view.zoom_step(false);
- }
- let tip = crate::commands::key_tip(ui.ctx(), tl!("Zoom in ({key})"), crate::commands::ZOOM_IN);
- if icons::button(ui, "zoom-in", 32.0, false, &tip).clicked() {
- view.zoom_step(true);
- }
// Between rotate and zoom, as in Acrobat. Its command runs once `view` is free.
let tip = crate::i18n::fmt(tl!("Page display: {layout}"), &[("layout", tl!(view.layout.label()))]);
let resp = icons::button(ui, view.layout.icon(), 32.0, false, &tip);