Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions help/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<html>
<head>
<style type="text/css">
.odd { background-color: #e0e0e0 }
.even { background-color: #f0f0f0 }
.odd { background-color: transparent }
.even { background-color: transparent }
.key { font-weight: bold; color: #04597f }
p { margin-left: 10px }
</style>
Expand Down
14 changes: 2 additions & 12 deletions src/rviz/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -137,7 +127,7 @@ QVariant Display::getViewData( int column, int role ) const
}
else
{
return QColor( Qt::black );
return QApplication::palette().color( QPalette::Text );
}
}
break;
Expand Down Expand Up @@ -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() )
{
Expand Down
1 change: 0 additions & 1 deletion src/rviz/failed_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion src/rviz/panel_dock_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include <QApplication>
#include <QChildEvent>
#include <QHBoxLayout>
#include <QLabel>
Expand All @@ -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);
Expand Down
13 changes: 4 additions & 9 deletions src/rviz/properties/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <stdio.h> // for printf()
#include <limits.h> // for INT_MIN and INT_MAX

#include <QApplication>
#include <QPalette>
#include <QLineEdit>
#include <QSpinBox>

Expand Down Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/rviz/properties/property_tree_with_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void PropertyTreeWithHelp::showHelpForProperty( const Property* property )
{
QString body_text = property->getDescription();
QString heading = property->getName();
QString html = "<html><body bgcolor=\"#EFEBE7\"><strong>" + heading + "</strong><br>" + body_text + "</body></html>";
QString html = "<html><body><strong>" + heading + "</strong><br>" + body_text + "</body></html>";
help_->setHtml( html );
}
else
Expand Down
5 changes: 5 additions & 0 deletions src/rviz/properties/status_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#include <QApplication>
#include <QColor>
#include <QPalette>

#include "rviz/properties/property_tree_model.h"

Expand All @@ -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 )
Expand Down
5 changes: 1 addition & 4 deletions src/rviz/properties/status_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions src/rviz/view_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down