diff --git a/include/osgUI/Style b/include/osgUI/Style index 7cab2dabe..bd7b17675 100644 --- a/include/osgUI/Style +++ b/include/osgUI/Style @@ -51,7 +51,7 @@ public: virtual osg::Node* createFrame(const osg::BoundingBox& extents, const FrameSettings* frameSettings, const osg::Vec4& colour); virtual osg::Node* createText(const osg::BoundingBox& extents, const AlignmentSettings* as, const TextSettings* textSettings, const std::string& text); virtual osg::Node* createIcon(const osg::BoundingBox& extents, const std::string& filename, const osg::Vec4& colour); - virtual void setupDialogStateSet(osg::StateSet* stateset); + virtual void setupDialogStateSet(osg::StateSet* stateset, int binNum); virtual void setupClipStateSet(const osg::BoundingBox& extents, osg::StateSet* stateset); protected: diff --git a/src/osgUI/ComboBox.cpp b/src/osgUI/ComboBox.cpp index 814e1cab1..29272e0d0 100644 --- a/src/osgUI/ComboBox.cpp +++ b/src/osgUI/ComboBox.cpp @@ -242,9 +242,11 @@ void ComboBox::createGraphicsImplementation() // float itemWidth = (_extents.xMax()-_extents.xMin()) - 2.0f*frameWidth; float itemHeight = (_extents.yMax()-_extents.yMin()) - 2.0f*frameWidth; float popupHeight = (itemHeight)* _items.size() + margin*static_cast(_items.size()-1) + 2.0f*frameWidth; - float popupTop = _extents.yMin()-frameWidth-50.0f; + float popupTop = _extents.yMin()-frameWidth-margin*1.0f; + float popupLeft = _extents.xMin(); + float popupRight = _extents.xMax(); - osg::BoundingBox popupExtents(_extents.xMin(), popupTop-popupHeight, _extents.zMin(), _extents.xMax(), popupTop, _extents.zMax()); + osg::BoundingBox popupExtents(popupLeft, popupTop-popupHeight, _extents.zMin(), popupRight, popupTop, _extents.zMax()); _popup->setExtents(popupExtents); osg::BoundingBox popupItemExtents(popupExtents.xMin()+frameWidth, popupTop-frameWidth-itemHeight, popupExtents.zMin(), popupExtents.xMax()-frameWidth, popupTop-frameWidth, popupExtents.zMax()); diff --git a/src/osgUI/Dialog.cpp b/src/osgUI/Dialog.cpp index 7b6f53f96..890bea42f 100644 --- a/src/osgUI/Dialog.cpp +++ b/src/osgUI/Dialog.cpp @@ -79,7 +79,7 @@ void Dialog::createGraphicsImplementation() _titleDrawable->setDataVariance(osg::Object::DYNAMIC); _group->addChild(_titleDrawable.get()); - style->setupDialogStateSet(getOrCreateStateSet()); + style->setupDialogStateSet(getOrCreateStateSet(), 5); style->setupClipStateSet(dialogWithTileExtents, getOrCreateStateSet()); // render before the subgraph diff --git a/src/osgUI/Popup.cpp b/src/osgUI/Popup.cpp index 0037fae46..1ac139d1d 100644 --- a/src/osgUI/Popup.cpp +++ b/src/osgUI/Popup.cpp @@ -77,7 +77,7 @@ void Popup::createGraphicsImplementation() bool requiresFrame = (getFrameSettings() && getFrameSettings()->getShape()!=osgUI::FrameSettings::NO_FRAME); if (requiresFrame) { _transform->addChild(style->createFrame(_extents, getFrameSettings(), dialogBackgroundColor)); } - style->setupDialogStateSet(getOrCreateStateSet()); + style->setupDialogStateSet(getOrCreateStateSet(), 6); style->setupClipStateSet(_extents, getOrCreateStateSet()); diff --git a/src/osgUI/Style.cpp b/src/osgUI/Style.cpp index 03c9a3c1a..46518d2b4 100644 --- a/src/osgUI/Style.cpp +++ b/src/osgUI/Style.cpp @@ -411,11 +411,12 @@ osg::Node* Style::createIcon(const osg::BoundingBox& extents, const std::string& } } -void Style::setupDialogStateSet(osg::StateSet* stateset) +void Style::setupDialogStateSet(osg::StateSet* stateset, int binNum) { - stateset->setRenderBinDetails(5, "TraversalOrderBin", osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); + stateset->setRenderBinDetails(binNum, "TraversalOrderBin", osg::StateSet::OVERRIDE_PROTECTED_RENDERBIN_DETAILS); stateset->setMode( GL_LIGHTING, osg::StateAttribute::OFF ); stateset->setAttributeAndModes( _disabledDepthWrite.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE ); + stateset->setNestRenderBins(false); } void Style::setupClipStateSet(const osg::BoundingBox& extents, osg::StateSet* stateset)