Skip to content

Commit

Permalink
Dont start minimized at first install
Browse files Browse the repository at this point in the history
  • Loading branch information
mgth committed May 9, 2024
1 parent d0bd82c commit 2fec890
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LittleBigMouse.Setup/LittleBigMouse.iss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OutputBaseFilename=LittleBigMouse_{#AppVer}

[Files]
Source: "..\LittleBigMouse.Ui\LittleBigMouse.Ui.Avalonia\bin\x64\Release\net8.0\*.exe"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: recursesubdirs
Source: "..\LittleBigMouse.Daemon\bin\x64\Release\*.exe"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: recursesubdirs
Source: "..\LittleBigMouse.Hook\bin\x64\Release\*.exe"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: recursesubdirs
Source: "..\LittleBigMouse.Ui\LittleBigMouse.Ui.Avalonia\bin\x64\Release\net8.0\*.dll"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: recursesubdirs
Source: "..\LittleBigMouse.Ui\LittleBigMouse.Ui.Avalonia\bin\x64\Release\net8.0\*.xml"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: recursesubdirs
Source: "..\LittleBigMouse.Ui\LittleBigMouse.Ui.Avalonia\bin\x64\Release\net8.0\*.json"; DestDir: "{app}"; Check: Is64BitInstallMode; Flags: recursesubdirs
Expand Down
2 changes: 1 addition & 1 deletion LittleBigMouse.Setup/LittleBigMouse.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
!define lbm_file "LittleBigMouse.Ui.Avalonia.exe"

!define main "..\LittleBigMouse.Ui\LittleBigMouse.Ui.Avalonia"
!define daemon "..\LittleBigMouse.Daemon"
!define daemon "..\LittleBigMouse.Hook"
!define main_out_dir "${main}\bin\x64\Release\net8.0"
!define daemon_out_dir "${daemon}\bin\x64\Release"

Expand Down
16 changes: 16 additions & 0 deletions LittleBigMouse.Ui/LittleBigMouse.Ui.Avalonia/Main/LbmOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public bool LoadAtStartup
}
bool _loadAtStartup;

[DataMember]
public bool StartMinimized
{
get => _startMinimized;
set => SetUnsavedValue(ref _startMinimized, value);
}
bool _startMinimized;

[DataMember]
public string Priority
{
Expand All @@ -46,6 +54,14 @@ public string Priority
}
string _priority = "Normal";

[DataMember]
public string PriorityUnhooked
{
get => _priorityUnhooked;
set => SetUnsavedValue(ref _priorityUnhooked, value);
}
string _priorityUnhooked = "Below";

[DataMember]
public bool LoopAllowed => true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ await _notify.AddMenuAsync(-1, "Stop","Icon/Stop", () =>

_notify.Show();

if(MonitorsLayout.Options.AutoUpdate)
// Check for update
if (MonitorsLayout.Options.AutoUpdate)
await CheckUpdateBlindAsync();

// Show control
if (!MonitorsLayout.Options.StartMinimized)
await ShowControlAsync();
}

public void AddControlPlugin(Action<IMainPluginsViewModel>? action)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@
Content="Load at startup"
IsChecked="{Binding Path=Model.LoadAtStartup, FallbackValue=false, Mode=TwoWay}"
ToolTip.Tip="Enable execution at session startup."/>

<CheckBox
Content="Start minimized"
IsChecked="{Binding Path=Model.StartMinimized, FallbackValue=false, Mode=TwoWay}"
ToolTip.Tip="Minimize to tray at startup."/>

<Label>Daemon Priority</Label>
<StackPanel Orientation="Horizontal">
<Label VerticalAlignment="Center">Hooked</Label>
<ComboBox
ItemsSource="{Binding PriorityList}"
SelectedItem="{Binding SelectedPriority}">
Expand All @@ -85,6 +92,26 @@
</ComboBox.ItemTemplate>

</ComboBox>
<Label VerticalAlignment="Center">Unhooked</Label>
<ComboBox
ItemsSource="{Binding PriorityList}"
SelectedItem="{Binding SelectedPriorityUnhooked}">

<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Transparent">
<Label Classes="RadioButtonListBox"
x:DataType="options:ListItem"
Content="{Binding Caption}"
Background="Transparent"
VerticalAlignment="Center"
ToolTip.Tip ="{Binding Description}"/>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>

</ComboBox>
</StackPanel>
</StackPanel>
</Border>
<Label
Expand Down
2 changes: 0 additions & 2 deletions LittleBigMouse.Ui/LittleBigMouse.Ui.Avalonia/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Reactive;
using System.Runtime.ExceptionServices;
using System.Threading;
using Avalonia;
using Avalonia.Controls;
Expand All @@ -19,7 +18,6 @@
using HLab.Sys.Windows.Monitors;
using HLab.UserNotification;
using HLab.UserNotification.Avalonia;
using LittleBigMouse.DisplayLayout;
using LittleBigMouse.DisplayLayout.Monitors;
using LittleBigMouse.Plugin.Layout.Avalonia.LocationPlugin;
using LittleBigMouse.Plugin.Vcp.Avalonia;
Expand Down

0 comments on commit 2fec890

Please sign in to comment.