mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-26 21:35:44 +00:00
Refactor "View > Preview > Brush Preview" to be a global option (fix #4876)
Co-authored-by: David Capello <david@igara.com>
This commit is contained in:
parent
e66df8da12
commit
8d30a18ed5
@ -216,6 +216,7 @@
|
||||
<option id="cursor_color" type="app::Color" default="app::Color::fromMask()" />
|
||||
<option id="painting_cursor_type" type="PaintingCursorType" default="PaintingCursorType::CROSSHAIR_ON_SPRITE" />
|
||||
<option id="brush_preview" type="BrushPreview" default="BrushPreview::FULL" />
|
||||
<option id="brush_preview_in_preview" type="bool" default="false" />
|
||||
<option id="snap_to_grid" type="bool" default="false" />
|
||||
</section>
|
||||
<section id="preview" text="Preview">
|
||||
@ -608,7 +609,6 @@
|
||||
<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" />
|
||||
|
@ -142,6 +142,8 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
// This command works as a global preference (toogling the Brush
|
||||
// Preview in the Preview window), not based on the active document.
|
||||
class ShowBrushPreviewInPreviewCommand : public Command {
|
||||
public:
|
||||
ShowBrushPreviewInPreviewCommand()
|
||||
@ -152,14 +154,14 @@ public:
|
||||
protected:
|
||||
bool onChecked(Context* ctx) override
|
||||
{
|
||||
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
|
||||
return docPref.show.brushPreviewInPreview();
|
||||
Preferences& pref = Preferences::instance();
|
||||
return pref.cursor.brushPreviewInPreview();
|
||||
}
|
||||
|
||||
void onExecute(Context* ctx) override
|
||||
{
|
||||
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
|
||||
docPref.show.brushPreviewInPreview(!docPref.show.brushPreviewInPreview());
|
||||
Preferences& pref = Preferences::instance();
|
||||
pref.cursor.brushPreviewInPreview(!pref.cursor.brushPreviewInPreview());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -692,7 +692,7 @@ void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g,
|
||||
// 3) we are drawing the brush preview in a preview editor
|
||||
// and preferences (brushPreviewInPreview) says that we
|
||||
// should do that.
|
||||
|| m_docPref.show.brushPreviewInPreview())) {
|
||||
|| pref.cursor.brushPreviewInPreview())) {
|
||||
m_renderEngine->setExtraImage(extraCel->type(),
|
||||
extraCel->cel(),
|
||||
extraCel->image(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user