diff options
author | Jim Raykowski <raykowj@gmail.com> | 2023-09-15 21:26:32 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2023-09-27 07:12:30 +0200 |
commit | a0955317900075371d6adb7f924af24c22f02d09 (patch) | |
tree | c5194d62d6f7f9935e7f4d7a191b6283205b6613 /vcl | |
parent | c2930ebff82c4f7ffe8377ab82627131f8544226 (diff) |
tdf#139935 Part B: Show all menu items possible/potential actions,
but grey-out and deactivate, when not applicable
This patch makes VCL PopupMenu respect the
officecfg::Office::Common::View::Menu::DontHideDisabledEntry setting.
Change-Id: I4df0de82585b602e12481ae46bc4f94c2588970d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156979
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 9a90b03ef93b..60673fbe434e 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -57,6 +57,8 @@ #include <string_view> #include <vector> +#include <officecfg/Office/Common.hxx> + namespace vcl { @@ -2872,8 +2874,12 @@ bool PopupMenu::PrepareRun(const VclPtr<vcl::Window>& pParentWin, tools::Rectang nMenuFlags &= ~MenuFlags::HideDisabledEntries; } else - // #102790# context menus shall never show disabled entries - nMenuFlags |= MenuFlags::HideDisabledEntries; + { + if (officecfg::Office::Common::View::Menu::DontHideDisabledEntry::get()) + nMenuFlags &= ~MenuFlags::HideDisabledEntries; + else + nMenuFlags |= MenuFlags::HideDisabledEntries; + } sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount(); if ( !nVisibleEntries ) |