mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 12:32:52 +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="cursor_color" type="app::Color" default="app::Color::fromMask()" />
|
||||||
<option id="painting_cursor_type" type="PaintingCursorType" default="PaintingCursorType::CROSSHAIR_ON_SPRITE" />
|
<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" type="BrushPreview" default="BrushPreview::FULL" />
|
||||||
|
<option id="brush_preview_in_preview" type="bool" default="false" />
|
||||||
<option id="snap_to_grid" type="bool" default="false" />
|
<option id="snap_to_grid" type="bool" default="false" />
|
||||||
</section>
|
</section>
|
||||||
<section id="preview" text="Preview">
|
<section id="preview" text="Preview">
|
||||||
@ -608,7 +609,6 @@
|
|||||||
<option id="grid" type="bool" default="false" />
|
<option id="grid" type="bool" default="false" />
|
||||||
<option id="pixel_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" type="bool" default="true" />
|
||||||
<option id="brush_preview_in_preview" type="bool" default="false" />
|
|
||||||
<option id="slices" type="bool" default="true" />
|
<option id="slices" type="bool" default="true" />
|
||||||
<option id="auto_guides" type="bool" default="true" />
|
<option id="auto_guides" type="bool" default="true" />
|
||||||
<option id="tile_numbers" 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 {
|
class ShowBrushPreviewInPreviewCommand : public Command {
|
||||||
public:
|
public:
|
||||||
ShowBrushPreviewInPreviewCommand()
|
ShowBrushPreviewInPreviewCommand()
|
||||||
@ -152,14 +154,14 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool onChecked(Context* ctx) override
|
bool onChecked(Context* ctx) override
|
||||||
{
|
{
|
||||||
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
|
Preferences& pref = Preferences::instance();
|
||||||
return docPref.show.brushPreviewInPreview();
|
return pref.cursor.brushPreviewInPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onExecute(Context* ctx) override
|
void onExecute(Context* ctx) override
|
||||||
{
|
{
|
||||||
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
|
Preferences& pref = Preferences::instance();
|
||||||
docPref.show.brushPreviewInPreview(!docPref.show.brushPreviewInPreview());
|
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
|
// 3) we are drawing the brush preview in a preview editor
|
||||||
// and preferences (brushPreviewInPreview) says that we
|
// and preferences (brushPreviewInPreview) says that we
|
||||||
// should do that.
|
// should do that.
|
||||||
|| m_docPref.show.brushPreviewInPreview())) {
|
|| pref.cursor.brushPreviewInPreview())) {
|
||||||
m_renderEngine->setExtraImage(extraCel->type(),
|
m_renderEngine->setExtraImage(extraCel->type(),
|
||||||
extraCel->cel(),
|
extraCel->cel(),
|
||||||
extraCel->image(),
|
extraCel->image(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user