Disable Brush Preview in Preview window by default (fix #4721, #4752)

This commit is contained in:
sharkboi 2024-11-01 23:17:03 +01:00 committed by David Capello
parent 5c62fd68de
commit cd5bf499ea
6 changed files with 38 additions and 7 deletions

View File

@ -1043,6 +1043,7 @@
<param name="preview" value="true" />
<param name="checkedIfZero" value="true" />
</item>
<item command="ShowBrushPreviewInPreview" text="@.view_preview_brush_preview"/>
</menu>
<item command="AdvancedMode" text="@.view_advanced_mode" />
<item command="FullscreenMode" text="@.view_full_screen_mode" />

View File

@ -608,6 +608,7 @@
<option id="grid" type="bool" default="false" />
<option id="pixel_grid" type="bool" default="false" />
<option id="brush_preview" type="bool" default="true" />
<option id="brush_preview_in_preview" type="bool" default="false" />
<option id="slices" type="bool" default="true" />
<option id="auto_guides" type="bool" default="true" />
<option id="tile_numbers" type="bool" default="true" />

View File

@ -441,6 +441,7 @@ SetPlaybackSpeed = Playback Speed {0}x
SetSameInk = Same Ink in All Tools
ShowAutoGuides = Show Auto Guides
ShowBrushPreview = Show Brush Preview
ShowBrushPreviewInPreview = Show Brush Preview in Preview
ShowBrushes = Show Brushes
ShowDynamics = Show Dynamics
ShowExtras = Show Extras
@ -1167,6 +1168,7 @@ view_show_onion_skin = Show &Onion Skin
view_timeline = &Timeline
view_preview = Previe&w
view_preview_hide_other_layers = &Hide Other Layers
view_preview_brush_preview = &Brush Preview
view_advanced_mode = &Advanced Mode
view_full_screen_mode = &Full Screen Mode
view_full_screen_preview = F&ull Screen Preview
@ -1425,6 +1427,7 @@ brush_preview_edges = Edges Only
brush_preview_full = Full Preview
brush_preview_fullall = Full Preview with All Tools
brush_preview_fullnedges = Full Preview and Edges
brush_preview_in_preview = Brush Preview in Preview
cursor_color_type = Crosshair && Brush Edges Color:
cursor_neg_bw = Negative Black and White
cursor_specific_color = Specific Color

View File

@ -148,6 +148,24 @@ protected:
}
};
class ShowBrushPreviewInPreviewCommand : public Command {
public:
ShowBrushPreviewInPreviewCommand()
: Command(CommandId::ShowBrushPreviewInPreview(), CmdUIOnlyFlag) {
}
protected:
bool onChecked(Context* ctx) override {
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
return docPref.show.brushPreviewInPreview();
}
void onExecute(Context* ctx) override {
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
docPref.show.brushPreviewInPreview(!docPref.show.brushPreviewInPreview());
}
};
class ShowAutoGuidesCommand : public Command {
public:
ShowAutoGuidesCommand()
@ -232,6 +250,11 @@ Command* CommandFactory::createShowBrushPreviewCommand()
return new ShowBrushPreviewCommand;
}
Command* CommandFactory::createShowBrushPreviewInPreviewCommand()
{
return new ShowBrushPreviewInPreviewCommand;
}
Command* CommandFactory::createShowAutoGuidesCommand()
{
return new ShowAutoGuidesCommand;

View File

@ -145,6 +145,7 @@ FOR_EACH_COMMAND(SetPlaybackSpeed)
FOR_EACH_COMMAND(SetSameInk)
FOR_EACH_COMMAND(ShowAutoGuides)
FOR_EACH_COMMAND(ShowBrushPreview)
FOR_EACH_COMMAND(ShowBrushPreviewInPreview)
FOR_EACH_COMMAND(ShowExtras)
FOR_EACH_COMMAND(ShowGrid)
FOR_EACH_COMMAND(ShowLayerEdges)

View File

@ -704,13 +704,15 @@ void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& sprite
ExtraCelRef extraCel = m_document->extraCel();
if (extraCel &&
extraCel->type() != render::ExtraType::NONE) {
m_renderEngine->setExtraImage(
extraCel->type(),
extraCel->cel(),
extraCel->image(),
extraCel->blendMode(),
m_layer, m_frame);
extraCel->type() != render::ExtraType::NONE &&
(!m_docView->isPreview() ||
m_docPref.show.brushPreviewInPreview())) {
m_renderEngine->setExtraImage(extraCel->type(),
extraCel->cel(),
extraCel->image(),
extraCel->blendMode(),
m_layer,
m_frame);
}
// Render background first (e.g. new ShaderRenderer will paint the