Skip to content

Commit

Permalink
added more contrast to sound overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Nov 21, 2024
1 parent 764cb24 commit 7d71723
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions SoundOverlay/SoundOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ void SoundOverlay::paintEvent(QPaintEvent *event)
// Get the main background color from the widget's palette
QColor main_bg_color = this->palette().color(QPalette::Window);

if (Utils::isDarkMode(main_bg_color)) {
main_bg_color = main_bg_color.lighter(140);
} else {
main_bg_color = main_bg_color.darker(110);
}
// Set the brush to fill the rectangle with the background color
painter.setBrush(main_bg_color);
painter.setPen(Qt::NoPen); // No border for background fill
Expand All @@ -58,11 +63,6 @@ void SoundOverlay::paintEvent(QPaintEvent *event)
borderPen.setWidth(1);
painter.setPen(borderPen);
painter.setBrush(Qt::NoBrush); // No fill for border

// Draw the border around the adjusted rectangle
QPainterPath borderPath;
borderPath.addRoundedRect(this->rect().adjusted(0, 0, -1, -1), 8, 8); // Full size for outer border
painter.drawPath(borderPath);
}

void SoundOverlay::animateIn()
Expand Down
5 changes: 4 additions & 1 deletion SoundOverlay/SoundOverlay.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
<x>0</x>
<y>0</y>
<width>216</width>
<height>47</height>
<height>50</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconLabel">
<property name="text">
Expand Down

0 comments on commit 7d71723

Please sign in to comment.