Skip to content

Commit

Permalink
move onThemeChanged (allows backends to override)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed May 20, 2024
1 parent 482f239 commit 5983662
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions haxe/ui/backend/ScreenBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@ class ScreenBase implements IComponentContainer {
c.invalidateComponent(flag);
}

private function onThemeChanged() {
for (c in rootComponents) {
onThemeChangedChildren(c);
}
}

@:access(haxe.ui.core.Component)
private function onThemeChangedChildren(c:Component) {
for (child in c.childComponents) {
onThemeChangedChildren(child);
}
c.onThemeChanged();
}

//***********************************************************************************************************
// Events
//***********************************************************************************************************
Expand Down
14 changes: 0 additions & 14 deletions haxe/ui/core/Screen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,6 @@ class Screen extends ScreenImpl {
return (findSolidComponentUnderPoint(screenX, screenY, type).length > 0);
}

private function onThemeChanged() {
for (c in rootComponents) {
onThemeChangedChildren(c);
}
}

@:access(haxe.ui.core.Component)
private function onThemeChangedChildren(c:Component) {
for (child in c.childComponents) {
onThemeChangedChildren(child);
}
c.onThemeChanged();
}

//***********************************************************************************************************
// Events
//***********************************************************************************************************
Expand Down

0 comments on commit 5983662

Please sign in to comment.