Skip to content

Commit aabf1a3

Browse files
committed
Disable start menu installer for macos
1 parent 7d3d72f commit aabf1a3

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

YMouseButtonControl.Core/ViewModels/MainWindow/GlobalSettingsDialogViewModel.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class GlobalSettingsDialogViewModel : DialogBase, IGlobalSettingsDialogVi
2020
{
2121
private SettingBoolVm _startMinimizedSetting;
2222
private bool _loggingEnabled;
23-
private bool _startMenuEnabled;
23+
private bool _startMenuChecked;
2424
private SettingIntVm _themeSetting;
2525
private ObservableCollection<ThemeVm> _themeCollection;
2626
private ThemeVm _selectedTheme;
@@ -34,7 +34,8 @@ IThemeService themeService
3434
)
3535
: base(themeService)
3636
{
37-
_startMenuEnabled = startMenuInstallerService.InstallStatus();
37+
StartMenuEnabled = !OperatingSystem.IsMacOS();
38+
_startMenuChecked = StartMenuEnabled && startMenuInstallerService.InstallStatus();
3839
_startMinimizedSetting =
3940
settingsService.GetSetting("StartMinimized") as SettingBoolVm
4041
?? throw new Exception("Error retrieving StartMinimized setting");
@@ -58,7 +59,7 @@ IThemeService themeService
5859
x => x.LoggingEnabled,
5960
selector: val => val != enableLoggingService.GetLoggingState()
6061
);
61-
var startMenuChanged = this.WhenAnyValue(x => x.StartMenuEnabled,
62+
var startMenuChanged = this.WhenAnyValue(x => x.StartMenuChecked,
6263
selector: val => val != startMenuInstallerService.InstallStatus());
6364
var themeChanged = this.WhenAnyValue(
6465
x => x.ThemeSetting.IntValue,
@@ -87,9 +88,9 @@ IThemeService themeService
8788
}
8889
}
8990

90-
if (StartMenuEnabled != startMenuInstallerService.InstallStatus())
91+
if (StartMenuChecked != startMenuInstallerService.InstallStatus())
9192
{
92-
if (StartMenuEnabled)
93+
if (StartMenuChecked)
9394
{
9495
startMenuInstallerService.Install();
9596
}
@@ -111,11 +112,13 @@ IThemeService themeService
111112

112113
private bool AppIsExec => _applyIsExec?.Value ?? false;
113114

114-
public bool StartMenuEnabled
115+
public bool StartMenuChecked
115116
{
116-
get => _startMenuEnabled;
117-
set => this.RaiseAndSetIfChanged(ref _startMenuEnabled, value);
117+
get => _startMenuChecked;
118+
set => this.RaiseAndSetIfChanged(ref _startMenuChecked, value);
118119
}
120+
121+
public bool StartMenuEnabled { get; init; }
119122

120123
public SettingBoolVm StartMinimized
121124
{

YMouseButtonControl/Views/Dialogs/GlobalSettingsDialog.axaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020
IsChecked="{Binding StartMinimized.BoolValue}" />
2121
<CheckBox Grid.Row="1"
2222
Content="Start Menu"
23-
IsChecked="{Binding StartMenuEnabled}">
23+
IsEnabled="{Binding StartMenuEnabled}"
24+
IsChecked="{Binding StartMenuChecked}">
2425
<ToolTip.Tip>
2526
<TextBlock>
26-
Add YMouseButtonControl to the start menu
27+
Add YMouseButtonControl to the start menu.
28+
<LineBreak />
29+
Disabled for macOS.
2730
</TextBlock>
2831
</ToolTip.Tip>
2932
</CheckBox>

0 commit comments

Comments
 (0)