forked from qt-creator/qt-creator
Improve sidebar readability on mac
Slightly increased the font size. Added a bit more shadow and tweaked the progress bar.
This commit is contained in:
@@ -69,7 +69,7 @@ QColor StyleHelper::mergedColors(const QColor &colorA, const QColor &colorB, int
|
|||||||
qreal StyleHelper::sidebarFontSize()
|
qreal StyleHelper::sidebarFontSize()
|
||||||
{
|
{
|
||||||
#if defined(Q_WS_MAC)
|
#if defined(Q_WS_MAC)
|
||||||
return 9;
|
return 10;
|
||||||
#else
|
#else
|
||||||
return 7.5;
|
return 7.5;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
|
|||||||
painter.drawText(r, textFlags, ellidedBuildConfiguration);
|
painter.drawText(r, textFlags, ellidedBuildConfiguration);
|
||||||
QStyleOption opt;
|
QStyleOption opt;
|
||||||
opt.initFrom(this);
|
opt.initFrom(this);
|
||||||
opt.rect = rect().adjusted(rect().width() - 18, 0, -10, 0);
|
opt.rect = rect().adjusted(rect().width() - 16, 0, -8, 0);
|
||||||
Utils::StyleHelper::drawArrow(QStyle::PE_IndicatorArrowRight, &painter, &opt);
|
Utils::StyleHelper::drawArrow(QStyle::PE_IndicatorArrowRight, &painter, &opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const
|
|||||||
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
|
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
|
||||||
boldFont.setBold(true);
|
boldFont.setBold(true);
|
||||||
painter->setFont(boldFont);
|
painter->setFont(boldFont);
|
||||||
painter->setPen(selected ? QColor(255, 255, 255, 160) : QColor(30, 30, 30, 80));
|
painter->setPen(selected ? QColor(255, 255, 255, 160) : QColor(0, 0, 0, 110));
|
||||||
int textFlags = Qt::AlignCenter | Qt::AlignBottom | Qt::ElideRight | Qt::TextWordWrap;
|
int textFlags = Qt::AlignCenter | Qt::AlignBottom | Qt::ElideRight | Qt::TextWordWrap;
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
painter->drawText(tabTextRect, textFlags, tabText);
|
painter->drawText(tabTextRect, textFlags, tabText);
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
|||||||
QRect textRect = rect().adjusted(INDENT + 1, 1, -INDENT - 1, 0);
|
QRect textRect = rect().adjusted(INDENT + 1, 1, -INDENT - 1, 0);
|
||||||
textRect.setHeight(h+5);
|
textRect.setHeight(h+5);
|
||||||
|
|
||||||
p.setPen(QColor(30, 30, 30, 80));
|
p.setPen(QColor(0, 0, 0, 120));
|
||||||
p.drawText(textRect, alignment | Qt::AlignBottom, m_title);
|
p.drawText(textRect, alignment | Qt::AlignBottom, m_title);
|
||||||
p.translate(0, -1);
|
p.translate(0, -1);
|
||||||
p.setPen(Utils::StyleHelper::panelTextColor());
|
p.setPen(Utils::StyleHelper::panelTextColor());
|
||||||
@@ -213,10 +213,11 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
|||||||
p.setBrush(grad);
|
p.setBrush(grad);
|
||||||
p.drawRect(inner);
|
p.drawRect(inner);
|
||||||
p.setBrush(Qt::NoBrush);
|
p.setBrush(Qt::NoBrush);
|
||||||
p.setPen(QPen(QColor(0, 0, 0, 60), 1));
|
p.setPen(QPen(QColor(0, 0, 0, 30), 1));
|
||||||
p.drawLine(inner.topLeft(), inner.topRight());
|
p.drawLine(inner.topLeft(), inner.topRight());
|
||||||
p.drawLine(inner.topLeft(), inner.bottomLeft());
|
p.drawLine(inner.topLeft(), inner.bottomLeft());
|
||||||
p.drawLine(inner.topRight(), inner.bottomRight());
|
p.drawLine(inner.topRight(), inner.bottomRight());
|
||||||
|
p.drawLine(inner.bottomLeft(), inner.bottomRight());
|
||||||
p.drawPoint(inner.bottomLeft());
|
p.drawPoint(inner.bottomLeft());
|
||||||
p.drawPoint(inner.bottomRight());
|
p.drawPoint(inner.bottomRight());
|
||||||
|
|
||||||
@@ -224,7 +225,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
|||||||
if (value() < maximum() && !m_error) {
|
if (value() < maximum() && !m_error) {
|
||||||
QRect parentRect = parentWidget()->rect(); // ### Move to parent
|
QRect parentRect = parentWidget()->rect(); // ### Move to parent
|
||||||
QRect cancelRect(parentRect.right() - CANCEL_WIDTH - 2,
|
QRect cancelRect(parentRect.right() - CANCEL_WIDTH - 2,
|
||||||
parentRect.top() + 5, CANCEL_WIDTH, CANCEL_WIDTH);
|
parentRect.top() + 4, CANCEL_WIDTH, CANCEL_WIDTH);
|
||||||
|
|
||||||
bool hover = cancelRect.contains(mapFromGlobal(QCursor::pos()));
|
bool hover = cancelRect.contains(mapFromGlobal(QCursor::pos()));
|
||||||
p.setPen(QPen(QColor(0, 0, 0, 20), 4));
|
p.setPen(QPen(QColor(0, 0, 0, 20), 4));
|
||||||
|
|||||||
Reference in New Issue
Block a user