diff options
author | Vasily Melenchuk <Vasily.Melenchuk@cib.de> | 2018-02-28 13:39:56 +0300 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-03-01 15:05:33 +0100 |
commit | af1f91ae294e90c91ea5a5b78d6cc020b893e6c7 (patch) | |
tree | 737026e0380b6ce58ac44dfc8b6938a0fdd49def /framework | |
parent | 9122f4598450d8a96e63fb29cc8166a6ae09587a (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/menubarmanager.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 018518931cd4..0122c299b97d 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -336,8 +336,19 @@ void SAL_CALL MenuBarManager::statusChanged( const FeatureStateEvent& Event ) // 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 |