CSS Improvements and tests.

--HG--
branch : dev-css
This commit is contained in:
Martín Lucas Golini
2019-05-20 00:19:44 -03:00
parent 3a43043fe5
commit 59e2ca8038
13 changed files with 187 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
#ifndef EE_GRAPHICSFONTHELPER_HPP
#define EE_GRAPHICSFONTHELPER_HPP
#include <eepp/config.hpp>
namespace EE { namespace Graphics {
enum EE_FONT_TYPE {

View File

@@ -3,6 +3,7 @@
#include <eepp/config.hpp>
#include <eepp/math/vector2.hpp>
#include <eepp/core/string.hpp>
namespace EE { namespace Math {
@@ -40,6 +41,8 @@ class tOriginPoint : public Vector2<T> {
{
}
std::string toString() const;
tOriginPoint<T>& operator=(const Vector2<T>& v);
};
@@ -50,6 +53,13 @@ tOriginPoint<T>& tOriginPoint<T>::operator=(const Vector2<T>& v) {
return *this;
}
template<typename T>
std::string tOriginPoint<T>::toString() const {
if ( OriginType == OriginCenter ) return "center";
else if ( OriginType == OriginTopLeft ) return "topleft";
return String::toStr(this->x) + "," + String::toStr(this->y);
}
typedef tOriginPoint<Float> OriginPoint;
typedef tOriginPoint<int> OriginPointi;

View File

@@ -289,7 +289,7 @@ class EE_API Node : public Transformable {
void disableReportSizeChangeToChilds();
bool reportSizeChangeToChilds();
bool reportSizeChangeToChilds() const;
void centerHorizontal();

View File

@@ -21,6 +21,8 @@ class EE_API StyleSheetStyle {
StyleSheetProperty getPropertyByName( const std::string& name ) const;
void setProperty( const StyleSheetProperty& property );
void clearProperties();
protected:
StyleSheetSelector mSelector;
StyleSheetProperties mProperties;

View File

@@ -109,6 +109,8 @@ class EE_API UINode : public Node {
UINode * setForegroundRadius( const unsigned int& corners );
Uint32 getForegroundRadius() const;
RectangleDrawable * setBorderEnabled( bool enabled );
UINode * setBorderColor( const Color& color );
@@ -117,6 +119,8 @@ class EE_API UINode : public Node {
UINode * setBorderWidth( const unsigned int& width );
Float getBorderWidth() const;
const Uint32& getFlags() const;
virtual UINode * setFlags( const Uint32& flags );

View File

@@ -200,6 +200,16 @@ class EE_API UIWidget : public UINode, public CSS::StyleSheetElement {
void reportStyleStateChange();
bool isSceneNodeLoading() const;
std::string getLayoutWidthRulesString() const;
std::string getLayoutHeightRulesString() const;
std::string getLayoutGravityString() const;
std::string getGravityString() const;
std::string getFlagsString() const;
};
}}