framework/source/uielement/menubarmanager.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+)
New commits: commit 3cbaff79837f890510f987950d7d3ccbb95dd974 Author: Vasily Melenchuk <[email protected]> Date: Wed Feb 28 13:39:56 2018 +0300 menu bar behavior consistency: remove checkbox from disabled menu item If menu item which can have checkbox is disabled, checkbox is not drawn near it. After matching to enabled criteria this checkbox can appear and after disabling menu item again it still remain, so initial and final state of menu are different. Change-Id: I31be02da892212e12276aa56bae15e6fa453a5bf Reviewed-on: https://gerrit.libreoffice.org/50506 Tested-by: Jenkins <[email protected]> Reviewed-by: Katarina Behrens <[email protected]> (cherry picked from commit af1f91ae294e90c91ea5a5b78d6cc020b893e6c7) Reviewed-on: https://gerrit.libreoffice.org/50604 Reviewed-by: Thorsten Behrens <[email protected]> Tested-by: Thorsten Behrens <[email protected]> diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index e7ee04322574..4c83854f66a7 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -418,8 +418,19 @@ throw ( RuntimeException, std::exception ) // Enable/disable item if ( bEnabledItem != bMenuItemEnabled ) + { m_pVCLMenu->EnableItem( pMenuItemHandler->nItemId, bEnabledItem ); + // Remove "checked" mark for disabled menu items. + // Initially disabled but checkable menu items do not receive + // checked/unchecked state, so can appear inconsistently after + // enabling/disabling. Since we can not pass checked state for disabled + // items, we will just reset checked state for them, anyway correct state + // will be transferred from controller once item enabled. + if ( !bEnabledItem && m_pVCLMenu->IsItemChecked( pMenuItemHandler->nItemId ) ) + m_pVCLMenu->CheckItem( pMenuItemHandler->nItemId, false ); + } + if ( Event.State >>= bCheckmark ) { // Checkmark or RadioButton _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
