Skip to content

Commit

Permalink
Remove dependency on MdiArea
Browse files Browse the repository at this point in the history
Remove a dependency on the `MdiArea` when checking if the sub window is
the active one. Query its own window state to find out if it is active.
  • Loading branch information
michaelgregorius committed Sep 22, 2024
1 parent cdef4b5 commit 0921c97
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/gui/SubWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ void SubWindow::paintEvent( QPaintEvent * )
QPainter p( this );
QRect rect( 0, 0, width(), m_titleBarHeight );

bool isActive = mdiArea()
? mdiArea()->activeSubWindow() == this
: false;
const bool isActive = windowState() & Qt::WindowActive;

p.fillRect( rect, isActive ? activeColor() : p.pen().brush() );

Expand Down

0 comments on commit 0921c97

Please sign in to comment.