From c9a98588e4f75238c10b8f2116e29bedcc5024c4 Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Nov 2026 14:56:09 +0100 Subject: [PATCH 1/7] fix(ui): Fill and Stroke grey Preserve Transparency on the Background and locked layers (#14651) The Preserve Transparency box shared by Edit > Fill and Edit > Stroke is now greyed and off on the Background layer (or pixels without transparency) and greyed and on with Lock Transparent Pixels. The forced state is not remembered: the choice saved before stays for the next open on a normal layer, and Fill's Alt+Reset keeps the forced state. Fixes #14651 --- crates/ui-egui/src/dialogs/blend_options.rs | 50 ++++++++++++++-- crates/ui-egui/src/dialogs/fill_ui.rs | 24 ++++---- .../preserve_transparency_state_tests.rs | 60 +++++++++++++++++++ crates/ui-egui/src/dialogs/stroke_ui.rs | 13 ++-- crates/ui-egui/src/dialogs/stroke_ui/tests.rs | 2 +- 5 files changed, 128 insertions(+), 21 deletions(-) create mode 100644 crates/ui-egui/src/dialogs/fill_ui/preserve_transparency_state_tests.rs diff --git a/crates/ui-egui/src/dialogs/blend_options.rs b/crates/ui-egui/src/dialogs/blend_options.rs index 6d48c6ec82..9c04aae5c9 100644 --- a/crates/ui-egui/src/dialogs/blend_options.rs +++ b/crates/ui-egui/src/dialogs/blend_options.rs @@ -1,11 +1,16 @@ //! The Blending rows that Fill, Stroke and the Smart Filter Blending Options dialog share: the mode list is the //! Layers panel's, so a mode has one key and one shortcut everywhere. -use craft::ui::patterns::form_dialogs::{DialogFields, Param, ParamKind}; +use craft::ui::patterns::form_dialogs::{DialogFields, FieldValue, Param, ParamKind, ParamResult}; use craft::ui::runtime::env::Label; +use craft::ui::runtime::memory::{SaveKey, saved_value, set_saved_value}; use photocraft_color::BlendMode; use serde_json::{Map, Value, json}; +use crate::PhotocraftApp; + +const PRESERVE: &str = "preserveTransparency"; + /// A blend-mode row `key` over the Layers panel's mode list (`group` adds Pass Through), opening on `current`. pub(crate) fn blend_param(key: &str, label: impl Into