Skip to content

Add key bindable "Hide other layers" command (fix #5291)#5527

Merged
dacap merged 1 commit into
aseprite:mainfrom
Gasparoken:add-hide-other-layers
Nov 17, 2025
Merged

Add key bindable "Hide other layers" command (fix #5291)#5527
dacap merged 1 commit into
aseprite:mainfrom
Gasparoken:add-hide-other-layers

Conversation

@Gasparoken

Copy link
Copy Markdown
Member

No description provided.

@Gasparoken Gasparoken self-assigned this Nov 10, 2025
@Gasparoken Gasparoken requested a review from dacap as a code owner November 10, 2025 20:50
@Gasparoken Gasparoken linked an issue Nov 10, 2025 that may be closed by this pull request

@aseprite-bot aseprite-bot left a comment

Copy link
Copy Markdown
Collaborator

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

}
}

void ToggleOtherLayersVisibilityCommand::onExecute(Context* ctx)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

warning: method 'onExecute' can be made static [readability-convert-member-functions-to-static]

src/app/commands/toggle_other_layers_visibility.cpp:25:

-   void onExecute(Context* ctx) override;
+   static void onExecute(Context* ctx) override;


void ToggleOtherLayersVisibilityCommand::onExecute(Context* ctx)
{
ContextReader reader(ctx);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

warning: variable 'reader' of type 'ContextReader' can be declared 'const' [misc-const-correctness]

Suggested change
ContextReader reader(ctx);
ContextReader const reader(ctx);

}

// Hide everything or restore alternative state
bool oneWithInternalState = false;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

warning: variable 'oneWithInternalState' of type 'bool' can be declared 'const' [misc-const-correctness]

Suggested change
bool oneWithInternalState = false;
bool const oneWithInternalState = false;

{
}

void showChildrenLayers(const LayerGroup* layerGroup, Doc* doc)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like a static standalone function used only in this file:

Suggested change
void showChildrenLayers(const LayerGroup* layerGroup, Doc* doc)
static void show_children_layers(const LayerGroup* layerGroup, Doc* doc)

@Gasparoken Gasparoken force-pushed the add-hide-other-layers branch from 827c67c to 88b949d Compare November 11, 2025 13:47
@Gasparoken Gasparoken assigned dacap and unassigned Gasparoken Nov 11, 2025
@dacap dacap merged commit 6bdfdec into aseprite:main Nov 17, 2025
12 checks passed
@dacap

dacap commented Nov 17, 2025

Copy link
Copy Markdown
Member

Going to rename the command to SoloLayer + restore the possibility to soloing several layers dragging the mouse with Alt key (this was lost with this PR).

dacap added a commit to dacap/aseprite that referenced this pull request Nov 17, 2025
…rite#5527)

We already have a "View > Preview > Hide Other Layers" command, so we
prefer a command name that is well-known in software (soloing a layer)
for this.
dacap added a commit to dacap/aseprite that referenced this pull request Nov 17, 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.

Feature - Native "Hide all layers but selected" toggle

3 participants