Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion LittleBigMouse.Ui/LittleBigMouse.Ui.Avalonia/Main/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ public async Task StartNotifierAsync()
await _notify.AddMenuAsync(-1, "Start","Icon/Start", StartAsync);
await _notify.AddMenuAsync(-1, "Stop","Icon/Stop", () =>
{
MonitorsLayout.Options.Enabled = false;
MonitorsLayout.Options.Enabled = false;
MonitorsLayout.SaveEnabled();
return _littleBigMouseClientService.StopAsync();
});
await _notify.AddMenuAsync(-1, "Refresh", "Icon/lbm_on", RefreshAsync);
await _notify.AddMenuAsync(-1, "Exit", "Icon/sys/Close", QuitAsync);

await _notify.SetIconAsync("Icon/lbm_off",128);
Expand All @@ -181,6 +182,15 @@ async Task QuitAsync()

Task StartAsync() => _littleBigMouseClientService.StartAsync(MonitorsLayout.ComputeZones());

async Task RefreshAsync()
{
UpdateLayout();
if (MonitorsLayout.Options.Enabled)
{
await StartAsync();
}
}

bool _justConnected = false;
async Task DaemonEventReceived(object? sender, LittleBigMouseServiceEventArgs args)
{
Expand Down