From ffcf72deaf30e351d32171b5f83dcecdb138dca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Mon, 4 Nov 2019 19:55:25 -0300 Subject: [PATCH] Minor fixes. --HG-- branch : dev --- src/eepp/ui/uigridlayout.cpp | 16 ++++++++-------- src/eepp/ui/uilistbox.cpp | 6 +++--- src/eepp/ui/uipushbutton.cpp | 2 +- src/eepp/ui/uitable.cpp | 2 +- src/eepp/ui/uiwindow.cpp | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/eepp/ui/uigridlayout.cpp b/src/eepp/ui/uigridlayout.cpp index bb6c1bf49..6f65f7fe2 100644 --- a/src/eepp/ui/uigridlayout.cpp +++ b/src/eepp/ui/uigridlayout.cpp @@ -2,7 +2,7 @@ #include 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; } -}} +}} diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index 3395b6435..7e600c837 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -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 ); diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index 66a102e29..8d060f490 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -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(); diff --git a/src/eepp/ui/uitable.cpp b/src/eepp/ui/uitable.cpp index 4d8b1c7e9..02b323b49 100644 --- a/src/eepp/ui/uitable.cpp +++ b/src/eepp/ui/uitable.cpp @@ -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 ); diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index ce60c91e9..93902c0b0 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -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();