Kaydet (Commit) a7c2f158 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#124704 need to state the area the tooltip is for

to make it work under gtk3

Change-Id: I4c895181af233a16292ce16b194f0a60994446fb
Reviewed-on: https://gerrit.libreoffice.org/71478
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e5321eba
...@@ -343,7 +343,7 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt ) ...@@ -343,7 +343,7 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HelpEventMode::QUICK ) else if ( rHEvt.GetMode() & HelpEventMode::QUICK )
{ {
OUString aHelpText; OUString aHelpText;
Point aTopLeft; tools::Rectangle aHelpRect;
if ( StarBASIC::IsRunning() ) if ( StarBASIC::IsRunning() )
{ {
Point aWindowPos = rHEvt.GetMousePosPixel(); Point aWindowPos = rHEvt.GetMousePosPixel();
...@@ -377,15 +377,20 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt ) ...@@ -377,15 +377,20 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
} }
if ( !aHelpText.isEmpty() ) if ( !aHelpText.isEmpty() )
{ {
aTopLeft = GetEditView()->GetTextEngine()->PaMtoEditCursor( aStartOfWord ).BottomLeft(); tools::Rectangle aStartWordRect(GetEditView()->GetTextEngine()->PaMtoEditCursor(aStartOfWord));
aTopLeft = GetEditView()->GetWindowPos( aTopLeft ); TextPaM aEndOfWord(aStartOfWord.GetPara(), aStartOfWord.GetIndex() + aWord.getLength());
aTopLeft.AdjustX(5 ); tools::Rectangle aEndWordRect(GetEditView()->GetTextEngine()->PaMtoEditCursor(aEndOfWord));
aTopLeft.AdjustY(5 ); aHelpRect = aStartWordRect.GetUnion(aEndWordRect);
aTopLeft = OutputToScreenPixel( aTopLeft );
Point aTopLeft = GetEditView()->GetWindowPos(aHelpRect.TopLeft());
aTopLeft = GetEditView()->GetWindow()->OutputToScreenPixel(aTopLeft);
aHelpRect.setX(aTopLeft.X());
aHelpRect.setY(aTopLeft.Y());
} }
} }
} }
Help::ShowQuickHelp( this, tools::Rectangle( aTopLeft, Size( 1, 1 ) ), aHelpText, QuickHelpFlags::Top|QuickHelpFlags::Left); Help::ShowQuickHelp( this, aHelpRect, aHelpText, QuickHelpFlags::NONE);
bDone = true; bDone = true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment