[Libreoffice-commits] core.git: 3 commits - sfx2/source vcl/unx
Caolán McNamara
caolanm at redhat.com
Mon Mar 7 16:51:04 UTC 2016
sfx2/source/appl/app.src | 5 ----
sfx2/source/control/objface.cxx | 2 -
vcl/unx/gtk3/gtk3gtkframe.cxx | 45 ++++++++++++++++++++++++++--------------
3 files changed, 30 insertions(+), 22 deletions(-)
New commits:
commit 47cf950fe83da10df44fda8f31ed73569d1232da
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Mar 7 16:48:46 2016 +0000
gtk3: popover positions come pre-computed
i.e. the position provided is the location where the popover is to be drawn,
not the bounds of the thing to be pointed to, so adapt them so gtk will point
to the desired place.
e.g. the slide names/numbers in the presentation slide view sidebar
Change-Id: I8c87d5dba32e27f9e627b3282f34d87a8ee460ca
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index cfb856b..4cfa4b3 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2468,6 +2468,33 @@ bool GtkSalFrame::ShowTooltip(const OUString& rHelpText, const Rectangle& rHelpA
return true;
}
+namespace
+{
+ void set_pointing_to(GtkPopover *pPopOver, const Rectangle& rHelpArea)
+ {
+ GdkRectangle aRect;
+ aRect.x = rHelpArea.Left();
+ aRect.y = rHelpArea.Top();
+ aRect.width = 1;
+ aRect.height = 1;
+
+ GtkPositionType ePos = gtk_popover_get_position(pPopOver);
+ switch (ePos)
+ {
+ case GTK_POS_BOTTOM:
+ case GTK_POS_TOP:
+ aRect.width = rHelpArea.GetWidth();
+ break;
+ case GTK_POS_RIGHT:
+ case GTK_POS_LEFT:
+ aRect.height = rHelpArea.GetHeight();
+ break;
+ }
+
+ gtk_popover_set_pointing_to(pPopOver, &aRect);
+ }
+}
+
sal_uIntPtr GtkSalFrame::ShowPopover(const OUString& rHelpText, const Rectangle& rHelpArea, QuickHelpFlags nFlags)
{
#if GTK_CHECK_VERSION(3,12,0)
@@ -2476,14 +2503,6 @@ sal_uIntPtr GtkSalFrame::ShowPopover(const OUString& rHelpText, const Rectangle&
GtkWidget *pLabel = gtk_label_new(sUTF.getStr());
gtk_container_add(GTK_CONTAINER(pWidget), pLabel);
- GdkRectangle aRect;
- aRect.x = rHelpArea.Left();
- aRect.y = rHelpArea.Top();
- aRect.width = rHelpArea.GetWidth();
- aRect.height = rHelpArea.GetHeight();
-
- gtk_popover_set_pointing_to(GTK_POPOVER(pWidget), &aRect);
-
if (nFlags & QuickHelpFlags::Top)
gtk_popover_set_position(GTK_POPOVER(pWidget), GTK_POS_BOTTOM);
else if (nFlags & QuickHelpFlags::Bottom)
@@ -2493,6 +2512,8 @@ sal_uIntPtr GtkSalFrame::ShowPopover(const OUString& rHelpText, const Rectangle&
else if (nFlags & QuickHelpFlags::Right)
gtk_popover_set_position(GTK_POPOVER(pWidget), GTK_POS_LEFT);
+ set_pointing_to(GTK_POPOVER(pWidget), rHelpArea);
+
gtk_popover_set_modal(GTK_POPOVER(pWidget), false);
gtk_widget_show_all(pWidget);
@@ -2511,13 +2532,7 @@ bool GtkSalFrame::UpdatePopover(sal_uIntPtr nId, const OUString& rHelpText, cons
#if GTK_CHECK_VERSION(3,12,0)
GtkWidget *pWidget = reinterpret_cast<GtkWidget*>(nId);
- GdkRectangle aRect;
- aRect.x = rHelpArea.Left();
- aRect.y = rHelpArea.Top();
- aRect.width = rHelpArea.GetWidth();
- aRect.height = rHelpArea.GetHeight();
-
- gtk_popover_set_pointing_to(GTK_POPOVER(pWidget), &aRect);
+ set_pointing_to(GTK_POPOVER(pWidget), rHelpArea);
GtkWidget *pLabel = gtk_bin_get_child(GTK_BIN(pWidget));
OString sUTF = OUStringToOString(rHelpText, RTL_TEXTENCODING_UTF8);
commit a3020baeb54e796df4fbfca5ef02c1e3580c7d6e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Mar 7 15:33:33 2016 +0000
drop unused resource
Change-Id: Ibe52933faa6b13e2d89ab296c1cc15b70f5835af
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index 6167ab3..a3cec3a 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -228,11 +228,6 @@ String RID_STR_HLPFILENOTEXIST
Text [ en-US ] = "The help file for this topic is not installed." ;
};
-String RID_ENVTOOLBOX
-{
- Text [ en-US ] = "Function Bar" ;
-};
-
String STR_QUICKSTART_EXIT
{
Text [ en-US ] = "Exit Quickstarter" ;
commit c26b4bbcdb0e63579bff4ffe9ada235572c6ff0e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Mar 7 15:33:09 2016 +0000
drop unused headers
Change-Id: I73a673de54c0cff77a00a21f8a4c87766f956256
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 49535d3..69ec8f1 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -22,9 +22,7 @@
#include <sal/log.hxx>
-#include <tools/rcid.h>
#include <tools/stream.hxx>
-#include "tools/resmgr.hxx"
#include <sfx2/module.hxx>
#include <sfx2/objface.hxx>
More information about the Libreoffice-commits
mailing list