summaryrefslogtreecommitdiff
path: root/ui/tray_icon.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
commitc0cdb2ad99a1e2a6ade5ce76c91177a79258e669 (patch)
tree4701a015385d9a6a5a4ba99a8f1f5d400fff26b1 /ui/tray_icon.cpp
parent3.13 (diff)
downloadFreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.gz
FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.bz2
FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.zip
3.14
Diffstat (limited to 'ui/tray_icon.cpp')
-rw-r--r--ui/tray_icon.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/ui/tray_icon.cpp b/ui/tray_icon.cpp
index 087ee9d3..c307c7ab 100644
--- a/ui/tray_icon.cpp
+++ b/ui/tray_icon.cpp
@@ -27,9 +27,9 @@ wxIcon generateIcon(size_t percent) //generate icon with progress indicator
percent = std::min(percent, static_cast<size_t>(100)); //handle invalid input
#ifdef FFS_WIN
- static const wxBitmap trayIcon = GlobalResources::getInstance().getImageByName(wxT("FFS_tray_win.png"));
+ static const wxBitmap trayIcon = GlobalResources::instance().getImage(wxT("FFS_tray_win.png"));
#elif defined FFS_LINUX
- static const wxBitmap trayIcon = GlobalResources::getInstance().getImageByName(wxT("FFS_tray_linux.png"));
+ static const wxBitmap trayIcon = GlobalResources::instance().getImage(wxT("FFS_tray_linux.png"));
#endif
const int indicatorHeight = roundNum((trayIcon.GetHeight() * percent) / 100.0);
@@ -41,8 +41,8 @@ wxIcon generateIcon(size_t percent) //generate icon with progress indicator
wxImage genImage(trayIcon.ConvertToImage());
- if ( genImage.GetWidth() > 0 &&
- genImage.GetHeight() > 0)
+ if (genImage.GetWidth() > 0 &&
+ genImage.GetHeight() > 0)
{
const int indicatorWidth = genImage.GetWidth() * .4;
const int indicatorXBegin = std::ceil((genImage.GetWidth() - indicatorWidth) / 2.0);
@@ -131,7 +131,7 @@ private:
};
-MinimizeToTray::MinimizeToTray(wxTopLevelWindow* callerWnd, wxWindow* secondWnd) :
+MinimizeToTray::MinimizeToTray(wxTopLevelWindow* callerWnd, wxTopLevelWindow* secondWnd) :
callerWnd_(callerWnd),
secondWnd_(secondWnd),
trayIcon(new TaskBarImpl(this))
@@ -157,7 +157,10 @@ void MinimizeToTray::resumeFromTray() //remove trayIcon and restore windows: Mi
if (trayIcon)
{
if (secondWnd_)
+ {
+ secondWnd_->Iconize(false);
secondWnd_->Show();
+ }
if (callerWnd_) //usecase: avoid dialog flashing in batch silent mode
{
@@ -198,11 +201,11 @@ void MinimizeToTray::OnContextMenuSelection(wxCommandEvent& event)
const Selection eventId = static_cast<Selection>(event.GetId());
switch (eventId)
{
- case CONTEXT_ABOUT:
- ffs3::showAboutDialog();
- break;
- case CONTEXT_RESTORE:
- resumeFromTray();
+ case CONTEXT_ABOUT:
+ ffs3::showAboutDialog();
+ break;
+ case CONTEXT_RESTORE:
+ resumeFromTray();
}
}
bgstack15