summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-02-21 21:01:57 -0900
committerJim Raykowski <raykowj@gmail.com>2021-03-01 03:56:07 +0100
commit6c897e5026a6819c2d706ccdc9720fb1b3f8bea2 (patch)
tree23c5122e5a17608b6941209d5340daa974b56881 /svx
parent6fb9f368c6824a8ff7bc5bc5cf66fc2df7d055b7 (diff)
tdf#116136 don't show statusbar selection mode control tooltip
in print preview. This patch also sets the control image disabled when in print preview. Change-Id: I497af2a50621ed6611a31f9b17b682caa82fa260 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111294 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/stbctrls/selctrl.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index 2b028e0d71d3..845df5a5d367 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -100,15 +100,18 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId,
StatusBar& rStb ) :
SfxStatusBarControl( _nSlotId, _nId, rStb ),
mnState( 0 ),
- maImage(StockImage::Yes, RID_SVXBMP_SELECTION)
+ maImage(StockImage::Yes, RID_SVXBMP_SELECTION),
+ mbFeatureEnabled(false)
{
GetStatusBar().SetItemText( GetId(), "" );
+ GetStatusBar().SetQuickHelpText(GetId(), u"");
}
void SvxSelectionModeControl::StateChanged( sal_uInt16, SfxItemState eState,
const SfxPoolItem* pState )
{
- if ( SfxItemState::DEFAULT == eState )
+ mbFeatureEnabled = SfxItemState::DEFAULT == eState;
+ if (mbFeatureEnabled)
{
DBG_ASSERT( dynamic_cast< const SfxUInt16Item* >(pState) != nullptr, "invalid item type" );
const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pState);
@@ -121,8 +124,8 @@ void SvxSelectionModeControl::StateChanged( sal_uInt16, SfxItemState eState,
bool SvxSelectionModeControl::MouseButtonDown( const MouseEvent& rEvt )
{
- if (!rEvt.IsMiddle())
- return false;
+ if (!mbFeatureEnabled || !rEvt.IsMiddle())
+ return true;
::tools::Rectangle aRect(rEvt.GetPosPixel(), Size(1, 1));
weld::Window* pPopupParent = weld::GetPopupParent(GetStatusBar(), aRect);
@@ -174,7 +177,7 @@ void SvxSelectionModeControl::Paint( const UserDrawEvent& rUsrEvt )
Point aPos( aRect.Left() + ( aControlRect.GetWidth() - aImgSize.Width() ) / 2,
aRect.Top() + ( aControlRect.GetHeight() - aImgSize.Height() ) / 2 );
- pDev->DrawImage( aPos, maImage );
+ pDev->DrawImage(aPos, maImage, mbFeatureEnabled ? DrawImageFlags::NONE : DrawImageFlags::Disable);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */