diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-05 10:04:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-05 13:39:37 +0200 |
commit | 28ddcd59fab3c4994a5e4e94f05e21ad94664a76 (patch) | |
tree | d9e19a826864c37437ab5ae09feef6d225ecee98 /vcl | |
parent | 423c177d58e04af027379159b856c9b817d56488 (diff) |
move RequestHelp into layout.cxx
Change-Id: I6b0642a77ffd247f9a77d5a4bdd0b593025a7797
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120066
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/layout.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 3f70e767e344..6ce711bea1aa 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -17,6 +17,7 @@ #include <vcl/toolkit/button.hxx> #include <vcl/cvtgrf.hxx> #include <vcl/decoview.hxx> +#include <vcl/help.hxx> #include <vcl/toolkit/dialog.hxx> #include <vcl/layout.hxx> #include <vcl/scrbar.hxx> @@ -2888,6 +2889,27 @@ bool isLayoutEnabled(const vcl::Window *pWindow) return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(GetWindowType::Next); } +void VclDrawingArea::RequestHelp(const HelpEvent& rHelpEvent) +{ + if (rHelpEvent.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON)) + { + Point aPos(ScreenToOutputPixel(rHelpEvent.GetMousePosPixel())); + tools::Rectangle aHelpArea(aPos.X(), aPos.Y()); + OUString sHelpTip = m_aQueryTooltipHdl.Call(aHelpArea); + if (sHelpTip.isEmpty()) + return; + Point aPt = OutputToScreenPixel(aHelpArea.TopLeft()); + aHelpArea.SetLeft(aPt.X()); + aHelpArea.SetTop(aPt.Y()); + aPt = OutputToScreenPixel(aHelpArea.BottomRight()); + aHelpArea.SetRight(aPt.X()); + aHelpArea.SetBottom(aPt.Y()); + // tdf#125369 recover newline support of tdf#101779 + QuickHelpFlags eHelpWinStyle = sHelpTip.indexOf('\n') != -1 ? QuickHelpFlags::TipStyleBalloon : QuickHelpFlags::NONE; + Help::ShowQuickHelp(this, aHelpArea, sHelpTip, eHelpWinStyle); + } +} + void VclDrawingArea::StartDrag(sal_Int8, const Point&) { if (m_aStartDragHdl.Call(this)) |