summaryrefslogtreecommitdiff
path: root/wx+/tooltip.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-08-15 15:51:34 -0400
committerB Stack <bgstack15@gmail.com>2019-08-15 15:51:39 -0400
commit17994eb3eda9d2be9aad55dae41562ce13531d99 (patch)
treeafc54ec004ab863262f5621fbf282c42fdff29cc /wx+/tooltip.cpp
parentMerge branch '10.14' into 'master' (diff)
downloadFreeFileSync-17994eb3eda9d2be9aad55dae41562ce13531d99.tar.gz
FreeFileSync-17994eb3eda9d2be9aad55dae41562ce13531d99.tar.bz2
FreeFileSync-17994eb3eda9d2be9aad55dae41562ce13531d99.zip
add upstream 10.15
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