diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2014-09-14 18:52:14 +0400 |
---|---|---|
committer | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2014-11-08 01:20:18 +0300 |
commit | 3c6f20d7fe175763b7e6daed1ad207e0a7b8a0da (patch) | |
tree | f357531a7a0a893ae921e2c67928401f92b2791e /main/src/addins/WindowsPlatform | |
parent | 75151b5fcb2a61c3c84d8c28431c246ba3617633 (diff) |
[Windows] Taskbar status changes
It now only removes the completed event if MD is in focus.
Added support for unknown length tasks.
Error is now a full bar.
Diffstat (limited to 'main/src/addins/WindowsPlatform')
-rw-r--r-- | main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs index 45fea36671..478602d9fb 100644 --- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs +++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs @@ -71,20 +71,41 @@ namespace MonoDevelop.Platform } } + void ResetGlobalProgressState (object sender, EventArgs e) + { + IntPtr handle = GdkWin32.HgdiobjGet (MessageService.RootWindow.GdkWindow); + TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.NoProgress, handle); + IdeApp.FocusIn -= ResetGlobalProgressState; + } + public override void SetGlobalProgressBar (double progress) { if (!TaskbarManager.IsPlatformSupported) return; IntPtr handle = GdkWin32.HgdiobjGet (MessageService.RootWindow.GdkWindow); - if (progress == 1) { - TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.NoProgress, handle); + if (progress == 1.0) { + if (IdeApp.HasInputFocus) + ResetGlobalProgressState (null, null); + else { + TaskbarManager.Instance.SetProgressValue ((int)(progress * 100f), 100, handle); + IdeApp.FocusIn += ResetGlobalProgressState; + } } else { TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.Normal, handle); TaskbarManager.Instance.SetProgressValue ((int)(progress * 100f), 100, handle); } } + public override void ShowGlobalProgressBarIndeterminate () + { + if (!TaskbarManager.IsPlatformSupported) + return; + + IntPtr handle = GdkWin32.HgdiobjGet (MessageService.RootWindow.GdkWindow); + TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.Indeterminate, handle); + } + public override void ShowGlobalProgressBarError () { if (!TaskbarManager.IsPlatformSupported) @@ -92,6 +113,7 @@ namespace MonoDevelop.Platform IntPtr handle = GdkWin32.HgdiobjGet (MessageService.RootWindow.GdkWindow); TaskbarManager.Instance.SetProgressState (TaskbarProgressBarState.Error, handle); + TaskbarManager.Instance.SetProgressValue (1, 1, handle); } public override object GetFileAttributes (string fileName) |