Skip to content

Commit 1734cea

Browse files
Add an override button for settings
1 parent 54bce17 commit 1734cea

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

Src/FinderOuter/ViewModels/MainWindowViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ private void SelectedOption_PropertyChanged(object sender, PropertyChangedEventA
9696
public Settings Settings { get; set; } = new();
9797
public IClipboard Clipboard { get; set; }
9898

99+
private bool _isCap = true;
100+
public bool IsCappedSettings
101+
{
102+
get => _isCap;
103+
set => this.RaiseAndSetIfChanged(ref _isCap, value);
104+
}
105+
106+
public void OverrideSettings()
107+
{
108+
IsCappedSettings = false;
109+
}
110+
99111
public void OpenAbout()
100112
{
101113
WinMan.ShowDialog(new AboutViewModel(Clipboard));

Src/FinderOuter/Views/MainWindow.axaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@
7878

7979
<Grid ColumnDefinitions="auto,*" RowDefinitions="auto,auto,auto,auto" Grid.Column="0" Grid.Row="3" Background="#e5e5e5">
8080
<Expander Header="Settings" Margin="5,0,0,10" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" IsExpanded="False">
81-
<Grid ColumnDefinitions="auto,*,auto">
81+
<Grid ColumnDefinitions="auto,*,auto,auto">
8282
<TextBlock Text="Cores:"/>
8383
<Slider Value="{Binding Settings.CoreCount}"
8484
Minimum="1" Maximum="{Binding Settings.MaxCoreCount}"
85+
IsVisible="{Binding IsCappedSettings}"
8586
VerticalAlignment="Center"
8687
TickFrequency="1"
8788
IsSnapToTickEnabled="True"
@@ -96,8 +97,17 @@
9697
</Style>
9798
</Slider.Styles>
9899
</Slider>
99-
<TextBlock Text="{Binding Settings.CoreCount}" Grid.Column="2"/>
100-
<!--Add override button here? Grid.Column="2"-->
100+
<TextBlock Text="{Binding Settings.CoreCount}"
101+
IsVisible="{Binding IsCappedSettings}"
102+
Grid.Column="2"/>
103+
<NumericUpDown Value="{Binding Settings.CoreCount}"
104+
IsVisible="{Binding !IsCappedSettings}"
105+
Height="40" Width="70"
106+
Grid.Column="2"/>
107+
<Button Content="Override" Command="{Binding OverrideSettings}"
108+
IsEnabled="{Binding IsCappedSettings}"
109+
Height="40"
110+
Grid.Column="3"/>
101111
</Grid>
102112
</Expander>
103113

0 commit comments

Comments
 (0)