Skip to content

Commit

Permalink
Tiled Fusion: Improved visibility of group box frame in dark style
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn committed Aug 12, 2016
1 parent 3f1b8ff commit 6deefd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions src/tiled/tiledproxystyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ void TiledProxyStyle::drawPrimitive(PrimitiveElement element,
const QWidget *widget) const
{
switch (element) {
case PE_FrameGroupBox:
{
int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + 3;
QRect frame = option->rect.adjusted(0, topMargin, -1, -1);
QColor tabFrameColor = getTabFrameColor(option->palette);

painter->save();
painter->setRenderHint(QPainter::Antialiasing);
painter->translate(0.5, 0.5);
painter->setPen(mergedColors(getOutlineColor(option->palette), tabFrameColor));
painter->setBrush(mergedColors(option->palette.window().color(), tabFrameColor));
painter->drawRoundedRect(frame, 2.0, 2.0);
painter->restore();
break;
}
case PE_FrameTabBarBase:
if (const QStyleOptionTabBarBase *tbb
= qstyleoption_cast<const QStyleOptionTabBarBase *>(option)) {
Expand Down
4 changes: 2 additions & 2 deletions src/tiled/tiledproxystyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class TiledProxyStyle : public QProxyStyle
const QWidget *widget = nullptr) const override;

int pixelMetric(PixelMetric metric,
const QStyleOption *option,
const QWidget *widget) const override;
const QStyleOption *option = nullptr,
const QWidget *widget = nullptr) const override;

QSize sizeFromContents(ContentsType type,
const QStyleOption *option,
Expand Down

0 comments on commit 6deefd5

Please sign in to comment.