Skip to content

Commit e18b9eb

Browse files
committed
feat: move message being shown in popups to the status bar
1 parent 4ac517e commit e18b9eb

6 files changed

Lines changed: 36 additions & 19 deletions

File tree

Desktop/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected override void OnStartup(StartupEventArgs e)
2828
services.AddSingleton<TaskCreation>();
2929
services.AddTransient<TaskCreationViewModel>();
3030
services.AddTransient<TaskListViewModel>();
31-
services.AddSingleton<IMessageNotifier, Popup>();
31+
services.AddSingleton<IMessageNotifier, StatusBar>();
3232
services.AddSingleton<ITaskRepository, FileSystemTaskRepository>();
3333
services.AddBackendTaskRepository(Config);
3434

Desktop/Common/Popup.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

Desktop/Common/StatusBar.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Desktop.Common;
2+
3+
public class StatusBar : IMessageNotifier
4+
{
5+
private readonly MainWindowViewModel mainWindowViewModel;
6+
7+
public StatusBar(MainWindowViewModel mainWindowViewModel)
8+
{
9+
this.mainWindowViewModel = mainWindowViewModel;
10+
}
11+
12+
public void Notify(string message)
13+
{
14+
mainWindowViewModel.StatusMessage = message;
15+
}
16+
}

Desktop/MainWindow.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@
6868
<Label
6969
Content="{Binding IsBackendAvailable, Converter={StaticResource BoolToAvailabilityTextConverter}}" />
7070
</StatusBarItem>
71+
<StatusBarItem>
72+
<Separator Width="1" Height="26" />
73+
</StatusBarItem>
74+
<StatusBarItem>
75+
<Label Content="{Binding StatusMessage}">
76+
</Label>
77+
</StatusBarItem>
7178
</StatusBar>
7279
<Grid Margin="{StaticResource DefaultMargin}">
7380
<Grid.ColumnDefinitions>

Desktop/MainWindowViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ public bool IsBackendAvailable
2222
}
2323
}
2424

25+
private string statusMessage;
26+
27+
public string StatusMessage
28+
{
29+
get => statusMessage;
30+
set
31+
{
32+
statusMessage = value;
33+
OnPropertyChanged();
34+
}
35+
}
36+
2537
public MainWindowViewModel(IRemoteTaskRepository backend)
2638
{
2739
periodicBackendAvailabilityCheckTimer = new DispatcherTimer

Desktop/TODO.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
- feat: style the front
2-
- Sidebar menu
32
- Align to the right the "Add Task" button?
4-
- Status bar for backend availability (and description text about the availability or error messages)
5-
- Replace Windows default MessageBox with ones that follow the theme
63
- Fluent dark theme doesn't seem to have good enough contrast. Force the light mode?
74
- fix(file system repository): tasks names with whitespaces are trimmed so that only the first word is displayed
85
- feat: Flow metrics (MonteCSharp integration)

0 commit comments

Comments
 (0)