From 0a204b85bfabd9ecfa9279934d5483f9d03d43a2 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 22 Nov 2026 09:00:37 +0700 Subject: [PATCH] Light sphere and track cube style at their components' visibility; app state fields and helpers at crate visibility; the Flatten Transparency row returns its result --- crates/ui-egui/src/dialogs/graph_design.rs | 2 +- crates/ui-egui/src/dialogs/revolve_lights.rs | 2 +- crates/ui-egui/src/menus/run.rs | 5 +-- crates/ui-egui/src/panels/color.rs | 2 +- crates/ui-egui/src/plugin_runs.rs | 2 +- crates/ui-egui/src/state.rs | 38 ++++++++++---------- 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/crates/ui-egui/src/dialogs/graph_design.rs b/crates/ui-egui/src/dialogs/graph_design.rs index 95fef48efa..51b9e7ad0b 100644 --- a/crates/ui-egui/src/dialogs/graph_design.rs +++ b/crates/ui-egui/src/dialogs/graph_design.rs @@ -177,7 +177,7 @@ impl Fractions { /// Column's options beside the design. #[derive(Clone, Debug, PartialEq)] -struct ColumnOptions { +pub(crate) struct ColumnOptions { column_type: ColumnType, each: f64, fractions: Fractions, diff --git a/crates/ui-egui/src/dialogs/revolve_lights.rs b/crates/ui-egui/src/dialogs/revolve_lights.rs index 9e897576fd..4da63692a2 100644 --- a/crates/ui-egui/src/dialogs/revolve_lights.rs +++ b/crates/ui-egui/src/dialogs/revolve_lights.rs @@ -158,7 +158,7 @@ pub(super) fn write_moved(fields: &mut DialogFields, from: &[Light], to: &[Light /// colours of its marks. #[derive(Clone, Debug, PartialEq, ComponentStyle)] #[non_exhaustive] -pub(super) struct RowStyle { +pub(crate) struct RowStyle { #[style(metrics)] metrics: Metrics, #[style(focus)] diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 8ac6d919f9..a660d9bb62 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -964,10 +964,7 @@ fn run_ui_part8(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option crate::panels::layers::expand(app, p), "ui.layersFilter" => crate::panels::layers::set_filter(app, p), "ui.panelView" => crate::panels::set_view(app, p), - "ui.flattenTransparencyDialog" => { - crate::dialogs::flatten::open(app); - Ok(Value::Null) - } + "ui.flattenTransparencyDialog" => crate::dialogs::flatten::open(app), _ => return None, }; Some(r) diff --git a/crates/ui-egui/src/panels/color.rs b/crates/ui-egui/src/panels/color.rs index b3ed88ed07..6483b8c7fe 100644 --- a/crates/ui-egui/src/panels/color.rs +++ b/crates/ui-egui/src/panels/color.rs @@ -191,7 +191,7 @@ pub fn deserialize_show_recent_colors<'de, D: serde::Deserializer<'de>>(d: D) -> /// What the panel shows for `tgt`: the Tint row of a swatch-linked colour, else the mode picked last /// for new art (nothing selected) or when it holds the colour's own model, else the colour's model. -pub fn shown(app: &VectorcraftApp, tgt: &Target) -> ColorPanelShown { +pub(crate) fn shown(app: &VectorcraftApp, tgt: &Target) -> ColorPanelShown { if let Some(t) = tgt.tint() { let mut row = TintRow::new(t.swatch.clone(), srgba(&t.base), t.tint * 100.0); // `Tint::of` only exists for global swatches. diff --git a/crates/ui-egui/src/plugin_runs.rs b/crates/ui-egui/src/plugin_runs.rs index 03ce179097..36a14511c0 100644 --- a/crates/ui-egui/src/plugin_runs.rs +++ b/crates/ui-egui/src/plugin_runs.rs @@ -187,7 +187,7 @@ pub fn any_shown(app: &VectorcraftApp) -> bool { /// The progress window of the first run it shows. `export_progress::show` orders the job tables and /// decides when a window may appear. -pub fn shown(app: &VectorcraftApp) -> Option { +pub(crate) fn shown(app: &VectorcraftApp) -> Option { let first = app.plugin_runs.running.iter().find(|r| r.shown())?; Some(export_progress::Shown { title: crate::i18n::msg(&first.label).to_string(), diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 467a66d19e..44f7d51683 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -442,17 +442,17 @@ pub struct UiState { pub transient_panel: Option, /// The Appearance panel's rows and selection, kept while the app runs. #[serde(skip)] - pub appearance_panel: crate::panels::appearance::AppearancePanel, + pub(crate) appearance_panel: crate::panels::appearance::AppearancePanel, /// The Stroke panel's state, kept while the app runs. #[serde(skip)] - pub stroke_panel: crate::panels::stroke::StrokePanel, + pub(crate) stroke_panel: crate::panels::stroke::StrokePanel, /// The Transparency panel's state, kept while the app runs. #[serde(skip)] - pub transparency_panel: crate::panels::transparency::TransparencyPanel, + pub(crate) transparency_panel: crate::panels::transparency::TransparencyPanel, /// The Graphic Styles panel's state, kept while the app runs. #[serde(skip)] // PLAN: assumed `crate::panels::graphic_styles::GraphicStylesPanel` (ap.AS17 names no type; appearance-w10). - pub graphic_styles_panel: crate::panels::graphic_styles::GraphicStylesPanel, + pub(crate) graphic_styles_panel: crate::panels::graphic_styles::GraphicStylesPanel, /// The symbols the Symbols panel has picked (Select All Unused, a click), by name, with the uid /// of the document they were picked in. #[serde(skip)] @@ -463,13 +463,13 @@ pub struct UiState { pub brush_selection: Option<(crate::panels::brushes::ClickKey, Selection)>, /// The Brushes panel's view choices, kept while the app runs. #[serde(skip)] - pub brushes_view: crate::panels::brushes::BrushesView, + pub(crate) brushes_view: crate::panels::brushes::BrushesView, /// The Brush Options dialog that is open, while it is. #[serde(skip)] pub brush_options: Option, /// The selection of each open library panel, by panel id: its items and folders. Not saved. #[serde(skip)] - pub library_selection: HashMap>, + pub(crate) library_selection: HashMap>, /// The Libraries panel lists its items (on) instead of showing icons (off). #[serde(skip)] pub libraries_list_view: bool, @@ -810,13 +810,13 @@ pub struct UiState { pub gradient_panel: crate::panels::gradient::GradientUi, /// The Swatches panel's selection, kept swatch and focus. Not saved. #[serde(skip)] - pub swatches_panel: crate::panels::swatches::Model, + pub(crate) swatches_panel: crate::panels::swatches::Model, /// The open Swatch Options dialog's record. Not saved. #[serde(skip)] - pub swatch_options: Option, + pub(crate) swatch_options: Option, /// The open New Swatch dialog's record. Not saved. #[serde(skip)] - pub new_swatch: Option, + pub(crate) new_swatch: Option, /// Color Wheel panel: the wheel or the box, the box's channel, the slider rows, the /// out-of-gamut shading and the color vision row /// (`ui.colorWheel`, [`crate::panels::color_wheel::deserialize_settings`]). @@ -851,7 +851,7 @@ pub struct UiState { /// The open Proof Setup dialog's record: the proof view it found and the one its preview /// shows on the canvas. #[serde(skip)] - pub proof_setup: Option, + pub(crate) proof_setup: Option, /// The search the Missing Fonts dialog started (`text.findFontFiles`'s `id`), stopped once the /// dialog is gone. #[serde(skip)] @@ -920,7 +920,7 @@ pub struct UiState { pub doc_info: crate::panels::doc_info::DocInfoView, /// The Links panel's options, selection and scroll. Not saved. #[serde(skip)] - pub links: crate::panels::links::LinksModel, + pub(crate) links: crate::panels::links::LinksModel, /// The Swatches, Graphic Styles and Symbols panels' views, chosen in their panel menus /// (`ui.panelView`). They are not saved and last the session. #[serde(skip)] @@ -965,10 +965,10 @@ pub struct UiState { pub paragraph_hide_options: bool, /// The Tabs panel's session state. Not saved. #[serde(skip)] - pub tabs_panel: crate::panels::tabs::TabsPanel, + pub(crate) tabs_panel: crate::panels::tabs::TabsPanel, /// The Character and Paragraph Styles panels' session state. Not saved. #[serde(skip)] - pub text_styles: crate::panels::text_styles::StylesPanels, + pub(crate) text_styles: crate::panels::text_styles::StylesPanels, /// The Properties panel's open sections. Not saved. #[serde(skip)] pub properties_panel: crate::panels::properties::PropertiesUi, @@ -983,22 +983,22 @@ pub struct UiState { pub paint_popover: Option, /// The Image Trace panel's shown settings and preset picker. Not saved. #[serde(skip)] - pub image_trace_panel: crate::panels::image_trace::ImageTraceUi, + pub(crate) image_trace_panel: crate::panels::image_trace::ImageTraceUi, /// The Asset Export panel's selection, applied preset and Save As name, per document. Not saved. #[serde(skip)] - pub asset_export_panel: crate::panels::asset_export::AssetExportPanel, + pub(crate) asset_export_panel: crate::panels::asset_export::AssetExportPanel, /// The Pattern Options panel's chosen pattern. Not saved. #[serde(skip)] - pub pattern_options_panel: crate::panels::pattern_options::PatternOptionsPanel, + pub(crate) pattern_options_panel: crate::panels::pattern_options::PatternOptionsPanel, /// The SVG Interactivity panel's chosen event. Not saved. #[serde(skip)] - pub svg_interactivity_panel: crate::panels::svg_interactivity::SvgInteractivityPanel, + pub(crate) svg_interactivity_panel: crate::panels::svg_interactivity::SvgInteractivityPanel, /// The CSS Properties panel's options. Not saved. #[serde(skip)] - pub css_properties_panel: crate::panels::css_properties::CssPropertiesPanel, + pub(crate) css_properties_panel: crate::panels::css_properties::CssPropertiesPanel, /// The Production Preflight panel's options and recheck cache. Not saved. #[serde(skip)] - pub preflight_panel: crate::panels::preflight::PreflightPanel, + pub(crate) preflight_panel: crate::panels::preflight::PreflightPanel, /// How many clicks the Image Trace pick has taken, which offsets the next pick. Not saved. #[serde(skip)] pub trace_pick_clicks: u32,