summaryrefslogtreecommitdiff
path: root/wx+/tooltip.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
commitfe9eb89ebc1b3c33cbac00a3fa095a14faef9113 (patch)
tree8a3bb620a9acb83fe0057061a86e8f2cb91a9fe1 /wx+/tooltip.cpp
parent5.21 (diff)
downloadFreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.gz
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.bz2
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.zip
5.22
Diffstat (limited to 'wx+/tooltip.cpp')
-rw-r--r--wx+/tooltip.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/wx+/tooltip.cpp b/wx+/tooltip.cpp
index ebf3c61c..d4bcf302 100644
--- a/wx+/tooltip.cpp
+++ b/wx+/tooltip.cpp
@@ -16,15 +16,15 @@
using namespace zen;
-class Tooltip::PopupDialogGenerated : public wxDialog
+class Tooltip::TooltipDialogGenerated : public wxDialog
{
public:
- PopupDialogGenerated(wxWindow* parent,
- wxWindowID id = wxID_ANY,
- const wxString& title = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0) : wxDialog(parent, id, title, pos, size, style)
+ TooltipDialogGenerated(wxWindow* parent,
+ wxWindowID id = wxID_ANY,
+ const wxString& title = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0) : wxDialog(parent, id, title, pos, size, style)
{
//Suse Linux/X11: needs parent window, else there are z-order issues
@@ -43,7 +43,7 @@ public:
this->Layout();
bSizer158->Fit(this);
-#if defined ZEN_WIN //prevent window stealing focus!
+#ifdef ZEN_WIN //prevent window from stealing focus!
Disable(); //= dark/grey text and image on Linux; no visible difference on OS X
#endif
}
@@ -56,7 +56,7 @@ public:
void Tooltip::show(const wxString& text, wxPoint mousePos, const wxBitmap* bmp)
{
if (!tipWindow)
- tipWindow = new PopupDialogGenerated(&parent_); //ownership passed to parent
+ tipWindow = new TooltipDialogGenerated(&parent_); //ownership passed to parent
const wxBitmap& newBmp = bmp ? *bmp : wxNullBitmap;
@@ -72,7 +72,8 @@ void Tooltip::show(const wxString& text, wxPoint mousePos, const wxBitmap* bmp)
tipWindow->m_staticTextMain->Wrap(600);
}
- tipWindow->Fit(); //Linux: Fit() seems to be somewhat broken => this needs to be called EVERY time inside show, not only if text or bmp change
+ tipWindow->GetSizer()->SetSizeHints(tipWindow); //~=Fit() + SetMinSize()
+ //Linux: Fit() seems to be somewhat broken => this needs to be called EVERY time inside show, not only if text or bmp change
const wxPoint newPos = wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ?
mousePos - wxPoint(30 + tipWindow->GetSize().GetWidth(), 0) :
bgstack15