summaryrefslogtreecommitdiff
path: root/wx+/tooltip.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-09-03 20:50:36 +0000
committerB Stack <bgstack15@gmail.com>2019-09-03 20:50:36 +0000
commit89b5c8eb6012b7b4560958ad3c1aa5b187dafc94 (patch)
treeafc54ec004ab863262f5621fbf282c42fdff29cc /wx+/tooltip.cpp
parentMerge branch '10.14' into 'master' (diff)
parentadd upstream 10.15 (diff)
downloadFreeFileSync-89b5c8eb6012b7b4560958ad3c1aa5b187dafc94.tar.gz
FreeFileSync-89b5c8eb6012b7b4560958ad3c1aa5b187dafc94.tar.bz2
FreeFileSync-89b5c8eb6012b7b4560958ad3c1aa5b187dafc94.zip
Merge branch '10.15' into 'master'10.15
add upstream 10.15 See merge request opensource-tracking/FreeFileSync!12
Diffstat (limited to 'wx+/tooltip.cpp')
-rw-r--r--wx+/tooltip.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/wx+/tooltip.cpp b/wx+/tooltip.cpp
index 142c9b7f..42fb058a 100644
--- a/wx+/tooltip.cpp
+++ b/wx+/tooltip.cpp
@@ -13,6 +13,7 @@
#include <wx/app.h>
#include "image_tools.h"
#include "dc.h"
+ #include <gtk/gtk.h>
using namespace zen;
@@ -48,8 +49,8 @@ public:
}
- wxStaticText* staticTextMain_;
- wxStaticBitmap* bitmapLeft_;
+ wxStaticText* staticTextMain_ = nullptr;
+ wxStaticBitmap* bitmapLeft_ = nullptr;
};
@@ -80,7 +81,7 @@ void Tooltip::show(const wxString& text, wxPoint mousePos, const wxBitmap* bmp)
mousePos + wxPoint(fastFromDIP(TIP_WINDOW_OFFSET_DIP), 0);
if (newPos != tipWindow_->GetScreenPosition())
- tipWindow_->SetSize(newPos.x, newPos.y, wxDefaultCoord, wxDefaultCoord);
+ tipWindow_->Move(newPos);
//attention!!! possible endless loop: mouse pointer must NOT be within tipWindow!
//else it will trigger a wxEVT_LEAVE_WINDOW on middle grid which will hide the window, causing the window to be shown again via this method, etc.
@@ -93,8 +94,15 @@ void Tooltip::hide()
{
if (tipWindow_)
{
- //on wxGTK the tooltip is sometimes not shown again after it was hidden: e.g. drag-selection on middle grid
+#if GTK_MAJOR_VERSION == 2 //the tooltip sometimes turns blank or is not shown again after it was hidden: e.g. drag-selection on middle grid
tipWindow_->Destroy(); //apply brute force:
tipWindow_ = nullptr; //
+
+#elif GTK_MAJOR_VERSION == 3
+ tipWindow_->Hide();
+#else
+#error unknown GTK version!
+#endif
+
}
}
bgstack15