diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-03 08:48:34 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-07-04 06:31:10 +0200 |
commit | d4d81421918209456c4669ef48c3f4f2afd8d97f (patch) | |
tree | ff1591012cc1ee08fed7ace9bb6c64043530a942 /vcl/source/control | |
parent | e650777fa21ed8b88b4dde2ff3607238928f3aa5 (diff) |
tdf#161853 Drop SvxIconChoiceCtrl_Impl::bHighlightFramePressed
Since
commit af9413cb4ad49c0b4854c08cc2804644220755ae
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Tue Jul 2 11:53:27 2024 +0200
tdf#161853 icon choice ctrl: Drop support for non-single selection modes
, `SvxIconChoiceCtrl_Impl::bHighlightFramePressed` is always
false, so drop it and the corresponding handling.
This also means that the `bKeepHighlightFlags` param
for `SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame`
is now unused, so drop that as well.
Change-Id: I278318b2bda14b06339a375b683a49f8594e2e34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169902
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/imivctl.hxx | 6 | ||||
-rw-r--r-- | vcl/source/control/imivctl1.cxx | 33 |
2 files changed, 7 insertions, 32 deletions
diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index cd268c3d271a..90f9c4bb1986 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -135,7 +135,6 @@ class SvxIconChoiceCtrl_Impl DrawTextFlags nCurTextDrawFlags; ImplSVEvent * nUserEventAdjustScrBars; SvxIconChoiceCtrlEntry* pCurHighlightFrame; - bool bHighlightFramePressed; SvxIconChoiceCtrlEntry* pHead = nullptr; // top left entry SvxIconChoiceCtrlEntry* pCursor; LocalFocus aFocus; // Data for focusrect @@ -349,10 +348,7 @@ public: void SetPositionMode( SvxIconChoiceCtrlPositionMode ); - void SetEntryHighlightFrame( - SvxIconChoiceCtrlEntry* pEntry, - bool bKeepHighlightFlags - ); + void SetEntryHighlightFrame(SvxIconChoiceCtrlEntry* pEntry); void DrawHighlightFrame(vcl::RenderContext& rRenderContext, const tools::Rectangle& rBmpRect); void CallEventListeners( VclEventId nEvent, void* pData ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 27f363f4da76..9fcd4b83ab7c 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -62,7 +62,9 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aImageSize( 32 * pCurView->GetDPIScaleFactor(), 32 * pCurView->GetDPIScaleFactor()), pView(pCurView), nMaxVirtWidth(DEFAULT_MAX_VIRT_WIDTH), nMaxVirtHeight(DEFAULT_MAX_VIRT_HEIGHT), nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr), - pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr), + pCurHighlightFrame(nullptr), + pHead(nullptr), + pCursor(nullptr), ePositionMode(SvxIconChoiceCtrlPositionMode::Free), bUpdateMode(true) { @@ -578,7 +580,6 @@ void SvxIconChoiceCtrl_Impl::InitScrollBarBox() bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { bool bHandled = true; - bHighlightFramePressed = false; if( !(nWinBits & WB_NOPOINTERFOCUS) ) pView->GrabFocus(); @@ -646,19 +647,6 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect); - if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame) - { - bHandled = true; - SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame; - pCurHighlightFrame = nullptr; // force repaint of frame - bHighlightFramePressed = false; - SetEntryHighlightFrame( pEntry, true ); - - pView->ClickIcon(); - - // set focus on Icon - SetCursor_Impl(pCurHighlightFrame); - } return bHandled; } @@ -671,7 +659,7 @@ bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) else if( nWinBits & WB_HIGHLIGHTFRAME ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos ); - SetEntryHighlightFrame( pEntry, false ); + SetEntryHighlightFrame(pEntry); } else return false; @@ -2374,23 +2362,14 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderConte aBmpRect.AdjustTop( -nBorder ); DecorationView aDecoView(&rRenderContext); - DrawHighlightFrameStyle nDecoFlags; - if (bHighlightFramePressed) - nDecoFlags = DrawHighlightFrameStyle::In; - else - nDecoFlags = DrawHighlightFrameStyle::Out; - aDecoView.DrawHighlightFrame(aBmpRect, nDecoFlags); + aDecoView.DrawHighlightFrame(aBmpRect, DrawHighlightFrameStyle::Out); } -void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry, - bool bKeepHighlightFlags ) +void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame(SvxIconChoiceCtrlEntry* pEntry) { if( pEntry == pCurHighlightFrame ) return; - if( !bKeepHighlightFlags ) - bHighlightFramePressed = false; - if (pCurHighlightFrame) { tools::Rectangle aInvalidationRect(GetEntryBoundRect(pCurHighlightFrame)); |