Skip to content

Add Widget Zoo, fix various widget consistency issues#5478

Merged
dacap merged 1 commit into
aseprite:betafrom
ckaiser:consistency-zoo
Feb 13, 2026
Merged

Add Widget Zoo, fix various widget consistency issues#5478
dacap merged 1 commit into
aseprite:betafrom
ckaiser:consistency-zoo

Conversation

@ckaiser

@ckaiser ckaiser commented Oct 21, 2025

Copy link
Copy Markdown
Member

Adds a new command, WidgetZoo, to launch a window containing most of the usable widgets:

image

This is useful to check the consistency of the widgets through different states and variations (there's a toggle for normal/disabled/readonly), and to see how things look with different themes at a glance (there's a theme selector on the top-right).

The work creating this made a few issues come up and those have also been fixed in this PR:

  • ExprEntry widgets could be created with any "text" property through XML and that would remain until it received and lost focus and was thus validated, it now performs a validation when the first text is set.
  • TextEdit, FilenameField and FontEntry now have a readonly mode.
  • FontEntry now disables the size dropdown when there's no font set, instead of just showing an empty popup (shouldn't be an issue since in most places we show this the font is already pre-set to Aseprite by default anyway).
  • TextEdit now has the correct colors for disabled and readonly, and now supports placeholders, although they cannot be multi-line and do not affect the view/scrolling (if there's a place where we need to use this, then it can be tackled, but the implementation would add complexity that might not be necessary atm)
  • The color consistency of Entry and TextEdit has been improved when switching through the different states:
    • Suffixes now aren't basically invisible when in readonly mode
    • Placeholders and suffixes don't show when the widget is disabled.
  • Fixed being able to paste text into disabled/readonly Entries.
  • Removed some deprecated/unused code from WidgetLoader.
  • Fixed a crash when setting the wrong grid column span (for example 4 on a table with 3 columns), now it's an exception.
  • Fixed mini_button not using the disabled text color

Setting this as draft to validate that these are the changes we want and the design of the window itself (it's very "developer-y" but since it's a hidden command you can only access through the runner or scripting I think that's fine IMO).

Only widget that isn't here is the splitter, ran into some weird issues when trying to use it relating to size, will look into it.

@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

Comment thread src/app/commands/cmd_widget_zoo.cpp
Comment thread src/app/commands/cmd_widget_zoo.cpp
Comment thread src/app/ui/expr_entry.cpp Outdated
Comment thread src/app/ui/expr_entry.h Outdated
Comment thread src/app/ui/expr_entry.h Outdated
Comment thread src/app/widget_loader.cpp Outdated
Comment thread src/ui/textedit.h Outdated

@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

Comment thread src/app/ui/expr_entry.h Outdated

// Used to validate the text given to the widget during creation in widget_loader, to validate the
// data.
bool m_firstText = 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: member variable 'm_firstText' has protected visibility [misc-non-private-member-variables-in-classes]

  bool m_firstText = false;
       ^

@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

Comment thread src/app/commands/cmd_widget_zoo.cpp

@dacap dacap left a comment

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's nice to have a place to test widgets/themes and scales. I've reviewed with some comments, the most important one is a regression/bug in ExprEntry.

Comment thread data/widgets/zoo.xml Outdated
Comment thread data/widgets/zoo.xml Outdated
Comment thread src/app/commands/cmd_widget_zoo.cpp Outdated
Comment thread src/app/commands/cmd_widget_zoo.cpp Outdated
Comment thread src/app/commands/cmd_widget_zoo.cpp Outdated
Comment thread src/app/widget_loader.cpp Outdated
Comment thread src/ui/grid.cpp Outdated
Comment thread src/ui/textedit.cpp
Comment thread src/ui/textedit.cpp Outdated
Comment thread src/ui/theme.cpp
@dacap dacap assigned ckaiser and unassigned dacap Nov 11, 2025
@ckaiser ckaiser assigned dacap and unassigned ckaiser Nov 16, 2025

@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

Comment thread src/app/commands/cmd_widget_zoo.cpp
@ckaiser ckaiser force-pushed the consistency-zoo branch 2 times, most recently from 81f8f23 to ad93094 Compare December 5, 2025 06:20
@ckaiser

ckaiser commented Dec 5, 2025

Copy link
Copy Markdown
Member Author

Rebased, updated and removed some stray things (textbox without view), ready for the full review.

@ckaiser ckaiser marked this pull request as ready for review December 5, 2025 06:21
@dacap

dacap commented Feb 13, 2026

Copy link
Copy Markdown
Member

LGTM 👍

@dacap dacap merged commit 02abd73 into aseprite:beta Feb 13, 2026
12 checks passed
@ckaiser ckaiser deleted the consistency-zoo branch February 13, 2026 22:44
@dacap dacap added this to the v1.3.18-beta1 milestone Feb 25, 2026
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