Sharpen: refuse Indexed Color and Bitmap documents (#12953)

paint.sharpen and its live stroke fail with the reference application's
alert text, and a press with the Sharpen tool opens that alert, as the
Dodge tool does since #12686.
This commit is contained in:
rmsff committed 2026-11-10 21:03:11 +03:00
1 parent 609e2aa727
commit 3b5a62e75f
2 files changed
+7 -4

No files matched your search

+4 -3
View File
@@ -265,12 +265,13 @@ impl DabTool {
}
}
/// The reference application refuses a Dodge stroke in Indexed Color and Bitmap documents, with
/// its alert's words (#12686); other modes (Multichannel and Duotone were not measured) tone as
/// before. The live stroke checks this too, so it previews nothing there.
/// The reference application refuses a Dodge or Sharpen stroke in Indexed Color and Bitmap
/// documents, with its alert's words (#12686, #12953); other modes (Multichannel and Duotone were
/// not measured) paint as before. The live stroke checks this too, so it previews nothing there.
fn mode_refusal(s: &Session, cmd: &str) -> Result<()> {
let tool = match cmd {
"paint.dodge" => "dodge tool",
"paint.sharpen" => "sharpen tool",
_ => return Ok(()),
};
let why = match s.active().map(|st| st.doc.mode) {
+3 -1
View File
@@ -19,10 +19,12 @@ pub const INDEXED: &str = "Could not use the {tool} because it does not work wit
pub const BITMAP: &str = "Could not use the {tool} because it does not work with Bitmap images (convert image to Grayscale mode to edit).";
/// The tool's name in the colour-mode alerts, for the tools whose wording was measured: the Dodge
/// tool. Kept apart from [`tool_name`]: the layer alerts weren't measured for these tools (#12685).
/// and Sharpen tools. Kept apart from [`tool_name`]: the layer alerts aren't wired for these tools
/// yet (#12685, #12952).
fn mode_tool_name(tool: Tool) -> Option<&'static str> {
match tool {
Tool::Dodge => Some(tl!("dodge tool")),
Tool::Sharpen => Some(tl!("sharpen tool")),
_ => None,
}
}