diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2018-06-17 00:10:27 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2018-06-17 01:25:46 +0200 |
commit | 6fcc60b49215acb28edac46bb605767840abd122 (patch) | |
tree | caee14cee8aa154840ed84946c6dcb876bf36fed /vcl/unx/gtk3 | |
parent | bf1f49c837264c8f59197b9487d40e32821526c3 (diff) |
gtk3: Correctly mirror popovers in rtl ui
e.g. formula prompt or fill series in Calc. The reason is that for
this particular vcl::Window, HasMirroredGraphics() != IsRTLEnabled().
Change-Id: Icd4bb2d22ba77d64c32b243d9c07745824e5e558
Reviewed-on: https://gerrit.libreoffice.org/55936
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 69f02adc7473..7e07f0efced8 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -2497,10 +2497,10 @@ bool GtkSalFrame::ShowTooltip(const OUString& rHelpText, const tools::Rectangle& namespace { - void set_pointing_to(GtkPopover *pPopOver, const tools::Rectangle& rHelpArea, const SalFrameGeometry& rGeometry) + void set_pointing_to(GtkPopover *pPopOver, vcl::Window* pParent, const tools::Rectangle& rHelpArea, const SalFrameGeometry& rGeometry) { GdkRectangle aRect; - aRect.x = rHelpArea.Left(); + aRect.x = FloatingWindow::ImplConvertToAbsPos(pParent, rHelpArea).Left() - rGeometry.nX; aRect.y = rHelpArea.Top(); aRect.width = 1; aRect.height = 1; @@ -2518,14 +2518,11 @@ namespace break; } - if (AllSettings::GetLayoutRTL()) - aRect.x = rGeometry.nWidth-aRect.width-1-aRect.x; - gtk_popover_set_pointing_to(pPopOver, &aRect); } } -void* GtkSalFrame::ShowPopover(const OUString& rHelpText, const tools::Rectangle& rHelpArea, QuickHelpFlags nFlags) +void* GtkSalFrame::ShowPopover(const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea, QuickHelpFlags nFlags) { GtkWidget *pWidget = gtk_popover_new(getMouseEventWidget()); OString sUTF = OUStringToOString(rHelpText, RTL_TEXTENCODING_UTF8); @@ -2541,7 +2538,7 @@ void* GtkSalFrame::ShowPopover(const OUString& rHelpText, const tools::Rectangle else if (nFlags & QuickHelpFlags::Right) gtk_popover_set_position(GTK_POPOVER(pWidget), GTK_POS_LEFT); - set_pointing_to(GTK_POPOVER(pWidget), rHelpArea, maGeometry); + set_pointing_to(GTK_POPOVER(pWidget), pParent, rHelpArea, maGeometry); gtk_popover_set_modal(GTK_POPOVER(pWidget), false); @@ -2550,11 +2547,11 @@ void* GtkSalFrame::ShowPopover(const OUString& rHelpText, const tools::Rectangle return pWidget; } -bool GtkSalFrame::UpdatePopover(void* nId, const OUString& rHelpText, const tools::Rectangle& rHelpArea) +bool GtkSalFrame::UpdatePopover(void* nId, const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea) { GtkWidget *pWidget = static_cast<GtkWidget*>(nId); - set_pointing_to(GTK_POPOVER(pWidget), rHelpArea, maGeometry); + set_pointing_to(GTK_POPOVER(pWidget), pParent, rHelpArea, maGeometry); GtkWidget *pLabel = gtk_bin_get_child(GTK_BIN(pWidget)); OString sUTF = OUStringToOString(rHelpText, RTL_TEXTENCODING_UTF8); |