Skip to content

Commit

Permalink
Gui: restore minimize button checked state (#615)
Browse files Browse the repository at this point in the history
Restore minimize button checked state on project load.
  • Loading branch information
rodlie committed May 3, 2021
1 parent 591ad9a commit b5a45f7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Gui/DockablePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,16 @@ DockablePanel::restoreHideUnmodifiedState(bool hideUnmodified)
onHideUnmodifiedButtonClicked(hideUnmodified);
}

void
DockablePanel::restoreMinimizedState(bool minimized)
{
if (!_imp->_minimize) {
return;
}
_imp->_minimize->setChecked(minimized);
minimizeOrMaximize(minimized);
}

FloatingWidget*
DockablePanel::floatPanel()
{
Expand Down
1 change: 1 addition & 0 deletions Gui/DockablePanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON
FloatingWidget* getFloatingWindow() const;

void restoreHideUnmodifiedState(bool hideUnmodified);
void restoreMinimizedState(bool minimized);

public:

Expand Down
2 changes: 1 addition & 1 deletion Gui/Gui15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Gui::setVisibleProjectSettingsPanel(bool minimized)
addVisibleDockablePanel( _imp->_projectGui->getPanel() );
}
if (minimized) {
_imp->_projectGui->getPanel()->minimizeOrMaximize(true);
_imp->_projectGui->getPanel()->restoreMinimizedState(true);
}
if ( !_imp->_projectGui->isVisible() ) {
_imp->_projectGui->setVisible(true);
Expand Down
2 changes: 1 addition & 1 deletion Gui/NodeGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ NodeGui::ensurePanelCreated(bool minimized, bool hideUnmodified)
}

if (minimized) {
_settingsPanel->minimizeOrMaximize(true);
_settingsPanel->restoreMinimizedState(true);
}

const std::list<ViewerTab*>& viewers = getDagGui()->getGui()->getViewersList();
Expand Down

0 comments on commit b5a45f7

Please sign in to comment.