mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-27 03:36:51 -06:00
Integration: #1035 Preflight Panel… shows the panel when it is already open instead of closing it; errors go to the status bar
This commit is contained in:
@@ -735,6 +735,16 @@ pub fn doc_tabs(app: &mut DesignApp, ui: &mut egui::Ui) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Show the Preflight panel. `window.panel` toggles a panel that is already open, so it runs
|
||||
/// only when Preflight isn't showing.
|
||||
fn show_preflight(app: &mut DesignApp) {
|
||||
if app.ui.open_panel.as_deref() != Some("preflight")
|
||||
&& let Err(e) = app.run("window.panel", json!({"panel": "preflight"}))
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn status_bar(app: &mut DesignApp, ui: &mut egui::Ui) {
|
||||
let t = Tokens::get(ui.ctx());
|
||||
let resp = egui::Panel::bottom("status_bar")
|
||||
@@ -810,7 +820,7 @@ pub fn status_bar(app: &mut DesignApp, ui: &mut egui::Ui) {
|
||||
// As in InDesign, the count opens a menu that leads to the Preflight panel.
|
||||
crate::menus::menu_button(ui, egui::RichText::new(count).font(small.clone()), |ui| {
|
||||
if ui.button(crate::i18n::tr(&app.ui.language, "Preflight Panel…")).clicked() {
|
||||
let _ = app.run("window.panel", json!({"panel": "preflight"}));
|
||||
show_preflight(app);
|
||||
ui.close();
|
||||
}
|
||||
});
|
||||
@@ -1234,6 +1244,12 @@ mod tests {
|
||||
// Preflight is not a dock tab: `window.panel` shows it as its own panel.
|
||||
assert_eq!(h.state().app.ui.open_panel.as_deref(), Some("preflight"));
|
||||
h.get_by_label("Preflight");
|
||||
// With the panel already showing, the entry keeps it open.
|
||||
h.get_by_label("No errors ▾").click();
|
||||
h.run_steps(3);
|
||||
h.get_by_label("Preflight Panel…").click();
|
||||
h.run_steps(3);
|
||||
assert_eq!(h.state().app.ui.open_panel.as_deref(), Some("preflight"));
|
||||
}
|
||||
|
||||
/// A very long document name made its tab grow past the window, hiding the close button
|
||||
|
||||
@@ -1916,6 +1916,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Picas", "بيكا"),
|
||||
("Place with Import Options", "وضع مع خيارات الاستيراد"),
|
||||
("Preflight", "الفحص المسبق"),
|
||||
("Preflight Panel…", "لوحة الفحص المسبق…"),
|
||||
("Previous", "السابق"),
|
||||
("Previous Page Number", "رقم الصفحة السابقة"),
|
||||
("Print Booklet", "طباعة كتيّب"),
|
||||
|
||||
@@ -1710,6 +1710,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Paragraph Symbol", "Symbol odstavce"),
|
||||
("Picas", "Piky"),
|
||||
("Preflight", "Předtisková kontrola"),
|
||||
("Preflight Panel…", "Panel předtiskové kontroly…"),
|
||||
("Previous Page Number", "Číslo předchozí stránky"),
|
||||
("Punctuation Space", "Mezera šířky interpunkce"),
|
||||
("Quarter Space", "Čtvrtina čtverčíku"),
|
||||
|
||||
@@ -1728,6 +1728,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Paragraph Symbol", "Absatzzeichen"),
|
||||
("Picas", "Pica"),
|
||||
("Preflight", "Preflight"),
|
||||
("Preflight Panel…", "Preflight-Bedienfeld …"),
|
||||
("Previous Page Number", "Vorherige Seitenzahl"),
|
||||
("Punctuation Space", "Interpunktionsleerzeichen"),
|
||||
("Quarter Space", "Viertelgeviert"),
|
||||
|
||||
@@ -146,6 +146,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Picas", "Picas"),
|
||||
("Place with Import Options", "Importer avec les options d'importation"),
|
||||
("Preflight", "Contrôle en amont"),
|
||||
("Preflight Panel…", "Panneau Contrôle en amont…"),
|
||||
("Previous Page", "Page précédente"),
|
||||
("Previous Page Number", "Numéro de la page précédente"),
|
||||
("Print Booklet", "Imprimer le cahier"),
|
||||
|
||||
@@ -1926,6 +1926,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Paragraph Symbol", "段落記号"),
|
||||
("Picas", "パイカ"),
|
||||
("Preflight", "プリフライト"),
|
||||
("Preflight Panel…", "プリフライトパネル…"),
|
||||
("Previous Page Number", "前のページ番号"),
|
||||
("Punctuation Space", "句読点幅スペース"),
|
||||
("Quarter Space", "四分スペース"),
|
||||
|
||||
@@ -1738,6 +1738,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Paragraph Symbol", "აბზაცის სიმბოლო"),
|
||||
("Picas", "პიკები"),
|
||||
("Preflight", "ბეჭდვისწინა შემოწმება"),
|
||||
("Preflight Panel…", "ბეჭდვისწინა შემოწმების პანელი…"),
|
||||
("Previous Page Number", "წინა გვერდის ნომერი"),
|
||||
("Punctuation Space", "პუნქტუაციის შორისი"),
|
||||
("Quarter Space", "მეოთხედი შორისი"),
|
||||
|
||||
@@ -1682,6 +1682,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Paragraph Symbol", "Symbol akapitu"),
|
||||
("Picas", "Pica"),
|
||||
("Preflight", "Inspekcja wstępna"),
|
||||
("Preflight Panel…", "Panel inspekcji wstępnej…"),
|
||||
("Previous Page Number", "Numer poprzedniej strony"),
|
||||
("Punctuation Space", "Spacja interpunkcyjna"),
|
||||
("Quarter Space", "Ćwierćfiret"),
|
||||
|
||||
@@ -1692,6 +1692,7 @@ pub(super) const TABLE: &[(&str, &str)] = &[
|
||||
("Paragraph Symbol", "Знак абзаца"),
|
||||
("Picas", "Пики"),
|
||||
("Preflight", "Предпечатная проверка"),
|
||||
("Preflight Panel…", "Панель предпечатной проверки…"),
|
||||
("Previous Page Number", "Номер предыдущей страницы"),
|
||||
("Punctuation Space", "Пунктуационный пробел"),
|
||||
("Quarter Space", "Четверть шпации"),
|
||||
|
||||
Reference in New Issue
Block a user