Skip to content

Commit 440d4b0

Browse files
authored
Make window border colors more prominent (#102)
Change window border colors to match Adwaita header bars, especially in dark mode. Also create a separate color for window shadows matching the old border color so they are not affected, which fixes a bug making window shadows bright if opened in light mode.
1 parent 9a3ea65 commit 440d4b0

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/qadwaitadecorations.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ void QAdwaitaDecorations::updateColors(bool useDarkColors)
187187
{ BackgroundInactive, useDarkColors ? QColor(0x222226) : QColor(0xfafafb) },
188188
{ Foreground, useDarkColors ? QColor(0xffffff) : QColor(0x333338) },
189189
{ ForegroundInactive, useDarkColors ? QColor(0x919193) : QColor(0x969699) },
190-
{ Border, useDarkColors ? QColor(0x2e2e32) : QColor(0xffffff) },
191-
{ BorderInactive, useDarkColors ? QColor(0x2e2e32) : QColor(0xffffff) },
190+
{ Border, useDarkColors ? QColor(0x3d3d40) : QColor(0xc8c8c8) },
191+
{ BorderInactive, useDarkColors ? QColor(0x313135) : QColor(0xe2e2e2) },
192+
{ Shadow, useDarkColors ? QColor(0x2e2e32) : QColor(0x2e2e32) },
192193
{ ButtonBackground, useDarkColors ? QColor(0x434347) : QColor(0xebebeb) },
193194
{ ButtonBackgroundInactive, useDarkColors ? QColor(0x2d2d31) : QColor(0xf0f0f1) },
194195
{ HoveredButtonBackground, useDarkColors ? QColor(0x4d4d51) : QColor(0xe0e0e1) },
@@ -395,8 +396,8 @@ void QAdwaitaDecorations::paint(QPaintDevice *device)
395396

396397
const QRect surfaceRect = windowContentGeometry();
397398

398-
const QColor borderColor = active ? makeTransparent(m_colors[Border], 0.5)
399-
: makeTransparent(m_colors[BorderInactive], 0.5);
399+
const QColor shadowColor = makeTransparent(m_colors[Shadow], 0.5);
400+
const QColor borderColor = active ? m_colors[Border] : m_colors[BorderInactive];
400401
const QColor backgroundColor = active ? m_colors[Background] : m_colors[BackgroundInactive];
401402
const QColor foregroundColor = active ? m_colors[Foreground] : m_colors[ForegroundInactive];
402403

@@ -419,7 +420,7 @@ void QAdwaitaDecorations::paint(QPaintDevice *device)
419420
(surfaceRect.height() / 2) - ceShadowsWidth));
420421

421422
QPainter tmpPainter(&source);
422-
tmpPainter.setBrush(borderColor);
423+
tmpPainter.setBrush(shadowColor);
423424
tmpPainter.drawRoundedRect(topHalf, ceCornerRadius, ceCornerRadius);
424425
tmpPainter.drawRect(bottomHalf);
425426
tmpPainter.end();

src/qadwaitadecorations.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class QAdwaitaDecorations : public QWaylandAbstractDecoration
4343
ForegroundInactive,
4444
Border,
4545
BorderInactive,
46+
Shadow,
4647
ButtonBackground,
4748
ButtonBackgroundInactive,
4849
HoveredButtonBackground,

0 commit comments

Comments
 (0)