mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-16 10:53:11 +01:00
23 lines
500 B
C#
23 lines
500 B
C#
|
namespace MLEM.Ui.Style {
|
||
|
public struct StyleProp<T> {
|
||
|
|
||
|
public T Value { get; private set; }
|
||
|
private bool isCustom;
|
||
|
|
||
|
public void SetFromStyle(T value) {
|
||
|
if (!this.isCustom) {
|
||
|
this.Value = value;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void Set(T value) {
|
||
|
this.isCustom = true;
|
||
|
this.Value = value;
|
||
|
}
|
||
|
|
||
|
public static implicit operator T(StyleProp<T> prop) {
|
||
|
return prop.Value;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|