diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-01-14 10:56:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-16 17:20:09 +0100 |
commit | 95b3a12c5c55cb1696995ccba7eb5f33832fa69f (patch) | |
tree | 8244b632bd75b34310cc0c052306c657a886a38d /sd | |
parent | c8e26c255238e41c378bce4a715a566034a6a9e2 (diff) |
Resolves: tdf#122695 Content Type selector tooltip missing
Change-Id: I0ffe6448d865f569fb59d9facbb1582d2152a9ba
Reviewed-on: https://gerrit.libreoffice.org/66291
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 423d70f7e45749fad680b3dfe0ccdaed1c1afb19)
Reviewed-on: https://gerrit.libreoffice.org/66384
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/func/fudraw.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/viewoverlaymanager.cxx | 39 |
2 files changed, 36 insertions, 6 deletions
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 6b3872fefdae..2ecc44fe0a20 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -765,6 +765,9 @@ bool FuDraw::RequestHelp(const HelpEvent& rHEvt) bReturn = FuPoor::RequestHelp(rHEvt); } + if (!bReturn) + bReturn = mpView->RequestHelp(rHEvt); + return bReturn; } diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 0174c2ba27c1..4ce242402c80 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -145,10 +145,12 @@ public: virtual bool isMarkable() const override; virtual void onMouseEnter(const MouseEvent& rMEvt) override; + virtual void onHelpRequest(const HelpEvent& rHEvt) override; virtual void onMouseLeave() override; int getHighlightId() const { return mnHighlightId; } + void ShowTip(); static void HideTip(); private: @@ -176,6 +178,35 @@ void ImageButtonHdl::HideTip() Help::HideBalloonAndQuickHelp(); } +void ImageButtonHdl::ShowTip() +{ + if (!pHdlList || !pHdlList->GetView() || mnHighlightId == -1) + return; + + OutputDevice* pDev = pHdlList->GetView()->GetFirstOutputDevice(); + if( pDev == nullptr ) + pDev = Application::GetDefaultDevice(); + + OUString aHelpText(SdResId(gButtonToolTips[mnHighlightId])); + Point aHelpPos(pDev->LogicToPixel(GetPos())); + if (mnHighlightId == 1) + aHelpPos.Move(maImageSize.Width(), 0); + else if (mnHighlightId == 2) + aHelpPos.Move(0, maImageSize.Height()); + else if (mnHighlightId == 3) + aHelpPos.Move(maImageSize.Width(), maImageSize.Height()); + ::tools::Rectangle aLogicPix(aHelpPos, maImageSize); + vcl::Window* pWindow = static_cast<vcl::Window*>(pHdlList->GetView()->GetFirstOutputDevice()); + ::tools::Rectangle aScreenRect(pWindow->OutputToScreenPixel(aLogicPix.TopLeft()), + pWindow->OutputToScreenPixel(aLogicPix.BottomRight())); + Help::ShowQuickHelp(pWindow, aScreenRect, aHelpText); +} + +void ImageButtonHdl::onHelpRequest(const HelpEvent& /*rHEvt*/) +{ + ShowTip(); +} + void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt) { if( pHdlList && pHdlList->GetView()) @@ -197,12 +228,8 @@ void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt) mnHighlightId = nHighlightId; - if( pHdlList ) - { - OUString aHelpText(SdResId(gButtonToolTips[mnHighlightId])); - ::tools::Rectangle aScreenRect( pDev->LogicToPixel( GetPos() ), maImageSize ); - Help::ShowQuickHelp(static_cast< vcl::Window* >( pHdlList->GetView()->GetFirstOutputDevice() ), aScreenRect, aHelpText); - } + ShowTip(); + Touch(); } } |