Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UI styling possibilities #685

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

Jowan-Spooner
Copy link

@Jowan-Spooner Jowan-Spooner commented May 8, 2024

This PR aims to give more power to the theme, by adding some custom style variations and panels, use of PanelContainers (to control content margins), etc.

This PR uses the "Modern" theme from #683 to use these, to showcase how this can help with styling.

These are the individual changes:

Make the main background a PanelContainer with a custom style

  • allows changing the margins and color of the main background (without affecting any other panels/containers
  • Theme Type Variation: "MM_MainBackground" (inherits from PanelContainer)

Add PanelContainers to Library, Layers, Hierarchy

  • allows adding a panel with content margin to those.
  • Theme Type Variation: "MM_PanelBackground" (inherits from PanelContainer)
  • as this was a change in node hierarchy some changes in the scripts had to be made and signals needed to be reconnected

Use PanelContainer as Flexible Tab + Scroll Container as Tabs parent

  • allows changing the content_margin with the panels (instead of a separate Margin container)
  • the scroll container allows horizontal scrolling when too many tabs are present (scroll bar will not be shown)
  • Theme Type Variation: "MM_FlexibleTab" (inherits from TabBar)

Add custom style to filter LineEdit in library

  • allows custom style
  • Theme Type Variation: "MM_FilterLineEdit" (inherits from LineEdit)

Make sure theme is propagated to flexible layout windows

  • makes sure panels don't change style when in a window

Add background panel to projects (behind previews)

  • Theme Type Variation: "MM_ProjectsBackground" (inherits from Panel)

Improve AddNode panel

  • Makes the background panel use theme type variation "MM_AddNodePanel"
  • Implements the list as an ItemList (theme type variation "MM_AddNodePanelList")

This is the "Modern" theme afterwards:
grafik

The theme resource was done from scratch to avoid the use of unnecessary/outdated theme properties (a clean theme resource should make it easier to adjust and vary in the future).

Things don't really look perfectly like I envision them, because there are some panels and other customization options missing. But I think this is a good start for a new theme. I've not made it the new default, just added it to the theme list.

The theme uses the Rubik font, as suggested by Tarox.
This required some rework of the library scene (to have the container as the root). Not a lot though.
- this commit also adds a background style to the Tree again on the Modern Theme
- Makes the panel style customizable from the theme
- Reworks the list as an actual ItemList to be more performant
- Stores the entries "Name" when loading the library, to avoid doing lot's of string.split("/") when filtering.
- Implement selecting items in the list with Down arrow (when filter is focused)
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.

None yet

1 participant