Commit 59fc0fe8 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Theming: Fix highlighting of focused widget in target selector

Change-Id: I477a409ed231a291fb9320ce9014853a7e21274c
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent d95775a5
...@@ -354,6 +354,7 @@ QPalette Theme::palette() const ...@@ -354,6 +354,7 @@ QPalette Theme::palette() const
pal.setBrush(QPalette::ButtonText, color(Theme::TextColorNormal)); pal.setBrush(QPalette::ButtonText, color(Theme::TextColorNormal));
pal.setBrush(QPalette::ToolTipBase, color(Theme::BackgroundColorSelected)); pal.setBrush(QPalette::ToolTipBase, color(Theme::BackgroundColorSelected));
pal.setColor(QPalette::Highlight, 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::HighlightedText, Qt::white);
pal.setColor(QPalette::ToolTipText, color(Theme::TextColorNormal)); pal.setColor(QPalette::ToolTipText, color(Theme::TextColorNormal));
return pal; return pal;
......
...@@ -135,12 +135,12 @@ void TargetSelectorDelegate::paint(QPainter *painter, ...@@ -135,12 +135,12 @@ void TargetSelectorDelegate::paint(QPainter *painter,
selectionGradient.load(QLatin1String(":/projectexplorer/images/targetpanel_gradient.png")); selectionGradient.load(QLatin1String(":/projectexplorer/images/targetpanel_gradient.png"));
if (option.state & QStyle::State_Selected) { 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) { if (creatorTheme()->widgetStyle() == Theme::StyleFlat) {
painter->fillRect(option.rect, creatorTheme()->color(Theme::BackgroundColorSelected)); painter->fillRect(option.rect, color);
} else { } else {
QColor color =(option.state & QStyle::State_HasFocus) ?
option.palette.highlight().color() :
option.palette.dark().color();
painter->fillRect(option.rect, color.darker(140)); painter->fillRect(option.rect, color.darker(140));
Utils::StyleHelper::drawCornerImage(selectionGradient, painter, option.rect.adjusted(0, 0, 0, -1), 5, 5, 5, 5); Utils::StyleHelper::drawCornerImage(selectionGradient, painter, option.rect.adjusted(0, 0, 0, -1), 5, 5, 5, 5);
painter->setPen(QColor(255, 255, 255, 60)); painter->setPen(QColor(255, 255, 255, 60));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment