diff --git a/help/help.html b/help/help.html
index 73cf9f0f3b..0fa2c00bbe 100644
--- a/help/help.html
+++ b/help/help.html
@@ -8,8 +8,8 @@
diff --git a/src/rviz/display.cpp b/src/rviz/display.cpp
index 502ed0ea3c..8adc98bb9d 100644
--- a/src/rviz/display.cpp
+++ b/src/rviz/display.cpp
@@ -108,16 +108,6 @@ QVariant Display::getViewData( int column, int role ) const
{
switch( role )
{
- case Qt::BackgroundRole:
- {
- /*
- QLinearGradient q( 0,0, 0,5 );
- q.setColorAt( 0.0, QColor(230,230,230) );
- q.setColorAt( 1.0, Qt::white );
- return QBrush( q );
- */
- return QColor( Qt::white );
- }
case Qt::ForegroundRole:
{
// if we're item-enabled (not greyed out) and in warn/error state, set appropriate color
@@ -137,7 +127,7 @@ QVariant Display::getViewData( int column, int role ) const
}
else
{
- return QColor( Qt::black );
+ return QApplication::palette().color( QPalette::Text );
}
}
break;
@@ -199,7 +189,7 @@ void Display::setStatusInternal( int level, const QString& name, const QString&
addChild( status_, 0 );
}
StatusProperty::Level old_level = status_->getLevel();
-
+
status_->setStatus( (StatusProperty::Level) level, name, text );
if( model_ && old_level != status_->getLevel() )
{
diff --git a/src/rviz/failed_display.cpp b/src/rviz/failed_display.cpp
index 1f907e75a3..10318d49c4 100644
--- a/src/rviz/failed_display.cpp
+++ b/src/rviz/failed_display.cpp
@@ -51,7 +51,6 @@ QVariant FailedDisplay::getViewData( int column, int role ) const
{
switch( role )
{
- case Qt::BackgroundRole: return QColor( Qt::white );
case Qt::ForegroundRole: return StatusProperty::statusColor( StatusProperty::Error );
default: break;
}
diff --git a/src/rviz/panel_dock_widget.cpp b/src/rviz/panel_dock_widget.cpp
index 0bb1ac2b00..7d22a3c7aa 100644
--- a/src/rviz/panel_dock_widget.cpp
+++ b/src/rviz/panel_dock_widget.cpp
@@ -27,6 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include
#include
#include
#include
@@ -46,7 +47,7 @@ PanelDockWidget::PanelDockWidget( const QString& name )
QWidget *title_bar = new QWidget(this);
QPalette pal(palette());
- pal.setColor(QPalette::Background, QColor( 200,200,200 ) );
+ pal.setColor(QPalette::Background, QApplication::palette().color( QPalette::Mid ) );
title_bar->setAutoFillBackground(true);
title_bar->setPalette(pal);
title_bar->setContentsMargins(0,0,0,0);
diff --git a/src/rviz/properties/property.cpp b/src/rviz/properties/property.cpp
index 9b15170d41..428b83d5c8 100644
--- a/src/rviz/properties/property.cpp
+++ b/src/rviz/properties/property.cpp
@@ -30,6 +30,8 @@
#include // for printf()
#include // for INT_MIN and INT_MAX
+#include
+#include
#include
#include
@@ -235,15 +237,8 @@ void Property::setParent( Property* new_parent )
QVariant Property::getViewData( int column, int role ) const
{
- if ( role == Qt::TextColorRole &&
- ( parent_ && parent_->getDisableChildren() ) )
- {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return Qt::gray;
-#else
- return QColor(Qt::gray);
-#endif
- }
+ if ( role == Qt::TextColorRole && parent_ && parent_->getDisableChildren() )
+ return QApplication::palette().brush(QPalette::Disabled, QPalette::Text);
switch( column )
{
diff --git a/src/rviz/properties/property_tree_with_help.cpp b/src/rviz/properties/property_tree_with_help.cpp
index d9d74e7c47..fc551ab694 100644
--- a/src/rviz/properties/property_tree_with_help.cpp
+++ b/src/rviz/properties/property_tree_with_help.cpp
@@ -68,7 +68,7 @@ void PropertyTreeWithHelp::showHelpForProperty( const Property* property )
{
QString body_text = property->getDescription();
QString heading = property->getName();
- QString html = "" + heading + "
" + body_text + "";
+ QString html = "" + heading + "
" + body_text + "";
help_->setHtml( html );
}
else
diff --git a/src/rviz/properties/status_property.cpp b/src/rviz/properties/status_property.cpp
index e0b8a6f280..1706342ecb 100644
--- a/src/rviz/properties/status_property.cpp
+++ b/src/rviz/properties/status_property.cpp
@@ -27,7 +27,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include
#include
+#include
#include "rviz/properties/property_tree_model.h"
@@ -48,6 +50,9 @@ StatusProperty::StatusProperty( const QString& name, const QString& text, Level
status_icons_[0] = loadPixmap( "package://rviz/icons/ok.png" );
status_icons_[1] = loadPixmap( "package://rviz/icons/warning.png" );
status_icons_[2] = loadPixmap( "package://rviz/icons/error.png" );
+
+ if (!status_colors_[0].isValid()) // initialize default text color once
+ status_colors_[0] = QApplication::palette().color( QPalette::Text );
}
bool StatusProperty::setValue( const QVariant& new_value )
diff --git a/src/rviz/properties/status_property.h b/src/rviz/properties/status_property.h
index 038ab72aa3..8db783ad09 100644
--- a/src/rviz/properties/status_property.h
+++ b/src/rviz/properties/status_property.h
@@ -56,10 +56,7 @@ Q_OBJECT
* 1) for this StatusProperty. */
virtual Qt::ItemFlags getViewFlags( int column ) const;
- /** @brief Return the color appropriate for the given status level.
- *
- * Returns an invalid QColor for Ok status, meaning we should use
- * the default text color. */
+ /** @brief Return the color appropriate for the given status level. */
static QColor statusColor( Level level );
/** @brief Return the word appropriate for the given status level:
diff --git a/src/rviz/view_controller.cpp b/src/rviz/view_controller.cpp
index 2cd9322676..7c7289616e 100644
--- a/src/rviz/view_controller.cpp
+++ b/src/rviz/view_controller.cpp
@@ -144,18 +144,12 @@ QString ViewController::formatClassId( const QString& class_id )
QVariant ViewController::getViewData( int column, int role ) const
{
if ( role == Qt::TextColorRole )
- {
return QVariant();
- }
if( is_active_ )
{
switch( role )
{
- case Qt::BackgroundRole:
- {
- return QColor( 0xba, 0xad, 0xa4 );
- }
case Qt::FontRole:
{
QFont font;