Fix inacurate ratio in Distraction Free mode

pull/9778/head
Don HO 2021-04-14 04:38:07 +02:00
parent 432ad06108
commit 94dffc6da8
1 changed files with 7 additions and 7 deletions

View File

@ -5471,10 +5471,6 @@ void Notepad_plus::distractionFreeToggle()
// Enable or disable Distraction Free Mode
if (_beforeSpecialView._isDistractionFree) // disable it
{
// restore padding
paddingLeft = svp._paddingLeft;
paddingRight = svp._paddingRight;
// restore another view if 2 views mode was on
if (_beforeSpecialView._was2ViewModeOn)
{
@ -5489,15 +5485,16 @@ void Notepad_plus::distractionFreeToggle()
}
_dockingManager.resize();
// restore padding
paddingLeft = svp._paddingLeft;
paddingRight = svp._paddingRight;
// hide restore button
_restoreButton.setButtonStatus(0);
_restoreButton.display(false);
}
else // enable it
{
// set padding
paddingLeft = paddingRight = svp.getDistractionFreePadding(_pEditView->getWidth());
// check if 2 views mode is on
ScintillaEditView & nonFocusedView = (otherView() == MAIN_VIEW) ? _mainEditView : _subEditView;
if (nonFocusedView.isVisible())
@ -5527,6 +5524,9 @@ void Notepad_plus::distractionFreeToggle()
}
_dockingManager.resize();
// set padding
paddingLeft = paddingRight = svp.getDistractionFreePadding(_pEditView->getWidth());
// set state of restore button (it's already shown by fullScreen & postIt toggling)
_restoreButton.setButtonStatus(buttonStatus_distractionFree);
}