forked from qt-creator/qt-creator
Theming: Fix highlighting of focused widget in target selector
Change-Id: I477a409ed231a291fb9320ce9014853a7e21274c Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
d95775a54c
commit
59fc0fe8f2
@@ -354,6 +354,7 @@ QPalette Theme::palette() const
|
||||
pal.setBrush(QPalette::ButtonText, color(Theme::TextColorNormal));
|
||||
pal.setBrush(QPalette::ToolTipBase, color(Theme::BackgroundColorSelected));
|
||||
pal.setColor(QPalette::Highlight, color(Theme::BackgroundColorSelected));
|
||||
pal.setColor(QPalette::Dark, color(Theme::BackgroundColorDark));
|
||||
pal.setColor(QPalette::HighlightedText, Qt::white);
|
||||
pal.setColor(QPalette::ToolTipText, color(Theme::TextColorNormal));
|
||||
return pal;
|
||||
|
@@ -135,12 +135,12 @@ void TargetSelectorDelegate::paint(QPainter *painter,
|
||||
selectionGradient.load(QLatin1String(":/projectexplorer/images/targetpanel_gradient.png"));
|
||||
|
||||
if (option.state & QStyle::State_Selected) {
|
||||
const QColor color = (option.state & QStyle::State_HasFocus) ?
|
||||
option.palette.highlight().color() :
|
||||
option.palette.dark().color();
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleFlat) {
|
||||
painter->fillRect(option.rect, creatorTheme()->color(Theme::BackgroundColorSelected));
|
||||
painter->fillRect(option.rect, color);
|
||||
} else {
|
||||
QColor color =(option.state & QStyle::State_HasFocus) ?
|
||||
option.palette.highlight().color() :
|
||||
option.palette.dark().color();
|
||||
painter->fillRect(option.rect, color.darker(140));
|
||||
Utils::StyleHelper::drawCornerImage(selectionGradient, painter, option.rect.adjusted(0, 0, 0, -1), 5, 5, 5, 5);
|
||||
painter->setPen(QColor(255, 255, 255, 60));
|
||||
|
Reference in New Issue
Block a user