summaryrefslogtreecommitdiff
path: root/ui/tray_icon.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
commitc8e0e909b4a8d18319fc65434a10dc446434817c (patch)
treeeee91e7d2ce229dd043811eae8f1e2bd78061916 /ui/tray_icon.cpp
parent5.2 (diff)
downloadFreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip
5.3
Diffstat (limited to 'ui/tray_icon.cpp')
-rw-r--r--ui/tray_icon.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/ui/tray_icon.cpp b/ui/tray_icon.cpp
index 51441e36..2fc76f15 100644
--- a/ui/tray_icon.cpp
+++ b/ui/tray_icon.cpp
@@ -185,9 +185,10 @@ private:
FfsTrayIcon::FfsTrayIcon() :
- trayIcon(new TaskBarImpl(*this))
+ trayIcon(new TaskBarImpl(*this)),
+ fractionLast(1) //show FFS logo by default
{
- trayIcon->SetIcon(generateIcon(0), wxT("FreeFileSync"));
+ trayIcon->SetIcon(generateIcon(fractionLast), L"FreeFileSync");
trayIcon->Connect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(FfsTrayIcon::OnDoubleClick), nullptr, this); //register double-click
}
@@ -204,23 +205,30 @@ FfsTrayIcon::~FfsTrayIcon()
}
-void FfsTrayIcon::setToolTip(const wxString& toolTipText, double fraction)
+void FfsTrayIcon::setToolTip(const wxString& toolTip)
{
- trayIcon->SetIcon(generateIcon(fraction), toolTipText);
+ toolTipLast = toolTip;
+ trayIcon->SetIcon(generateIcon(fractionLast), toolTip); //another wxWidgets design bug: non-orthogonal method!
+}
+
+
+void FfsTrayIcon::setProgress(double fraction)
+{
+ fractionLast = fraction;
+ trayIcon->SetIcon(generateIcon(fraction), toolTipLast);
}
void FfsTrayIcon::OnContextMenuSelection(wxCommandEvent& event)
{
- const Selection eventId = static_cast<Selection>(event.GetId());
- switch (eventId)
+ switch (static_cast<Selection>(event.GetId()))
{
case CONTEXT_ABOUT:
{
//ATTENTION: the modal dialog below does NOT disable all GUI input, e.g. user may still double-click on tray icon
//which will implicitly destroy the tray icon while still showing the modal dialog
trayIcon->SetEvtHandlerEnabled(false);
- zen::showAboutDialog();
+ zen::showAboutDialog(nullptr);
trayIcon->SetEvtHandlerEnabled(true);
}
break;
bgstack15