From cbd2d6e4342517d14e146b458a630bd217f0044e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 24 Jul 2014 13:25:49 +0000 Subject: [PATCH] Refined the colouring of widget to be more in sync with the defaults used in Qt. git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14384 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgUI/ComboBox.cpp | 4 ++-- src/osgUI/Dialog.cpp | 2 +- src/osgUI/LineEdit.cpp | 4 +++- src/osgUI/PushButton.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/osgUI/ComboBox.cpp b/src/osgUI/ComboBox.cpp index 5c2125da1..bdf4ae159 100644 --- a/src/osgUI/ComboBox.cpp +++ b/src/osgUI/ComboBox.cpp @@ -171,9 +171,9 @@ void ComboBox::createGraphicsImplementation() osg::ref_ptr group = new osg::Group; bool requiresFrame = (getFrameSettings() && getFrameSettings()->getShape()!=osgUI::FrameSettings::NO_FRAME); float frameWidth = 0.0; + osg::Vec4 frameColor(0.97f,0.97f,0.97f,1.0f); if (requiresFrame) { - osg::Vec4 frameColor(0.75f,0.75f,0.75f,1.0f); frameWidth = getFrameSettings()->getLineWidth(); group->addChild(style->createFrame(_extents, getFrameSettings(), frameColor)); @@ -234,7 +234,7 @@ void ComboBox::createGraphicsImplementation() } else { - _buttonSwitch->addChild( style->createPanel(_extents, osg::Vec4(1.0f,1.0f,1.0f,1.0f)) ); + _buttonSwitch->addChild( style->createPanel(_extents, frameColor) ); } _buttonSwitch->setSingleChildOn(_currentItem); diff --git a/src/osgUI/Dialog.cpp b/src/osgUI/Dialog.cpp index 47bb99b0c..7b6f53f96 100644 --- a/src/osgUI/Dialog.cpp +++ b/src/osgUI/Dialog.cpp @@ -58,7 +58,7 @@ void Dialog::createGraphicsImplementation() float titleHeight = 10.0; osg::BoundingBox titleBarExents(_extents.xMin(), _extents.yMax(), _extents.zMin(), _extents.xMax(), _extents.yMax()+titleHeight, _extents.zMin()); - osg::Vec4 dialogBackgroundColor(0.8,0.8,0.8,1.0); + osg::Vec4 dialogBackgroundColor(0.84,0.82,0.82,1.0); osg::Vec4 dialogTitleBackgroundColor(0.5,0.5,1.0,1.0); _group->addChild( style->createPanel(_extents, dialogBackgroundColor) ); diff --git a/src/osgUI/LineEdit.cpp b/src/osgUI/LineEdit.cpp index 0e3bcba1d..5dd0637dc 100644 --- a/src/osgUI/LineEdit.cpp +++ b/src/osgUI/LineEdit.cpp @@ -81,7 +81,7 @@ void LineEdit::createGraphicsImplementation() osg::ref_ptr group = new osg::Group; osg::BoundingBox extents(_extents); - osg::Vec4 frameColor(0.75f,0.75f,0.75f,1.0f); + osg::Vec4 frameColor(1.0f,1.0f,1.0f,1.0f); bool requiresFrame = (getFrameSettings() && getFrameSettings()->getShape()!=osgUI::FrameSettings::NO_FRAME); if (requiresFrame) @@ -93,6 +93,8 @@ void LineEdit::createGraphicsImplementation() extents.yMax() -= getFrameSettings()->getLineWidth(); } + // clear background of edit region + group->addChild(style->createPanel(extents, frameColor)); osg::ref_ptr node = style->createText(extents, getAlignmentSettings(), getTextSettings(), _text); _textDrawable = dynamic_cast(node.get()); diff --git a/src/osgUI/PushButton.cpp b/src/osgUI/PushButton.cpp index fed21bd84..43060c53e 100644 --- a/src/osgUI/PushButton.cpp +++ b/src/osgUI/PushButton.cpp @@ -77,11 +77,11 @@ void PushButton::createGraphicsImplementation() _buttonSwitch = new osg::Switch; - float unFocused = 0.7; - float withFocus = 0.8; - float pressed = 0.5; + float unFocused = 0.92; + float withFocus = 0.97; + float pressed = 0.75; - osg::Vec4 frameColor(0.75f,0.75f,0.75f,1.0f); + osg::Vec4 frameColor(unFocused,unFocused,unFocused,1.0f); osg::BoundingBox extents(_extents);