diff --git a/bin/assets/layouts/test.css b/bin/assets/layouts/test.css index 5b234946f..0a70b9a20 100644 --- a/bin/assets/layouts/test.css +++ b/bin/assets/layouts/test.css @@ -17,7 +17,7 @@ ProgressBar { display-percent: true; vertical-expand: true; filler-padding: 2dp; - movement-speed: 32, 0; + movement-speed: 32 0; } WinMenu { @@ -54,7 +54,7 @@ ScrollBar { Window { window-flags: shadow; - buttons-position-offset: -2, 0; + buttons-position-offset: -2 0; } Window::title { diff --git a/bin/assets/ui/uitheme.css b/bin/assets/ui/uitheme.css index 9b9f98784..61e91bf53 100644 --- a/bin/assets/ui/uitheme.css +++ b/bin/assets/ui/uitheme.css @@ -17,7 +17,7 @@ ProgressBar { display-percent: true; vertical-expand: true; filler-padding: 2dp; - movement-speed: 32, 0; + movement-speed: 32 0; } WinMenu { @@ -54,7 +54,7 @@ ScrollBar { Window { window-flags: shadow; - buttons-position-offset: -2, 0; + buttons-position-offset: -2 0; } Window::title { diff --git a/include/eepp/graphics.hpp b/include/eepp/graphics.hpp index ad8ba8022..c95be2bcd 100644 --- a/include/eepp/graphics.hpp +++ b/include/eepp/graphics.hpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include diff --git a/include/eepp/graphics/arcdrawable.hpp b/include/eepp/graphics/arcdrawable.hpp index cf33f7cc5..665896a33 100644 --- a/include/eepp/graphics/arcdrawable.hpp +++ b/include/eepp/graphics/arcdrawable.hpp @@ -1,4 +1,4 @@ -#ifndef EE_GRAPHICS_ARCDRAWABLE +#ifndef EE_GRAPHICS_ARCDRAWABLE #define EE_GRAPHICS_ARCDRAWABLE #include @@ -41,11 +41,16 @@ class EE_API ArcDrawable : public PrimitiveDrawable { Uint32 getSegmentsCount() const; void setSegmentsCount(const Uint32 & segmentsCount); + + const Vector2f& getOffset() const; + + void setOffset(const Vector2f& offset); protected: Float mRadius; Uint32 mSegmentsCount; Float mArcAngle; Float mArcStartAngle; + Vector2f mOffset; void updateVertex(); }; diff --git a/include/eepp/graphics/drawable.hpp b/include/eepp/graphics/drawable.hpp index 3bfa1b743..e3011fbdc 100644 --- a/include/eepp/graphics/drawable.hpp +++ b/include/eepp/graphics/drawable.hpp @@ -20,6 +20,7 @@ class EE_API Drawable { SPRITE, ARC, RECTANGLE, + TRIANGLE, CONVEXSHAPE, GROUP, NINEPATCH, diff --git a/include/eepp/graphics/triangledrawable.hpp b/include/eepp/graphics/triangledrawable.hpp new file mode 100644 index 000000000..47e04c9ee --- /dev/null +++ b/include/eepp/graphics/triangledrawable.hpp @@ -0,0 +1,50 @@ +#ifndef EE_GRAPHICS_TRIANGLEDRAWABLE_HPP +#define EE_GRAPHICS_TRIANGLEDRAWABLE_HPP + +#include +#include + +namespace EE { namespace Graphics { + +class EE_API TriangleDrawable : public PrimitiveDrawable { + public: + static TriangleDrawable* New(); + + static TriangleDrawable* New( const Vector2f& position, const Sizef& size ); + + TriangleDrawable(); + + TriangleDrawable( const Vector2f& position, const Sizef& size ); + + virtual Sizef getSize(); + + virtual void draw(); + + virtual void draw( const Vector2f& position ); + + virtual void draw( const Vector2f& position, const Sizef& size ); + + virtual bool isStateful() { return false; } + + void setSize( const Sizef& size ); + + const Triangle2f& getTriangle() const; + + void setTriangle( const Triangle2f& triangle ); + + void setTriangleColors( const Color& color1, const Color& color2, const Color& color3 ); + protected: + Triangle2f mTriangle; + Triangle2f mComputedTriangle; + Sizef mSize; + Color mColors[3]; + bool mCustomColors; + + virtual void onColorFilterChange(); + + virtual void updateVertex(); +}; + +}} // namespace EE::Graphics + +#endif // EE_GRAPHICS_TRIANGLEDRAWABLE_HPP diff --git a/include/eepp/math/triangle2.hpp b/include/eepp/math/triangle2.hpp index 47a3bd367..cc42d8404 100644 --- a/include/eepp/math/triangle2.hpp +++ b/include/eepp/math/triangle2.hpp @@ -2,6 +2,7 @@ #define EE_MATHTRIANGLE2_HPP #include +#include namespace EE { namespace Math { @@ -18,7 +19,9 @@ class Triangle2 { Vector2 V[3]; /** @return The vector index ( between 0 and 2 ) */ - Vector2& getAt( Uint32 Index ) { return V[Index]; } + tSize& getAt( Uint32 Index ) { return V[Index]; } + + tSize getSize(); }; template @@ -35,6 +38,23 @@ Triangle2::Triangle2( const Vector2& v1, const Vector2& v2, const Vecto V[2] = v3; } +template +tSize Triangle2::getSize() { + T minX = V[0].x; + T maxX = V[0].x; + T minY = V[0].y; + T maxY = V[0].y; + + for ( size_t i = 1; i < 3; i++ ) { + minX = eemin( minX, V[i].x ); + maxX = eemax( maxX, V[i].x ); + minY = eemin( minY, V[i].y ); + maxY = eemax( maxY, V[i].y ); + } + + return tSize( maxX - minX, maxY - minY ); +} + typedef Triangle2 Triangle2f; }} diff --git a/projects/linux/ee.files b/projects/linux/ee.files index 2ddfe6e54..020bec665 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -102,6 +102,7 @@ ../../include/eepp/graphics/textureloader.hpp ../../include/eepp/graphics/texturepacker.hpp ../../include/eepp/graphics/textureregion.hpp +../../include/eepp/graphics/triangledrawable.hpp ../../include/eepp/graphics/vertexbufferhelper.hpp ../../include/eepp/graphics/vertexbuffer.hpp ../../include/eepp/graphics/vertexbuffermanager.hpp @@ -536,6 +537,7 @@ ../../src/eepp/graphics/texturepackertex.hpp ../../src/eepp/graphics/textureregion.cpp ../../src/eepp/graphics/scopedtexture.hpp +../../src/eepp/graphics/triangledrawable.cpp ../../src/eepp/graphics/vertexbuffer.cpp ../../src/eepp/graphics/vertexbuffermanager.cpp ../../src/eepp/graphics/vertexbuffermanager.hpp diff --git a/src/eepp/graphics/arcdrawable.cpp b/src/eepp/graphics/arcdrawable.cpp index 7c2342bf1..5525e29bf 100644 --- a/src/eepp/graphics/arcdrawable.cpp +++ b/src/eepp/graphics/arcdrawable.cpp @@ -49,7 +49,7 @@ void ArcDrawable::draw( const Vector2f& position, const Sizef& size ) { mNeedsUpdate = true; } - PrimitiveDrawable::draw( position, size ); + PrimitiveDrawable::draw( mOffset + position, size ); } Float ArcDrawable::getRadius() const { @@ -57,8 +57,10 @@ Float ArcDrawable::getRadius() const { } void ArcDrawable::setRadius(const Float & radius) { - mRadius = radius; - mNeedsUpdate = true; + if ( mRadius != radius ) { + mRadius = radius; + mNeedsUpdate = true; + } } Float ArcDrawable::getArcAngle() const { @@ -66,8 +68,10 @@ Float ArcDrawable::getArcAngle() const { } void ArcDrawable::setArcAngle(const Float & arcAngle) { - mArcAngle = arcAngle; - mNeedsUpdate = true; + if ( mArcAngle != arcAngle ) { + mArcAngle = arcAngle; + mNeedsUpdate = true; + } } Float ArcDrawable::getArcStartAngle() const { @@ -75,8 +79,10 @@ Float ArcDrawable::getArcStartAngle() const { } void ArcDrawable::setArcStartAngle(const Float & arcStartAngle) { - mArcStartAngle = arcStartAngle; - mNeedsUpdate = true; + if ( mArcStartAngle != arcStartAngle ) { + mArcStartAngle = arcStartAngle; + mNeedsUpdate = true; + } } Uint32 ArcDrawable::getSegmentsCount() const { @@ -90,6 +96,17 @@ void ArcDrawable::setSegmentsCount(const Uint32 & segmentsCount) { mNeedsUpdate = true; } +const Vector2f& ArcDrawable::getOffset() const { + return mOffset; +} + +void ArcDrawable::setOffset( const Vector2f& offset ) { + if ( mOffset != offset ) { + mOffset = offset; + mNeedsUpdate = true; + } +} + void ArcDrawable::updateVertex() { prepareVertexBuffer( mFillMode == DRAW_LINE ? PRIMITIVE_LINE_STRIP : PRIMITIVE_TRIANGLE_FAN ); diff --git a/src/eepp/graphics/triangledrawable.cpp b/src/eepp/graphics/triangledrawable.cpp new file mode 100644 index 000000000..02da64724 --- /dev/null +++ b/src/eepp/graphics/triangledrawable.cpp @@ -0,0 +1,94 @@ +#include +#include + +namespace EE { namespace Graphics { + +TriangleDrawable* TriangleDrawable::New() { + return eeNew( TriangleDrawable, () ); +} + +TriangleDrawable* TriangleDrawable::New( const Vector2f& position, const Sizef& size ) { + return eeNew( TriangleDrawable, ( position, size ) ); +} + +TriangleDrawable::TriangleDrawable() : PrimitiveDrawable( Drawable::TRIANGLE ) {} + +TriangleDrawable::TriangleDrawable( const Vector2f& position, const Sizef& size ) : + PrimitiveDrawable( Drawable::TRIANGLE ), mSize( size ), mCustomColors( false ) { + mPosition = position; +} + +Sizef TriangleDrawable::getSize() { + return mTriangle.getSize(); +} + +void TriangleDrawable::draw() { + draw( mPosition ); +} + +void TriangleDrawable::draw( const Vector2f& ) { + draw( mPosition, mSize ); +} + +void TriangleDrawable::draw( const Vector2f& position, const Sizef& size ) { + setSize( size ); + + if ( position != mPosition ) { + mPosition = position; + mNeedsUpdate = true; + } + + if ( mNeedsUpdate ) + updateVertex(); + + Primitives p; + p.setFillMode( mFillMode ); + + if ( mCustomColors ) { + p.drawTriangle( mComputedTriangle, mColors[0], mColors[1], mColors[2] ); + } else { + p.drawTriangle( mComputedTriangle, mColor, mColor, mColor ); + } +} + +void TriangleDrawable::setSize( const Sizef& size ) { + if ( mSize != size ) { + mSize = size; + mNeedsUpdate = true; + } +} + +const Triangle2f& TriangleDrawable::getTriangle() const { + return mTriangle; +} + +void TriangleDrawable::setTriangle( const Triangle2f& triangle ) { + mTriangle = triangle; + mNeedsUpdate = true; +} + +void TriangleDrawable::setTriangleColors( const Color& color1, const Color& color2, + const Color& color3 ) { + mCustomColors = true; + mColors[0] = color1; + mColors[1] = color2; + mColors[2] = color3; +} + +void TriangleDrawable::onColorFilterChange() { + PrimitiveDrawable::onColorFilterChange(); + mCustomColors = false; +} + +void TriangleDrawable::updateVertex() { + Sizef size( mTriangle.getSize() ); + + if ( size != Sizef::Zero ) { + Vector2f scale( mSize / size ); + for ( size_t i = 0; i < 3; i++ ) { + mComputedTriangle.V[i] = mPosition + mTriangle.V[i] * scale; + } + } +} + +}} // namespace EE::Graphics diff --git a/src/eepp/ui/css/shorthanddefinition.cpp b/src/eepp/ui/css/shorthanddefinition.cpp index b763c8ba5..08b8788c0 100644 --- a/src/eepp/ui/css/shorthanddefinition.cpp +++ b/src/eepp/ui/css/shorthanddefinition.cpp @@ -98,7 +98,7 @@ ShorthandDefinition::parseShorthand( const ShorthandDefinition* shorthand, std:: return properties; } - auto values = String::split( value, ',' ); + auto values = String::split( value, ' ' ); if ( values.size() >= 2 ) { properties.emplace_back( StyleSheetProperty( propNames[0], values[0] ) ); diff --git a/src/eepp/ui/css/stylesheetproperty.cpp b/src/eepp/ui/css/stylesheetproperty.cpp index ce488e77c..a613bd714 100644 --- a/src/eepp/ui/css/stylesheetproperty.cpp +++ b/src/eepp/ui/css/stylesheetproperty.cpp @@ -194,7 +194,7 @@ static OriginPoint toOriginPoint( std::string val ) { } else if ( "topleft" == val ) { return OriginPoint::OriginTopLeft; } else { - std::vector parts = String::split( val, ',' ); + std::vector parts = String::split( val, ' ' ); if ( parts.size() == 2 ) { Float x = 0; @@ -240,7 +240,7 @@ BlendMode StyleSheetProperty::asBlendMode() const { Vector2f StyleSheetProperty::asDpDimensionVector2f( const Vector2f& defaultValue ) const { if ( !mValue.empty() ) { Vector2f vector; - auto xySplit = String::split( mValue, ',', true ); + auto xySplit = String::split( mValue, ' ', true ); if ( xySplit.size() == 2 ) { vector.x = PixelDensity::toDpFromString("0"); @@ -273,7 +273,7 @@ Vector2i StyleSheetProperty::asDpDimensionSizei( const Sizei& defaultValue ) con Vector2f StyleSheetProperty::asVector2f( const Vector2f& defaultValue ) const { if ( !mValue.empty() ) { Vector2f vector; - auto xySplit = String::split( mValue, ',', true ); + auto xySplit = String::split( mValue, ' ', true ); if ( xySplit.size() == 2 ) { Float val; @@ -300,7 +300,7 @@ Vector2f StyleSheetProperty::asVector2f( const Vector2f& defaultValue ) const { Vector2i StyleSheetProperty::asVector2i( const Vector2i& defaultValue ) const { if ( !mValue.empty() ) { Vector2i vector; - auto xySplit = String::split( mValue, ',', true ); + auto xySplit = String::split( mValue, ' ', true ); if ( xySplit.size() == 2 ) { int val; diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 21e0de2b8..e3bc4561e 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -146,9 +146,9 @@ void UIDropDownList::showList() { Float sliderValue = mListBox->getVerticalScrollBar()->getValue(); - if ( mStyleConfig.MaxNumVisibleItems < mListBox->getCount() ) + if ( mStyleConfig.MaxNumVisibleItems < mListBox->getCount() ) { mListBox->setSize( NULL != mFriendCtrl ? mFriendCtrl->getSize().getWidth() : getSize().getWidth(), (Int32)( mStyleConfig.MaxNumVisibleItems * mListBox->getRowHeight() ) + tPadding.Top + tPadding.Bottom ); - else { + } else { mListBox->setSize( NULL != mFriendCtrl ? mFriendCtrl->getSize().getWidth() : getSize().getWidth(), (Int32)( mListBox->getCount() * mListBox->getRowHeight() ) + tPadding.Top + tPadding.Bottom ); } diff --git a/src/eepp/ui/uiwidget.cpp b/src/eepp/ui/uiwidget.cpp index 8ef770c35..075ee693b 100644 --- a/src/eepp/ui/uiwidget.cpp +++ b/src/eepp/ui/uiwidget.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #include @@ -1453,6 +1455,132 @@ bool UIWidget::drawablePropertySet(const std::string& propertyName, const std::s drawable->setRectColors( rectColors ); funcSet( drawable, true, index ); + } else if ( functionType.getName() == "circle" && functionType.getParameters().size() >= 1 ) { + CircleDrawable * drawable = CircleDrawable::New(); + + const std::vector& params( functionType.getParameters() ); + + CSS::StyleSheetLength length( params[0] ); + drawable->setRadius( convertLength( length, getPixelsSize().getWidth() / 2.f ) ); + + if ( params.size() >= 2 ) { + drawable->setColor( Color::fromString( params[1] ) ); + } + + if ( params.size() >= 3 ) { + std::string fillMode( String::toLower( params[2] ) ); + if ( fillMode == "line" || fillMode == "solid" || fillMode == "fill" ) { + drawable->setFillMode( fillMode == "line" ? DRAW_LINE : DRAW_FILL ); + } + } + + drawable->setOffset( drawable->getSize() / 2.f ); + + funcSet( drawable, true, index ); + } else if ( functionType.getName() == "rectangle" && functionType.getParameters().size() >= 1 ) { + RectangleDrawable * drawable = RectangleDrawable::New(); + RectColors rectColors; + std::vector colors; + + const std::vector& params( functionType.getParameters() ); + + for ( size_t i = 0; i < params.size(); i++ ) { + std::string param( String::toLower( params[i] ) ); + + if ( param == "solid" || param == "fill" ) { + drawable->setFillMode( DRAW_FILL ); + } else if ( String::startsWith( param, "line" ) ) { + drawable->setFillMode( DRAW_LINE ); + + std::vector parts( String::split( param, ' ') ); + + if ( parts.size() >= 2 ) { + CSS::StyleSheetLength length( parts[1] ); + drawable->setLineWidth( convertLength( length, getPixelsSize().getWidth() ) ); + } + } else if ( param.find( "º" ) != std::string::npos ) { + String::replaceAll( param, "º", "" ); + Float floatVal; + if ( String::fromString( floatVal, param ) ) { + drawable->setRotation( floatVal ); + } + } else if ( Color::isColorString( param ) ) { + colors.push_back( Color::fromString( param ) ); + } else { + int intVal = 0; + + if ( String::fromString( intVal, param ) ) { + drawable->setCorners( intVal ); + } + } + } + + if ( colors.size() > 0 ) { + while( colors.size() < 4 ) { + colors.push_back( colors[ colors.size() - 1 ] ); + }; + + rectColors.TopLeft = colors[0]; + rectColors.BottomLeft = colors[1]; + rectColors.BottomRight = colors[2]; + rectColors.TopRight = colors[3]; + drawable->setRectColors( rectColors ); + + funcSet( drawable, true, index ); + } else { + eeSAFE_DELETE( drawable ); + } + } else if ( functionType.getName() == "triangle" && functionType.getParameters().size() >= 2 ) { + TriangleDrawable* drawable = TriangleDrawable::New(); + std::vector colors; + std::vector vertices; + + const std::vector& params( functionType.getParameters() ); + + for ( size_t i = 0; i < params.size(); i++ ) { + std::string param( String::toLower( params[i] ) ); + + if ( Color::isColorString( param ) ) { + colors.push_back( Color::fromString( param ) ); + } else { + std::vector vertex( String::split( param, ',' ) ); + + if ( vertex.size() == 3 ) { + for ( size_t v = 0; v < vertex.size(); v++ ) { + vertex[v] = String::trim( vertex[v] ); + std::vector coords( String::split( vertex[v], ' ' ) ); + + if ( coords.size() == 2 ) { + CSS::StyleSheetLength posX( coords[0] ); + CSS::StyleSheetLength posY( coords[1] ); + vertices.push_back( + Vector2f( convertLength( posX, getPixelsSize().getWidth() ), + convertLength( posY, getPixelsSize().getHeight() ) ) ); + } + } + } + } + } + + if ( vertices.size() == 3 && !colors.empty() ) { + Triangle2f triangle; + + for ( size_t i = 0; i < 3; i++ ) { + triangle.V[i] = vertices[i]; + } + + if ( colors.size() == 3 ) { + drawable->setTriangleColors( colors[0], colors[1], colors[2] ); + } else { + drawable->setColor( colors[0] ); + } + + drawable->setTriangle( triangle ); + + funcSet( drawable, true, index ); + } else { + eeSAFE_DELETE( drawable ); + } } else if ( functionType.getName() == "url" && functionType.getParameters().size() >= 1 ) { if ( NULL != ( res = DrawableSearcher::searchByName( functionType.getParameters().at(0) ) ) ) { funcSet( res, res->getDrawableType() == Drawable::SPRITE, index ); diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index 860352a8f..501e41175 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -37,6 +37,7 @@ UIWindow::UIWindow( UIWindow::WindowBaseContainerType type, const StyleConfig& w mBorderLeft( NULL ), mBorderRight( NULL ), mBorderBottom( NULL ), + mContainer( NULL ), mButtonClose( NULL ), mButtonMinimize( NULL ), mButtonMaximize( NULL ), diff --git a/src/tools/uieditor/uieditor.cpp b/src/tools/uieditor/uieditor.cpp index aeb361b06..513a44de8 100644 --- a/src/tools/uieditor/uieditor.cpp +++ b/src/tools/uieditor/uieditor.cpp @@ -42,7 +42,7 @@ EE::Window::Window * window = NULL; UIMessageBox * MsgBox = NULL; efsw::FileWatcher * fileWatcher = NULL; UITheme * theme = NULL; -UIWidget * uiContainer = NULL; +UIWindow * uiContainer = NULL; UIWinMenu * uiWinMenu = NULL; UISceneNode * uiSceneNode = NULL; UISceneNode * appUiSceneNode = NULL; @@ -52,6 +52,7 @@ bool layoutExpanded = true; bool updateLayout = false; bool updateStyleSheet = false; bool useDefaultTheme = false; +bool preserveContainerSize = false; Clock waitClock; Clock cssWaitClock; efsw::WatchID watch = 0; @@ -254,7 +255,7 @@ static void loadLayout( std::string file ) { watch = fileWatcher->addWatch( folder, listener ); } - uiContainer->childsCloseAll(); + uiContainer->getContainer()->childsCloseAll(); uiSceneNode->loadLayoutFromFile( file, uiContainer ); @@ -369,15 +370,17 @@ void updateRecentProjects() { SceneManager::instance()->setCurrentUISceneNode( uiSceneNode ); } -void resizeCb(EE::Window::Window *) { +void resizeCb(EE::Window::Window * window) { if ( layoutExpanded ) { uiContainer->setSize( uiSceneNode->getSize() ); - } else { + } else if ( !preserveContainerSize ) { Float scaleW = (Float)uiSceneNode->getSize().getWidth() / (Float)uiContainer->getSize().getWidth(); Float scaleH = (Float)uiSceneNode->getSize().getHeight() / (Float)uiContainer->getSize().getHeight(); uiContainer->setScale( scaleW < scaleH ? scaleW : scaleH ); uiContainer->center(); + } else { + window->setSize( uiContainer->getPixelsSize().getWidth(), uiContainer->getPixelsSize().getHeight() ); } } @@ -674,7 +677,7 @@ void loadProject( std::string projectPath ) { void closeProject() { currentLayout = ""; currentStyleSheet = ""; - uiContainer->childsCloseAll(); + uiContainer->getContainer()->childsCloseAll(); uiSceneNode->setStyleSheet( CSS::StyleSheet() ); layouts.clear(); @@ -870,7 +873,9 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { args::ValueFlag xmlFile(parser, "xml", "Loads XML file", {'x', "xml"}); args::ValueFlag cssFile(parser, "css", "Loads CSS file", {'c', "css"}); args::ValueFlag projectFile(parser, "project", "Loads project file", {'p', "project"}); + args::ValueFlag pixelDenstiyConf(parser, "pixel-density", "Set default application pixel density", {'d', "pixel-density"}); args::Flag useAppTheme(parser, "use-app-theme", "Use the default application theme in the editor.", {'u',"use-app-theme"}); + args::Flag preserveContainerSizeFlag(parser, "preserve-container-size", "Using this flag the application will respect the window size set in the project and won't scale the window.", {'s',"preserve-container-size"}); try { parser.ParseCLI(argc, argv); @@ -894,6 +899,14 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { Display * currentDisplay = Engine::instance()->getDisplayManager()->getDisplayIndex(0); Float pixelDensity = PixelDensity::toFloat( currentDisplay->getPixelDensity() ); + if ( pixelDenstiyConf ) { + pixelDensity = pixelDenstiyConf.Get(); + } + + if ( preserveContainerSizeFlag ) { + preserveContainerSize = true; + } + window = Engine::instance()->createWindow( WindowSettings( 1280, 720, "eepp - UI Editor", WindowStyle::Default, WindowBackend::Default, 32, "assets/icon/ee.png", pixelDensity ), ContextSettings( true, GLv_default, true, 24, 1, 0, true ) ); if ( window->isOpen() ) { @@ -935,10 +948,9 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { createAppMenu(); - uiContainer = UIWidget::New(); + UIWindow::StyleConfig winStyle( UI_CONTROL_DEFAULT_FLAGS | UI_WIN_NO_DECORATION ); + uiContainer = UIWindow::NewOpt( UIWindow::SIMPLE_LAYOUT, winStyle ); uiContainer->setId( "appContainer" )->setSize( uiSceneNode->getSize() ); - uiContainer->clipDisable(); - uiContainer->enableReportSizeChangeToChilds(); updateRecentProjects();