Skip to content

Commit

Permalink
sc ide: fix method call popup text color in QGtkStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
jleben committed Aug 15, 2012
1 parent 0ab30b1 commit 6467e06
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions editors/sc-ide/widgets/code_editor/autocompleter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <QStandardItem>
#include <QHBoxLayout>
#include <QApplication>
#include <QGtkStyle>

namespace ScIDE {

Expand Down Expand Up @@ -173,13 +174,21 @@ class MethodCallWidget : public QWidget
MethodCallWidget( QWidget * parent = 0 ):
QWidget( parent, Qt::ToolTip )
{
QPalette p( palette() );
p.setColor( QPalette::Window, p.color(QPalette::ToolTipBase) );
setPalette(p);

mLabel = new QLabel();
mLabel->setTextFormat( Qt::RichText );
mLabel->setForegroundRole(QPalette::ToolTipText);

if (qobject_cast<QGtkStyle*>(style()) != 0) {
QPalette p;
p.setColor( QPalette::Window, QColor(255, 255, 220) );
p.setColor( QPalette::WindowText, Qt::black );
setPalette(p);
}
else {
QPalette p( palette() );
p.setColor( QPalette::Window, p.color(QPalette::ToolTipBase) );
setPalette(p);
mLabel->setForegroundRole(QPalette::ToolTipText);
}

QHBoxLayout *box = new QHBoxLayout;
box->setContentsMargins(5,2,5,2);
Expand Down

0 comments on commit 6467e06

Please sign in to comment.