svtools/source/uno/popupwindowcontroller.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
New commits: commit b6c0cad80986ddbd7e62b07c51816c1df7031831 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Dec 30 19:48:20 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Dec 31 12:06:25 2019 +0100 support welded toolbar popovers in PopupWindowController Change-Id: Ie3d9f281d66592a063f179637c99814ef8745c42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86037 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx index c266600546d5..0ffb2f5871cd 100644 --- a/svtools/source/uno/popupwindowcontroller.cxx +++ b/svtools/source/uno/popupwindowcontroller.cxx @@ -20,8 +20,9 @@ #include <cppuhelper/supportsservice.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <vcl/toolbox.hxx> #include <vcl/svapp.hxx> +#include <vcl/toolbox.hxx> +#include <vcl/weldutils.hxx> #include <svtools/popupwindowcontroller.hxx> @@ -180,12 +181,23 @@ void SAL_CALL PopupWindowController::dispose() // XStatusListener void SAL_CALL PopupWindowController::statusChanged( const frame::FeatureStateEvent& rEvent ) { + bool bValue = false; + rEvent.State >>= bValue; + + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(getParent().get())) + { + auto pToolbar = dynamic_cast<weld::Toolbar*>(pTunnel->getWidget()); + assert(pToolbar && "must be a toolbar"); + OString sId = m_aCommandURL.toUtf8(); + pToolbar->set_item_active(sId, bValue); + pToolbar->set_item_sensitive(sId, rEvent.IsEnabled); + return; + } + ToolBox* pToolBox = nullptr; sal_uInt16 nItemId = 0; if ( getToolboxId( nItemId, &pToolBox ) ) { - bool bValue = false; - rEvent.State >>= bValue; pToolBox->CheckItem( nItemId, bValue ); pToolBox->EnableItem( nItemId, rEvent.IsEnabled ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits