From 985dc7437658a8826175143bfb9af0a5fcea3a2e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 14 Jun 2023 09:33:08 +0200 Subject: [PATCH] Made elements' ui styles be inherited by their children --- CHANGELOG.md | 1 + MLEM.Ui/Elements/Element.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0b43e..03ad1af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Improvements - Allow specifying start and end indices when drawing a Paragraph - Allow elements with larger children to influence a panel's scrollable area - Remove all elements from a UiSystem when it is disposed +- Made elements' ui styles be inherited by their children Fixes - Fixed images not updating their hidden state properly when the displayed texture changes diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index 9616eb0..4b5192c 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -34,7 +34,7 @@ namespace MLEM.Ui.Elements { private set { this.system = value; this.Controls = value?.Controls; - this.Style = this.Style.OrStyle(value?.Style); + this.AndChildren(e => e.Style = e.Style.OrStyle(value?.Style)); } } ///