Skip to content

Commit b44019e

Browse files
committed
Added taskbar icon progress bar. Closes #71
1 parent eb7d7d4 commit b44019e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

CompactGUI/ViewModels/MainViewModel.vb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Public Class MainViewModel : Inherits ObservableObject
226226
Await Watcher.EnableBackgrounding()
227227
End Sub
228228

229-
Dim CProgress As IProgress(Of (Integer, String)) = New Progress(Of (Integer, String))(Sub(val) WorkingProgress = New Tuple(Of Integer, String)(val.Item1, val.Item2.Replace(ActiveFolder.FolderName, "")))
229+
Dim CProgress As IProgress(Of (Integer, String)) = New Progress(Of (Integer, String))(Sub(val) WorkingProgress = New Tuple(Of Integer, String, Double, String)(val.Item1, val.Item2.Replace(ActiveFolder.FolderName, ""), val.Item1 / 100.0, WorkingProgress.Item4))
230230

231231

232232
Private Async Function GetWikiResultsAndSetPoorlyCompressedList() As Task(Of Long)
@@ -319,10 +319,19 @@ Public Class MainViewModel : Inherits ObservableObject
319319
Set(value As String)
320320
If State <> "FolderWatcherView" Then LastState = State
321321
_State = value
322+
323+
If State = "AnalysingFolderSelected" Then
324+
WorkingProgress = New Tuple(Of Integer, String, Double, String)(WorkingProgress.Item1, WorkingProgress.Item2, WorkingProgress.Item3, "Indeterminate")
325+
ElseIf State = "CurrentlyCompressing" Then
326+
WorkingProgress = New Tuple(Of Integer, String, Double, String)(WorkingProgress.Item1, WorkingProgress.Item2, WorkingProgress.Item3, "Normal")
327+
Else
328+
WorkingProgress = New Tuple(Of Integer, String, Double, String)(WorkingProgress.Item1, WorkingProgress.Item2, WorkingProgress.Item3, "None")
329+
End If
330+
322331
End Set
323332
End Property
324333
Public Property SteamBGImage As BitmapImage = Nothing
325-
Public Property WorkingProgress As New Tuple(Of Integer, String)(0, "")
334+
Public Property WorkingProgress As New Tuple(Of Integer, String, Double, String)(0, "", 0, "None")
326335
Public Property Watcher As CompactGUI.Watcher.Watcher
327336
Public ReadOnly Property IsAdmin As Boolean = (New Security.Principal.WindowsPrincipal(Security.Principal.WindowsIdentity.GetCurrent()).IsInRole(Security.Principal.WindowsBuiltInRole.Administrator))
328337
Public ReadOnly Property BindableSettings As Settings

CompactGUI/Views/MainWindow.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
</ResourceDictionary>
3232

3333
</Window.Resources>
34-
34+
35+
<Window.TaskbarItemInfo>
36+
<TaskbarItemInfo x:Name="taskbarItemInfo" ProgressValue="{Binding WorkingProgress.Item3}" ProgressState="{Binding WorkingProgress.Item4}" />
37+
</Window.TaskbarItemInfo>
38+
3539
<Grid x:Name="BaseView" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
3640
<Grid.LayoutTransform>
3741
<ScaleTransform x:Name="ApplicationScaleTransform"

0 commit comments

Comments
 (0)