[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/qt5 vcl/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 22 17:29:04 UTC 2019


 vcl/inc/qt5/Qt5Frame.hxx      |    3 ---
 vcl/inc/qt5/Qt5Widget.hxx     |    3 ---
 vcl/qt5/Qt5Frame.cxx          |   10 +++++-----
 vcl/qt5/Qt5Widget.cxx         |    7 -------
 vcl/source/app/salvtables.cxx |    6 ++++++
 5 files changed, 11 insertions(+), 18 deletions(-)

New commits:
commit ab5f341efd144adb6b7d0e00fece76a2153acd10
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat Jun 22 02:25:24 2019 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Sat Jun 22 19:28:12 2019 +0200

    Qt5 directly show tooltips + respect the help area
    
    I'm not sure why this redirection was implemented, which also ommited
    the provided help area. I tried hard to use vc::Window code in the
    beginning, but that also mirrors the cursor position for the window.
    Using Qt here is simply straight forward, so just do that,
    
    Change-Id: Ia8c4efc1e43b915c4b071ee26d4da37d7580817c
    Reviewed-on: https://gerrit.libreoffice.org/74548
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index d7f8f1aa6e1f..5b1bc1025445 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -133,9 +133,6 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public QObject, public SalFrame
     void TriggerPaintEvent();
     void TriggerPaintEvent(QRect aRect);
 
-Q_SIGNALS:
-    void tooltipRequest(const OUString& rTooltip);
-
 public:
     Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nSalFrameStyle, bool bUseCairo);
     virtual ~Qt5Frame() override;
diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx
index 8ead4b3ec945..85523951cda2 100644
--- a/vcl/inc/qt5/Qt5Widget.hxx
+++ b/vcl/inc/qt5/Qt5Widget.hxx
@@ -70,9 +70,6 @@ class Qt5Widget : public QWidget
     void inputMethodEvent(QInputMethodEvent*) override;
     QVariant inputMethodQuery(Qt::InputMethodQuery) const override;
 
-public slots:
-    static void showTooltip(const OUString& rTip);
-
 public:
     Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f = Qt::WindowFlags());
 
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index dbdc51ea9465..d585f627b7fd 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -155,9 +155,6 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
     else
         m_pQWidget = new Qt5Widget(*this, aWinFlags);
 
-    connect(this, &Qt5Frame::tooltipRequest, static_cast<Qt5Widget*>(m_pQWidget),
-            &Qt5Widget::showTooltip);
-
     if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG))
     {
         QWindow* pParentWindow = pParent->GetQWidget()->window()->windowHandle();
@@ -743,9 +740,12 @@ void Qt5Frame::Flush()
     // destroyed, so that state should be safely flushed.
 }
 
-bool Qt5Frame::ShowTooltip(const OUString& rText, const tools::Rectangle& /*rHelpArea*/)
+bool Qt5Frame::ShowTooltip(const OUString& rText, const tools::Rectangle& rHelpArea)
 {
-    emit tooltipRequest(rText);
+    QRect aHelpArea(toQRect(rHelpArea));
+    if (QGuiApplication::isRightToLeft())
+        aHelpArea.moveLeft(maGeometry.nWidth - aHelpArea.width() - aHelpArea.left() - 1);
+    QToolTip::showText(QCursor::pos(), toQString(rText), m_pQWidget, aHelpArea);
     return true;
 }
 
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 42f3353ff26b..843ce798a989 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -40,7 +40,6 @@
 #include <QtGui/QTextCharFormat>
 #include <QtGui/QWheelEvent>
 #include <QtWidgets/QMainWindow>
-#include <QtWidgets/QToolTip>
 #include <QtWidgets/QWidget>
 
 #include <cairo.h>
@@ -503,12 +502,6 @@ void Qt5Widget::focusOutEvent(QFocusEvent*)
     m_rFrame.CallCallback(SalEvent::LoseFocus, nullptr);
 }
 
-void Qt5Widget::showTooltip(const OUString& rTooltip)
-{
-    QPoint pt = QCursor::pos();
-    QToolTip::showText(pt, toQString(rTooltip));
-}
-
 Qt5Widget::Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f)
     : QWidget(Q_NULLPTR, f)
     , m_rFrame(rFrame)
commit 4cbf5a4f666ac4d7b01746bc36ab01400e28ff40
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 21 21:55:20 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jun 22 19:28:04 2019 +0200

    Related: tdf#126036 sort button by native order for async dialogs too
    
    Change-Id: Iddc689b8d332e8e0127806c37b5ccce66eadfcf6
    Reviewed-on: https://gerrit.libreoffice.org/74540
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index b17e0215258d..fc62bb6441e2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1218,6 +1218,9 @@ public:
         VclAbstractDialog::AsyncContext aCtx;
         aCtx.mxOwnerDialogController = aOwner;
         aCtx.maEndDialogFn = rEndDialogFn;
+        VclButtonBox* pActionArea = m_xDialog->get_action_area();
+        if (pActionArea)
+           pActionArea->sort_native_button_order();
         return m_xDialog->StartExecuteAsync(aCtx);
     }
 
@@ -1229,6 +1232,9 @@ public:
         // which is that rxSelf enforces.
         aCtx.mxOwnerSelf = rxSelf;
         aCtx.maEndDialogFn = rEndDialogFn;
+        VclButtonBox* pActionArea = m_xDialog->get_action_area();
+        if (pActionArea)
+           pActionArea->sort_native_button_order();
         return m_xDialog->StartExecuteAsync(aCtx);
     }
 


More information about the Libreoffice-commits mailing list