Skip to content

Change Widget Layout Order#63

Merged
SirMallard merged 2 commits intomainfrom
widget-layout
Jul 23, 2024
Merged

Change Widget Layout Order#63
SirMallard merged 2 commits intomainfrom
widget-layout

Conversation

@SirMallard
Copy link
Owner

Simple Fix to Widget Layout Issues

Although this was addressed in #46, I was unsatisfied with regenerating widgets because they became out of order. Instead, I decided to redesign the layout system so that it is trivial to change the order of sibling elements without affecting children or parents. This involves a counter within each parent widget which assigns the LayoutOrder property and can check for new widgets added.

The current way to check for a new widget is by comparing the widget ZIndex property against the parent's counter. This ensures that if the widget order changes, all that needs to be done is change the Instance LayoutOrder property, no regeneration required.

Additions

  • Changed the display order to use sibling ZIndex instead of a global ZIndex ordering.
  • Added new ZOffset and ZUpdate parent widget properties which decide the LayoutOrder of children.
  • Widgets will use a LayoutOrder relative to siblings only. This allows for dynamic reorganising of widgets.
  • Widgets will check that their ZIndex matches an expected value, otherwise causing a reshuffling of widgets.

Tweaks and fixes

  • Removed unnecessary ZIndex and LayoutOrder assignments for all widgets.

- Changed the display order to use sibling ZIndex instead of a global ZIndex ordering.
- Added new ZOffset and ZUpdate parent widget properties which decide the LayoutOrder of children.
- Widgets will use a LayoutOrder relative to siblings only. This allows for dynamic reorganising of widgets.
- Widgets will check that their ZIndex matches an expected value, otherwise causing a reshuffling of widgets.
- Removed unnecessary ZIndex and LayoutOrder assignments for all widgets.
@SirMallard SirMallard self-assigned this Jul 23, 2024
@SirMallard SirMallard added the enhancement New feature or request label Jul 23, 2024
@SirMallard SirMallard changed the title Changed widget layout order Change Widget Layout Order Jul 23, 2024
@SirMallard SirMallard merged commit 40b9558 into main Jul 23, 2024
@SirMallard SirMallard deleted the widget-layout branch July 23, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant