Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

fix(ui): pin the document tabs' » button to the strip's right end (#8290)

Korg1ch4ee0acbb2003
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs
index 7b05bffce..cd1a45e82 100644
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@ -2392,7 +2392,8 @@ fn tabs(app: &mut PhotocraftApp, ui: &mut egui::Ui) -> TabStrip {
}
}
if !f.overflow.is_empty() {
- let left = x.min((row.right() - crate::tab_strip::CHEVRON_W).max(row.left()));
+ // Pinned to the strip's right end, as Photoshop's is, not after the last tab (#8290).
+ let left = (row.right() - crate::tab_strip::CHEVRON_W).max(row.left());
let r = Rect::from_min_size(egui::pos2(left, row.top()), egui::vec2(crate::tab_strip::CHEVRON_W, row.height()));
let labels: Vec<&str> =
app.session.documents().iter().map(|st| st.doc.name.as_str()).chain(opening.iter().map(|(_, name, _)| name.as_str())).collect();
@@ -2725,7 +2726,8 @@ fn pro_tabs(app: &mut PhotocraftApp, ui: &mut egui::Ui) -> TabStrip {
}
}
if !f.overflow.is_empty() {
- let left = x.min((strip.right() - crate::tab_strip::CHEVRON_W).max(strip.left()));
+ // Pinned to the strip's right end, as Photoshop's is, not after the last tab (#8290).
+ let left = (strip.right() - crate::tab_strip::CHEVRON_W).max(strip.left());
let r = Rect::from_min_size(egui::pos2(left, strip.top()), egui::vec2(crate::tab_strip::CHEVRON_W, strip.height()));
let labels: Vec<&str> = titles.iter().map(String::as_str).collect();
let mut picked = None;