From 51cd0b56ae7687094e57d1f59c7b0e6d097c86cc Mon Sep 17 00:00:00 2001 From: Filip Homolka Date: Sun, 25 Jul 2021 20:17:20 +0200 Subject: [PATCH] Turn "Unit" label into "mUnit" label, to allow for compiling on other compilers aside from MSVC --- Nuake/src/UI/Nodes/Node.cpp | 28 ++++++++++++++-------------- Nuake/src/UI/Nodes/Node.h | 28 ++++++++++++++-------------- Nuake/src/UI/Styling/Style.h | 2 +- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Nuake/src/UI/Nodes/Node.cpp b/Nuake/src/UI/Nodes/Node.cpp index 01ce04aa..d76f740f 100644 --- a/Nuake/src/UI/Nodes/Node.cpp +++ b/Nuake/src/UI/Nodes/Node.cpp @@ -38,45 +38,45 @@ namespace Nuake { case PropType::HEIGHT: { - style.Height.Unit = (Layout::Unit)(s.second.type); + style.Height.mUnit = (Layout::Unit)(s.second.type); float value = s.second.value.Number; style.Height.Value = value; } break; case PropType::MIN_HEIGHT: - style.MinHeight.Unit = (Layout::Unit)s.second.type; + style.MinHeight.mUnit = (Layout::Unit)s.second.type; style.MinHeight.Value = s.second.value.Number; break; case PropType::MAX_HEIGHT: - style.MaxHeight.Unit = (Layout::Unit)s.second.type; + style.MaxHeight.mUnit = (Layout::Unit)s.second.type; style.MaxHeight.Value = s.second.value.Number; break; case PropType::WIDTH: - style.Width.Unit = (Layout::Unit)s.second.type; + style.Width.mUnit = (Layout::Unit)s.second.type; style.Width.Value = s.second.value.Number; break; case PropType::MIN_WIDTH: - style.MinWidth.Unit = (Layout::Unit)s.second.type; + style.MinWidth.mUnit = (Layout::Unit)s.second.type; style.MinWidth.Value = s.second.value.Number; break; case PropType::MAX_WIDTH: - style.MaxWidth.Unit = (Layout::Unit)s.second.type; + style.MaxWidth.mUnit = (Layout::Unit)s.second.type; style.MaxWidth.Value = s.second.value.Number; break; case PropType::MARGIN_RIGHT: - style.Margin.Right.Unit = (Layout::Unit)s.second.type; + style.Margin.Right.mUnit = (Layout::Unit)s.second.type; style.Margin.Right.Value = s.second.value.Number; break; case PropType::MARGIN_LEFT: - style.Margin.Left.Unit = (Layout::Unit)s.second.type; + style.Margin.Left.mUnit = (Layout::Unit)s.second.type; style.Margin.Left.Value = s.second.value.Number; break; case PropType::MARGIN_TOP: - style.Margin.Top.Unit = (Layout::Unit)s.second.type; + style.Margin.Top.mUnit = (Layout::Unit)s.second.type; style.Margin.Top.Value = s.second.value.Number; break; case PropType::MARGIN_BOTTOM: - style.Margin.Bottom.Unit = (Layout::Unit)s.second.type; + style.Margin.Bottom.mUnit = (Layout::Unit)s.second.type; style.Margin.Bottom.Value = s.second.value.Number; break; case PropType::JUSTIFY_CONTENT: @@ -101,19 +101,19 @@ namespace Nuake style.PositionType = (Layout::PositionType)s.second.value.Enum; break; case PropType::LEFT: - style.Position.Left.Unit = (Layout::Unit)s.second.type; + style.Position.Left.mUnit = (Layout::Unit)s.second.type; style.Position.Left.Value = s.second.value.Number; break; case PropType::RIGHT: - style.Position.Right.Unit = (Layout::Unit)s.second.type; + style.Position.Right.mUnit = (Layout::Unit)s.second.type; style.Position.Right.Value = s.second.value.Number; break; case PropType::TOP: - style.Position.Top.Unit = (Layout::Unit)s.second.type; + style.Position.Top.mUnit = (Layout::Unit)s.second.type; style.Position.Top.Value = s.second.value.Number; break; case PropType::BOTTOM: - style.Position.Bottom.Unit = (Layout::Unit)s.second.type; + style.Position.Bottom.mUnit = (Layout::Unit)s.second.type; style.Position.Bottom.Value = s.second.value.Number; break; case PropType::BACKGROUND_COLOR: diff --git a/Nuake/src/UI/Nodes/Node.h b/Nuake/src/UI/Nodes/Node.h index 8f84c9eb..8847b1e1 100644 --- a/Nuake/src/UI/Nodes/Node.h +++ b/Nuake/src/UI/Nodes/Node.h @@ -74,7 +74,7 @@ namespace Nuake if (IsHover) style = this->HoverStyle; - switch (style.Width.Unit) + switch (style.Width.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetWidth(YogaNode, style.Width.Value); @@ -86,7 +86,7 @@ namespace Nuake YGNodeStyleSetWidthAuto(YogaNode); break; } - switch (style.Height.Unit) + switch (style.Height.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetHeight(YogaNode, style.Height.Value); @@ -99,7 +99,7 @@ namespace Nuake break; } - switch (style.Margin.Left.Unit) + switch (style.Margin.Left.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetMargin(YogaNode, YGEdgeLeft, style.Margin.Left.Value); @@ -112,7 +112,7 @@ namespace Nuake break; } - switch (style.Margin.Right.Unit) + switch (style.Margin.Right.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetMargin(YogaNode, YGEdgeRight, style.Margin.Right.Value); @@ -125,7 +125,7 @@ namespace Nuake break; } - switch (style.Margin.Top.Unit) + switch (style.Margin.Top.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetMargin(YogaNode, YGEdgeTop, style.Margin.Top.Value); @@ -138,7 +138,7 @@ namespace Nuake break; } - switch (style.Margin.Bottom.Unit) + switch (style.Margin.Bottom.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetMargin(YogaNode, YGEdgeBottom, style.Margin.Bottom.Value); @@ -150,7 +150,7 @@ namespace Nuake YGNodeStyleSetMarginAuto(YogaNode, YGEdgeTop); break; } - switch (style.Padding.Left.Unit) + switch (style.Padding.Left.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetPadding(YogaNode, YGEdgeLeft, style.Padding.Left.Value); @@ -160,7 +160,7 @@ namespace Nuake break; } - switch (style.Padding.Right.Unit) + switch (style.Padding.Right.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetPadding(YogaNode, YGEdgeRight, style.Padding.Right.Value); @@ -170,7 +170,7 @@ namespace Nuake break; } - switch (style.Padding.Top.Unit) + switch (style.Padding.Top.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetPadding(YogaNode, YGEdgeTop, style.Padding.Top.Value); @@ -180,7 +180,7 @@ namespace Nuake break; } - switch (style.Padding.Bottom.Unit) + switch (style.Padding.Bottom.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetPadding(YogaNode, YGEdgeBottom, style.Padding.Bottom.Value); @@ -189,28 +189,28 @@ namespace Nuake YGNodeStyleSetPaddingPercent(YogaNode, YGEdgeBottom, style.Padding.Bottom.Value); break; } - switch (style.Border.Left.Unit) + switch (style.Border.Left.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetBorder(YogaNode, YGEdgeLeft, style.Border.Left.Value); break; } - switch (style.Border.Right.Unit) + switch (style.Border.Right.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetBorder(YogaNode, YGEdgeRight, style.Border.Right.Value); break; } - switch (style.Border.Top.Unit) + switch (style.Border.Top.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetBorder(YogaNode, YGEdgeTop, style.Border.Top.Value); break; } - switch (style.Border.Bottom.Unit) + switch (style.Border.Bottom.mUnit) { case Layout::Unit::PIXEL: YGNodeStyleSetBorder(YogaNode, YGEdgeBottom, style.Border.Bottom.Value); diff --git a/Nuake/src/UI/Styling/Style.h b/Nuake/src/UI/Styling/Style.h index 18b37186..06400ba9 100644 --- a/Nuake/src/UI/Styling/Style.h +++ b/Nuake/src/UI/Styling/Style.h @@ -49,7 +49,7 @@ namespace Nuake struct LayoutUnit { float Value = 0.0f; - Unit Unit = Unit::PIXEL; + Unit mUnit = Unit::PIXEL; }; struct LayoutVec4