Skip to content

(fix #4721) Implement Editor Toggle to hide or show the preview Brush in the preview Window#4752

Closed
S4HRKBOY wants to merge 1 commit intoaseprite:mainfrom
S4HRKBOY:Disable_Cursor_PreviewWindow
Closed

(fix #4721) Implement Editor Toggle to hide or show the preview Brush in the preview Window#4752
S4HRKBOY wants to merge 1 commit intoaseprite:mainfrom
S4HRKBOY:Disable_Cursor_PreviewWindow

Conversation

@S4HRKBOY
Copy link
Contributor

@S4HRKBOY S4HRKBOY commented Nov 1, 2024

This PR is for the issue #4721

In this PR i implemented a simple function to toggle the preview brush inside the preview window with a new Menu-Item and the corrisponding Command. A preview can be seen in a little video in this PR Message (Only the first 30s are relevant - rest of the video is freezing :X).
Aseprite-test.webm

@S4HRKBOY S4HRKBOY requested a review from dacap as a code owner November 1, 2024 22:30
@aseprite-bot
Copy link
Collaborator

Hi there!

One or more of the commit messages in this PR do not match our code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@S4HRKBOY S4HRKBOY force-pushed the Disable_Cursor_PreviewWindow branch from daff335 to d822c1c Compare November 1, 2024 22:36
@S4HRKBOY S4HRKBOY changed the title #4721 Implement Editor Toggle to hide or show the preview Brush in the preview Window (fix #4721) Implement Editor Toggle to hide or show the preview Brush in the preview Window Nov 1, 2024
Copy link
Collaborator

@aseprite-bot aseprite-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

protected:
bool onChecked(Context* ctx) override
{
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'docPref' of type 'DocumentPreferences &' (aka 'int &') can be declared 'const' [misc-const-correctness]

Suggested change
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
DocumentPreferences const& docPref = Preferences::instance().document(ctx->activeDocument());

}
void onExecute(Context* ctx) override
{
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'docPref' of type 'DocumentPreferences &' (aka 'int &') can be declared 'const' [misc-const-correctness]

Suggested change
DocumentPreferences& docPref = Preferences::instance().document(ctx->activeDocument());
DocumentPreferences const& docPref = Preferences::instance().document(ctx->activeDocument());

@dacap dacap self-assigned this Nov 6, 2024
@dacap
Copy link
Member

dacap commented Nov 6, 2024

Thanks @S4HRKBOY, I'll test this and probably modify the patch a little for the final merge/cherry-pick.

@dacap
Copy link
Member

dacap commented Nov 6, 2024

I've cherry-picked ( cd5bf49 ) this with a few changes (removing unnecessary <key> element, sorting things by name, avoid #include <user header file> etc.) and added an extra patch ( d073ecd ) to show the selection transformation in the preview window (as we use the Doc's ExtraCel for such purpose too). With this patch when we transformed the selection the layer disappeared from the preview window.

@dacap dacap closed this Nov 6, 2024
ProtossGP32 pushed a commit to ProtossGP32/aseprite that referenced this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants