mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
new layout system, new UI state/styles system
This commit is contained in:
@@ -9,7 +9,7 @@ typedef uint32 RGBA;
|
||||
class Color
|
||||
{
|
||||
public:
|
||||
Color() : color(0xFFFFFFFF) { }
|
||||
Color() : color(0x0) { }
|
||||
Color(uint8 r, uint8 g, uint8 b, uint8 a = 0xFF) : color(((a & 0xff)<<24) | ((b & 0xff)<<16) | ((g & 0xff)<<8) | (r & 0xff)) { }
|
||||
Color(const Color& other) : color(other.color) { }
|
||||
Color(RGBA rgba) : color(rgba) { }
|
||||
|
@@ -21,23 +21,26 @@ AlignmentFlag fw::translateAlignment(std::string aligment)
|
||||
return AlignTopCenter;
|
||||
else if(aligment == "bottom")
|
||||
return AlignBottomCenter;
|
||||
else
|
||||
else if(aligment == "center")
|
||||
return AlignCenter;
|
||||
return AlignNone;
|
||||
}
|
||||
|
||||
AnchorEdge fw::translateAnchorEdge(const std::string& anchorPoint)
|
||||
AnchorEdge fw::translateAnchorEdge(std::string anchorEdge)
|
||||
{
|
||||
if(anchorPoint == "left")
|
||||
boost::to_lower(anchorEdge);
|
||||
boost::erase_all(anchorEdge, " ");
|
||||
if(anchorEdge == "left")
|
||||
return AnchorLeft;
|
||||
else if(anchorPoint == "right")
|
||||
else if(anchorEdge == "right")
|
||||
return AnchorRight;
|
||||
else if(anchorPoint == "top")
|
||||
else if(anchorEdge == "top")
|
||||
return AnchorTop;
|
||||
else if(anchorPoint == "bottom")
|
||||
else if(anchorEdge == "bottom")
|
||||
return AnchorBottom;
|
||||
else if(anchorPoint == "horizontalCenter")
|
||||
else if(anchorEdge == "horizontalcenter")
|
||||
return AnchorHorizontalCenter;
|
||||
else if(anchorPoint == "verticalCenter")
|
||||
else if(anchorEdge == "verticalcenter")
|
||||
return AnchorVerticalCenter;
|
||||
return AnchorNone;
|
||||
}
|
@@ -7,7 +7,7 @@
|
||||
namespace fw {
|
||||
|
||||
AlignmentFlag translateAlignment(std::string aligment);
|
||||
AnchorEdge translateAnchorEdge(const std::string& anchorPoint);
|
||||
AnchorEdge translateAnchorEdge(std::string anchorEdge);
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user