Commit 9f53b0e1 authored by Alessandro Portale's avatar Alessandro Portale Committed by Tim Jenssen

ProjectExplorer: Themable miniprojecttargetselector.cpp

Replace some hard-coded colors with theme colors. That is required for
the Flat Light theme.

Change-Id: I2ce289fce8c2e6437148eb691484e0441975979f
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent b1477190
......@@ -105,7 +105,7 @@ MenuItemTextColorNormal=text
MiniProjectTargetSelectorBackgroundColor=shadowBackground
MiniProjectTargetSelectorBorderColor=shadowBackground
MiniProjectTargetSelectorSummaryBackgroundColor=shadowBackground
MiniProjectTargetSelectorTextColor=text
MiniProjectTargetSelectorTextColor=fancyBarsNormalTextColor
PanelStatusBarBackgroundColor=shadowBackground
PanelsWidgetSeparatorLineColor=0
PanelTextColorDark=text
......
......@@ -102,7 +102,7 @@ MenuItemTextColorNormal=text
MiniProjectTargetSelectorBackgroundColor=shadowBackground
MiniProjectTargetSelectorBorderColor=shadowBackground
MiniProjectTargetSelectorSummaryBackgroundColor=shadowBackground
MiniProjectTargetSelectorTextColor=text
MiniProjectTargetSelectorTextColor=fancyBarsNormalTextColor
PanelStatusBarBackgroundColor=shadowBackground
PanelsWidgetSeparatorLineColor=0
PanelTextColorDark=text
......
......@@ -101,7 +101,7 @@ MenuItemTextColorNormal=text
MiniProjectTargetSelectorBackgroundColor=shadowBackground
MiniProjectTargetSelectorBorderColor=shadowBackground
MiniProjectTargetSelectorSummaryBackgroundColor=shadowBackground
MiniProjectTargetSelectorTextColor=text
MiniProjectTargetSelectorTextColor=fancyBarsNormalTextColor
PanelStatusBarBackgroundColor=shadowBackground
PanelsWidgetSeparatorLineColor=0
PanelTextColorDark=text
......
......@@ -152,7 +152,7 @@ void TargetSelectorDelegate::paint(QPainter *painter,
QFontMetrics fm(option.font);
QString text = index.data(Qt::DisplayRole).toString();
painter->setPen(QColor(255, 255, 255, 160));
painter->setPen(creatorTheme()->color(Theme::MiniProjectTargetSelectorTextColor));
QString elidedText = fm.elidedText(text, Qt::ElideMiddle, option.rect.width() - 12);
if (elidedText != text)
const_cast<QAbstractItemModel *>(index.model())->setData(index, text, Qt::ToolTipRole);
......@@ -174,7 +174,10 @@ ListWidget::ListWidget(QWidget *parent) : QListWidget(parent)
setFocusPolicy(Qt::WheelFocus);
setItemDelegate(new TargetSelectorDelegate(this));
setAttribute(Qt::WA_MacShowFocusRect, false);
setStyleSheet(QString::fromLatin1("QListWidget { background: #464646; border-style: none; }"));
const QColor bgColor = creatorTheme()->color(Theme::MiniProjectTargetSelectorBackgroundColor);
const QString bgColorName = creatorTheme()->flag(Theme::FlatToolBars)
? bgColor.lighter(120).name() : bgColor.name();
setStyleSheet(QString::fromLatin1("QListWidget { background: %1; border-style: none; }").arg(bgColorName));
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
}
......
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