[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara
caolanm at redhat.com
Fri Nov 3 23:42:34 UTC 2017
vcl/unx/gtk3/gtk3gtkframe.cxx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 5228db64eb9f55c945f1b460f2955fc3edfad791
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Nov 3 15:53:22 2017 +0000
gtk3: fix popover placement in RTL
Change-Id: I8c20b277ce943f915941b2af9353f98c66f9065c
Reviewed-on: https://gerrit.libreoffice.org/44271
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index d24bef907c00..0659d0740533 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2454,7 +2454,7 @@ bool GtkSalFrame::ShowTooltip(const OUString& rHelpText, const tools::Rectangle&
#if GTK_CHECK_VERSION(3,12,0)
namespace
{
- void set_pointing_to(GtkPopover *pPopOver, const tools::Rectangle& rHelpArea)
+ void set_pointing_to(GtkPopover *pPopOver, const tools::Rectangle& rHelpArea, const SalFrameGeometry& rGeometry)
{
GdkRectangle aRect;
aRect.x = rHelpArea.Left();
@@ -2475,6 +2475,9 @@ namespace
break;
}
+ if (AllSettings::GetLayoutRTL())
+ aRect.x = rGeometry.nWidth-aRect.width-1-aRect.x;
+
gtk_popover_set_pointing_to(pPopOver, &aRect);
}
}
@@ -2497,7 +2500,7 @@ sal_uIntPtr GtkSalFrame::ShowPopover(const OUString& rHelpText, const tools::Rec
else if (nFlags & QuickHelpFlags::Right)
gtk_popover_set_position(GTK_POPOVER(pWidget), GTK_POS_LEFT);
- set_pointing_to(GTK_POPOVER(pWidget), rHelpArea);
+ set_pointing_to(GTK_POPOVER(pWidget), rHelpArea, maGeometry);
gtk_popover_set_modal(GTK_POPOVER(pWidget), false);
@@ -2517,7 +2520,7 @@ bool GtkSalFrame::UpdatePopover(sal_uIntPtr nId, const OUString& rHelpText, cons
#if GTK_CHECK_VERSION(3,12,0)
GtkWidget *pWidget = reinterpret_cast<GtkWidget*>(nId);
- set_pointing_to(GTK_POPOVER(pWidget), rHelpArea);
+ set_pointing_to(GTK_POPOVER(pWidget), rHelpArea, maGeometry);
GtkWidget *pLabel = gtk_bin_get_child(GTK_BIN(pWidget));
OString sUTF = OUStringToOString(rHelpText, RTL_TEXTENCODING_UTF8);
More information about the Libreoffice-commits
mailing list