Skip to content

Conversation

@dbnicholson
Copy link
Member

When all the categories are shown, you may need to do quite a bit of scrolling to find the block you want or just to discover what's there. This changes the category display so that each category is a button that can show or hide its blocks. All blocks are initially hidden to be able to see all the available categories.

The expander is implemented as a flat button with a triangle icon. The icon comes from an atlas with two states corresponded to expanded or unexpanded. Godot does provide the Tree class with similar functionality, but it's a bit complex to use. More importantly TreeItems are their own class that don't derive from Node. That would break the current Block usage.

The SVG with the triangle drawings is included should any editing be needed, but it's not used in the scene.

https://phabricator.endlessm.com/T35507

@dbnicholson dbnicholson requested review from manuq and wnbaum June 24, 2024 18:08
@dbnicholson
Copy link
Member Author

Here's a quick demo.

Screencast.from.2024-06-24.12-09-46.webm

Copy link
Contributor

@manuq manuq left a comment

Choose a reason for hiding this comment

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

Looks good and I think the change is very welcome!

One small thing: I wonder if editor icons from the default theme can be used. I just spotted this icon previewer addon and does this to fetch editor icons: https://github.com/Xrayez/godot-editor-icons-previewer/blob/gd3/addons/editor_icon_previewer/editor_icon_previewer.gd#L51-L59

@dbnicholson
Copy link
Member Author

One small thing: I wonder if editor icons from the default theme can be used. I just spotted this icon previewer addon and does this to fetch editor icons: https://github.com/Xrayez/godot-editor-icons-previewer/blob/gd3/addons/editor_icon_previewer/editor_icon_previewer.gd#L51-L59

Oh, that's a good idea. I'll see if something is in there. Certainly drawing icons is not something I should normally be doing.

When all the categories are shown, you may need to do quite a bit of
scrolling to find the block you want or just to discover what's there.
This changes the category display so that each category is a button that
can show or hide its blocks. All blocks are initially hidden to be able
to see all the available categories.

The expander is implemented as a flat button with a icon. Godot does
provide the Tree class with similar functionality, but it's a bit
complex to use. More importantly TreeItems are their own class that
don't derive from Node. That would break the current Block usage. The
Tree arrow icons are reused, though. To give a little more indication
that the category can be expanded, the color is lightened relative to
the expanded state.

https://phabricator.endlessm.com/T35507
@dbnicholson dbnicholson force-pushed the T35507-block-category-buttons branch from fcc335b to 82f925b Compare June 24, 2024 22:33
@dbnicholson
Copy link
Member Author

One small thing: I wonder if editor icons from the default theme can be used. I just spotted this icon previewer addon and does this to fetch editor icons: https://github.com/Xrayez/godot-editor-icons-previewer/blob/gd3/addons/editor_icon_previewer/editor_icon_previewer.gd#L51-L59

Oh, that's a good idea. I'll see if something is in there. Certainly drawing icons is not something I should normally be doing.

I had to find a version in a branch that works with 4.2, but then I was able to find GuiTreeArrowRight and GuiTreeArrowDown. Presumably those are used in Tree. I also changed to try out @dylanmccall's suggestion that the color be more vibrant when in collapsed state.

@dbnicholson
Copy link
Member Author

Copy link
Contributor

@starnight starnight left a comment

Choose a reason for hiding this comment

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

I like this one!

@starnight starnight merged commit 90d8a17 into main Jun 25, 2024
@starnight starnight deleted the T35507-block-category-buttons branch June 25, 2024 03:38
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.

4 participants