Minor fixes.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2019-11-04 19:55:25 -03:00
parent f38e7437f1
commit ffcf72deaf
5 changed files with 17 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
#include <pugixml/pugixml.hpp>
namespace EE { namespace UI {
UIGridLayout * UIGridLayout::New() {
return eeNew( UIGridLayout, () );
}
@@ -208,11 +208,11 @@ bool UIGridLayout::setAttribute( const NodeAttribute& attribute, const Uint32& s
const std::string& name = attribute.getName();
if ( "column-span" == name || "columnspan" == name ) {
setSpan( Sizei( attribute.asInt(), mSpan.y ) );
setSpan( Sizei( attribute.asDpDimensionI(), mSpan.y ) );
} else if ( "row-span" == name || "rowspan" == name ) {
setSpan( Sizei( mSpan.x, attribute.asInt() ) );
setSpan( Sizei( mSpan.x, attribute.asDpDimensionI() ) );
} else if ( "span" == name ) {
setSpan( Sizei( attribute.asInt(), attribute.asInt() ) );
setSpan( Sizei( attribute.asDpDimension(), attribute.asDpDimensionI() ) );
} else if ( "column-mode" == name || "columnmode" == name ) {
std::string val( attribute.asString() );
String::toLowerInPlace( val );
@@ -224,11 +224,11 @@ bool UIGridLayout::setAttribute( const NodeAttribute& attribute, const Uint32& s
} else if ( "column-weight" == name || "columnweight" == name ) {
setColumnWeight( attribute.asFloat() );
} else if ( "column-width" == name || "columnwidth" == name ) {
setColumnWidth( attribute.asInt() );
setColumnWidth( attribute.asDpDimensionI() );
} else if ( "row-weight" == name || "rowweight" == name ) {
setRowWeight( attribute.asFloat() );
setRowWeight( attribute.asDpDimension() );
} else if ( "row-height" == name || "rowheight" == name ) {
setRowHeight( attribute.asInt() );
setRowHeight( attribute.asDpDimensionI() );
} else if ( "reverse-draw" == name || "reversedraw" == name ) {
setReverseDraw( attribute.asBool() );
} else {
@@ -238,4 +238,4 @@ bool UIGridLayout::setAttribute( const NodeAttribute& attribute, const Uint32& s
return true;
}
}}
}}

View File

@@ -621,8 +621,8 @@ void UIListBox::updateScroll( bool fromScrollChange ) {
}
}
}
if ( mHScrollBar->isVisible() && !mVScrollBar->isVisible() ) {
mHScrollBar->setPosition( mHScrollPadding.Left, mDpSize.getHeight() - mHScrollBar->getSize().getHeight() + mHScrollPadding.Top );
mHScrollBar->setSize( mDpSize.getWidth() + mHScrollPadding.Right, mHScrollBar->getSize().getHeight() + mHScrollPadding.Bottom );
@@ -960,7 +960,7 @@ bool UIListBox::setAttribute( const NodeAttribute& attribute, const Uint32& stat
const std::string& name = attribute.getName();
if ( "row-height" == name || "rowheight" == name ) {
setRowHeight( attribute.asInt() );
setRowHeight( attribute.asDpDimensionI() );
} else if ( "vscroll-mode" == name || "vscrollmode" == name ) {
std::string val = attribute.asString();
if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO );

View File

@@ -304,7 +304,7 @@ bool UIPushButton::setAttribute( const NodeAttribute& attribute, const Uint32& s
} else if ( "min-icon-size" == name || "miniconsize" == name ) {
setIconMinimumSize( attribute.asSizei() );
} else if ( "icon-horizontal-margin" == name || "iconhorizontalmargin" == name ) {
setIconHorizontalMargin( attribute.asInt() );
setIconHorizontalMargin( attribute.asDpDimensionI() );
} else if ( "icon-auto-margin" == name || "iconautomargin" == name ) {
mStyleConfig.IconAutoMargin = attribute.asBool();

View File

@@ -623,7 +623,7 @@ bool UITable::setAttribute( const NodeAttribute& attribute, const Uint32& state
const std::string& name = attribute.getName();
if ( "row-height" == name || "rowheight" == name ) {
setRowHeight( attribute.asInt() );
setRowHeight( attribute.asDpDimensionI() );
} else if ( "vscroll-mode" == name || "vscrollmode" == name ) {
std::string val = attribute.asString();
if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO );

View File

@@ -1409,9 +1409,9 @@ bool UIWindow::setAttribute( const NodeAttribute& attribute, const Uint32& state
const std::string& name = attribute.getName();
if ( "width" == name ) {
setSize( attribute.asInt(), mDpSize.getHeight() );
setSize( attribute.asDpDimension(), mDpSize.getHeight() );
} else if ( "height" == name ) {
setSize( mDpSize.getWidth(), attribute.asInt() );
setSize( mDpSize.getWidth(), attribute.asDpDimension() );
} else if ( "title" == name ) {
setTitle( attribute.asString() );
} else if ( "base-alpha" == name || "basealpha" == name ) {
@@ -1460,10 +1460,10 @@ bool UIWindow::setAttribute( const NodeAttribute& attribute, const Uint32& state
mStyleConfig.MinWindowSize = attribute.asSizef();
fixChildsSize();
} else if ( "buttons-separation" == name || "buttonsseparation" == name ) {
mStyleConfig.ButtonsSeparation = attribute.asUint();
mStyleConfig.ButtonsSeparation = attribute.asDpDimensionUint();
fixChildsSize();
} else if ( "min-corner-distance" == name || "mincornerdistance" == name ) {
mStyleConfig.MinCornerDistance = attribute.asInt();
mStyleConfig.MinCornerDistance = attribute.asDpDimensionI();
} else if ( "decoration-auto-size" == name || "decorationautosize" == name ) {
mStyleConfig.DecorationAutoSize = attribute.asBool();
fixChildsSize();