refactor(ui): expose and use image_menu_id helper in tests

This commit is contained in:
Combiler01
2026-10-26 12:22:08 +05:30
parent bf2c246a68
commit fb0fb54f50
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1509,7 +1509,7 @@ fn user_box(xf: &PageXform, info: &DocInfo, page: usize, r: Rect) -> [f64; 4] {
[u[0].min(v[0]) as f64, u[1].min(v[1]) as f64, u[0].max(v[0]) as f64, u[1].max(v[1]) as f64]
}
pub(crate) fn image_menu_id() -> egui::Id {
pub fn image_menu_id() -> egui::Id {
egui::Id::unique("image-menu")
}
+1 -1
View File
@@ -7863,7 +7863,7 @@ fn clicking_after_image_context_menu_action_resets_menu_state_and_updates_select
h.get_by_label("Flip horizontal").click();
h.run_steps(3);
let flag_persisted = h.ctx.data_mut(|d| d.get_persisted::<bool>(egui::Id::unique("image-menu")));
let flag_persisted = h.ctx.data_mut(|d| d.get_persisted::<bool>(pdfcraft_ui_egui::edit_text_ui::image_menu_id()));
assert_eq!(flag_persisted, Some(false), "image-menu flag should be reset to false");
// 7. Click image 1: should switch selection to image 1