diff --git a/bin/assets/layouts/test.css b/bin/assets/layouts/test.css index e2830b334..2f60818f8 100644 --- a/bin/assets/layouts/test.css +++ b/bin/assets/layouts/test.css @@ -32,7 +32,7 @@ PopUpMenu { minRightMargin: 8dp; } -Menu:hover, +Menu:hover, PopUpMenu:hover, Menu::Item:hover, Menu::CheckBox:hover, @@ -44,7 +44,7 @@ Tab:pressed { textColor: #FFF; } -Slider { +Slider { halfSlider: true; backgroundColor: #555; } @@ -328,3 +328,7 @@ TabWidget { padding: 16dp; layout_marginBottom: 140dp; } + +#test_5 TextView { + padding: 8dp; +} diff --git a/bin/assets/layouts/test.xml b/bin/assets/layouts/test.xml index 5cb411c7c..5364a6977 100644 --- a/bin/assets/layouts/test.xml +++ b/bin/assets/layouts/test.xml @@ -38,13 +38,13 @@ - + - + - + @@ -68,10 +68,19 @@ - + + + + + + + + + + diff --git a/src/eepp/ui/css/stylesheet.cpp b/src/eepp/ui/css/stylesheet.cpp index da58a5ca7..82818f2a1 100644 --- a/src/eepp/ui/css/stylesheet.cpp +++ b/src/eepp/ui/css/stylesheet.cpp @@ -9,7 +9,16 @@ namespace EE { namespace UI { namespace CSS { StyleSheet::StyleSheet() {} void StyleSheet::addStyle( const StyleSheetStyle& node ) { - mNodes[ node.getSelector().getName() ] = node; + auto nodeIt = mNodes.find( node.getSelector().getName() ); + + if ( nodeIt == mNodes.end() ) { + mNodes[ node.getSelector().getName() ] = node; + } else { + StyleSheetStyle& currentNode = nodeIt->second; + + for ( auto& pit : node.getProperties() ) + currentNode.setProperty( pit.second ); + } } void StyleSheet::combineStyle( const StyleSheetStyle& node ) { @@ -18,7 +27,7 @@ void StyleSheet::combineStyle( const StyleSheetStyle& node ) { if ( nodeIt == mNodes.end() ) { addStyle( node ); } else { - auto currentNode = nodeIt->second; + auto& currentNode = nodeIt->second; if ( node.getSelector().getSpecificity() > currentNode.getSelector().getSpecificity() ) { for ( auto& pit : node.getProperties() ) diff --git a/src/eepp/ui/uinode.cpp b/src/eepp/ui/uinode.cpp index 2bb1a15d8..854a1f0ca 100644 --- a/src/eepp/ui/uinode.cpp +++ b/src/eepp/ui/uinode.cpp @@ -620,13 +620,20 @@ void UINode::internalDraw() { if ( mNodeFlags & NODE_FLAG_POSITION_DIRTY ) updateScreenPos(); + if ( mNodeFlags & NODE_FLAG_POLYGON_DIRTY ) + updateWorldPolygon(); + matrixSet(); clipStart(); - draw(); + if ( mWorldBounds.intersect( mSceneNode->getWorldBounds() ) ) { + draw(); - drawChilds(); + drawChilds(); + } else if ( !isClipped() ) { + drawChilds(); + } clipEnd();