Skip to content

Commit

Permalink
change slider to numberbox #72
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniachi committed Dec 25, 2023
1 parent fe47679 commit c422d8c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Totoro.Core/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public SettingsViewModel(ISettings settings,
UpdateConnectionStatus();
}

public bool CanHandle() => BreadCrumbBar.BreadCrumbs.Count > 0;
public bool CanHandle() => BreadCrumbBar.BreadCrumbs.Count > 1;
public void GoBack() => BreadCrumbBar.BreadCrumbs.RemoveAt(BreadCrumbBar.BreadCrumbs.Count - 1);

private void UpdateConnectionStatus()
Expand Down
52 changes: 20 additions & 32 deletions Totoro.WinUI/Views/SettingsSections/GridViewSection.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,32 @@
Description="Value -1 means auto calculate number of columns based on item height and width"
Header="Max Number of Columns"
HeaderIcon="{ui:FontIcon Glyph=}">
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock VerticalAlignment="Center" Text="{x:Bind ColumnsSlider.Value, Mode=OneWay}" />
<Slider
x:Name="ColumnsSlider"
Maximum="20"
Minimum="-1"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.MaxNumberOfColumns, Mode=TwoWay}" />
</StackPanel>
<NumberBox
Maximum="20"
Minimum="-1"
SpinButtonPlacementMode="Inline"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.MaxNumberOfColumns, Mode=TwoWay}" />
</ctk:SettingsCard>
<ctk:SettingsCard Header="Item Height" HeaderIcon="{ui:FontIcon Glyph=&#xE76F;}">
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock VerticalAlignment="Center" Text="{x:Bind HeightSlider.Value, Mode=OneWay}" />
<Slider
x:Name="HeightSlider"
Maximum="400"
Minimum="100"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.ItemHeight, Mode=TwoWay}" />
</StackPanel>
<NumberBox
Maximum="400"
Minimum="100"
SpinButtonPlacementMode="Inline"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.ItemHeight, Mode=TwoWay}" />
</ctk:SettingsCard>
<ctk:SettingsCard Header="Desired Item Width" HeaderIcon="{ui:FontIcon Glyph=&#xE784;}">
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock VerticalAlignment="Center" Text="{x:Bind WidthSlider.Value, Mode=OneWay}" />
<Slider
x:Name="WidthSlider"
Maximum="400"
Minimum="100"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.DesiredWidth, Mode=TwoWay}" />
</StackPanel>
<NumberBox
Maximum="400"
Minimum="100"
SpinButtonPlacementMode="Inline"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.DesiredWidth, Mode=TwoWay}" />
</ctk:SettingsCard>
<ctk:SettingsCard Header="Spacing Between Items" HeaderIcon="{ui:FontIcon Glyph=&#xF573;}">
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock VerticalAlignment="Center" Text="{x:Bind SpacingSlider.Value, Mode=OneWay}" />
<Slider
x:Name="SpacingSlider"
Maximum="20"
Minimum="0"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.SpacingBetweenItems, Mode=TwoWay}" />
</StackPanel>
<NumberBox
Maximum="20"
Minimum="0"
SpinButtonPlacementMode="Inline"
Value="{x:Bind ViewModel.Settings.UserListGridViewSettings.SpacingBetweenItems, Mode=TwoWay}" />
</ctk:SettingsCard>

<TextBlock
Expand Down

0 comments on commit c422d8c

Please sign in to comment.