Skip to content

Commit

Permalink
Remove calls to isMaximized
Browse files Browse the repository at this point in the history
Remove some calls to `isMaximized` where we already know that the sub
window is not maximized, i.e. where these calls would always return
`false`.

One adjustment would have resulted in a call to `setHidden(false)`. This
was changed to `setVisible(true)` to get rid of the double negation.

The other `false` would have gotten in an or statement and thus could be
removed completely.
  • Loading branch information
michaelgregorius committed Oct 9, 2024
1 parent 6b953fc commit 40a90ad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/SubWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ void SubWindow::adjustTitleBar()
return;
}

// The sub window is not maximized, i.e. the title must be shown
// as well as some buttons.

// Title adjustments
m_windowTitle->show();

Expand Down Expand Up @@ -327,12 +330,12 @@ void SubWindow::adjustTitleBar()
buttonBarWidth = buttonBarWidth + m_buttonSize.width() + buttonGap;
m_maximizeBtn->move( middleButtonPos );
m_restoreBtn->move( middleButtonPos );
m_maximizeBtn->setHidden( isMaximized() );
m_maximizeBtn->setVisible(true);
}

// we're keeping the restore button around if we open projects
// from older versions that have saved minimized windows
m_restoreBtn->setVisible( isMaximized() || isMinimized() );
m_restoreBtn->setVisible(isMinimized());
if( isMinimized() )
{
m_restoreBtn->move( m_maximizeBtn->isHidden() ? middleButtonPos : leftButtonPos );
Expand Down

0 comments on commit 40a90ad

Please sign in to comment.