Skip to content

Commit

Permalink
Switch to Segmented control in ControlPanel..
Browse files Browse the repository at this point in the history
..crash fix. Resolved: #2234
  • Loading branch information
rocksdanister committed Jan 5, 2025
1 parent d5ca68c commit f007584
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 74 deletions.
18 changes: 9 additions & 9 deletions src/Lively/Lively.UI.WinUI/Lively.UI.WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Collections" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.0.240109" />
<!--<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.0.240109" />-->
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Collections" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.1.240916" />
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.1.240916" />
<PackageReference Include="H.Hooks" Version="1.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.2.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,24 @@
<Flyout>
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="0" />
<Setter Property="Padding" Value="5" />
<Setter Property="CornerRadius" Value="5" />
</Style>
</Flyout.FlyoutPresenterStyle>
<Grid
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
BorderThickness="1"
CornerRadius="5">
<ListBox
Padding="-2.5"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
SelectedIndex="{Binding SelectedScreensaverArrangementIndex, Mode=TwoWay}">
<controls:Segmented SelectedIndex="{Binding SelectedScreensaverArrangementIndex, Mode=TwoWay}">
<controls:SegmentedItem>
<TextBlock>
<Run x:Uid="WallpaperLayoutPerScreen" />
<Run Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" Text="{Binding SelectedItem.Screen.Index, Mode=OneWay, Converter={StaticResource StringFormatConverter}, ConverterParameter='({0})'}" />
</TextBlock>
</controls:SegmentedItem>
<controls:SegmentedItem>
<TextBlock x:Uid="WallpaperLayoutSpan" />
</controls:SegmentedItem>
<controls:SegmentedItem>
<TextBlock x:Uid="WallpaperLayoutDuplicate" />
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
</controls:SegmentedItem>
</controls:Segmented>
</Flyout>
</Button.Flyout>
<StackPanel Orientation="Horizontal" Spacing="5">
Expand All @@ -95,31 +88,6 @@
<FontIcon FontSize="16" Glyph="&#xE894;" />
</Button>
</StackPanel>
<!--<Button
Grid.Row="1"
Margin="5"
HorizontalAlignment="Right"
IsEnabled="{Binding IsScreensaverLayout, Mode=OneWay}">
<Button.Flyout>
<Flyout>
<controls:Segmented SelectedIndex="{Binding SelectedScreensaverArrangementIndex, Mode=TwoWay}">
<controls:SegmentedItem>
<TextBlock>
<Run x:Uid="WallpaperLayoutPerScreen" />
<Run Foreground="{ThemeResource SystemAccentColorLight2}" Text="{Binding SelectedItem.Screen.Index, Mode=OneWay, Converter={StaticResource StringFormatConverter}, ConverterParameter='({0})'}" />
</TextBlock>
</controls:SegmentedItem>
<controls:SegmentedItem>
<TextBlock x:Uid="WallpaperLayoutSpan" />
</controls:SegmentedItem>
<controls:SegmentedItem>
<TextBlock x:Uid="WallpaperLayoutDuplicate" />
</controls:SegmentedItem>
</controls:Segmented>
</Flyout>
</Button.Flyout>
<FontIcon FontSize="16" Glyph="&#xE7F4;" />
</Button>-->

<Border Grid.RowSpan="2" Visibility="{Binding IsScreensaverPluginNotify, Mode=OneWay, Converter={StaticResource VisibilityConverter}}">
<Border.Background>
Expand Down Expand Up @@ -160,20 +128,14 @@
</controls:SettingsExpander.HeaderIcon>
<controls:SettingsExpander.Items>
<controls:SettingsCard ContentAlignment="Left">
<Grid
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
BorderThickness="1"
CornerRadius="5">
<ListBox Padding="-2.5" SelectedIndex="{Binding SelectedScreensaverTypeIndex, Mode=TwoWay}">
<controls:Segmented SelectedIndex="{Binding SelectedScreensaverTypeIndex, Mode=TwoWay}">
<controls:SegmentedItem>
<TextBlock x:Uid="ScreensaverModeSameWallpaper" />
</controls:SegmentedItem>
<controls:SegmentedItem>
<TextBlock x:Uid="ScreensaverModeDifferentWallpaper" />
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
</controls:SegmentedItem>
</controls:Segmented>
</controls:SettingsCard>
<controls:SettingsCard ContentAlignment="Left">
<CheckBox x:Uid="ScreensaverLockOnResume" IsChecked="{Binding IsScreensaverLockOnResume, Mode=TwoWay}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,20 @@
</controls:SettingsExpander.HeaderIcon>
<controls:SettingsExpander.Items>
<controls:SettingsCard ContentAlignment="Left">
<Grid
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
BorderThickness="1"
CornerRadius="5">
<ListBox Padding="-2.5" SelectedIndex="{Binding SelectedWallpaperLayoutIndex, Mode=TwoWay}">
<controls:Segmented SelectedIndex="{Binding SelectedWallpaperLayoutIndex, Mode=TwoWay}">
<controls:SegmentedItem>
<TextBlock>
<Run x:Uid="WallpaperLayoutPerScreen" />
<Run Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" Text="{Binding SelectedItem.Screen.Index, Mode=OneWay, Converter={StaticResource StringFormatConverter}, ConverterParameter='({0})'}" />
</TextBlock>
</controls:SegmentedItem>
<controls:SegmentedItem>
<TextBlock x:Uid="WallpaperLayoutSpan" />
</controls:SegmentedItem>
<controls:SegmentedItem>
<TextBlock x:Uid="WallpaperLayoutDuplicate" />
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
</controls:SegmentedItem>
</controls:Segmented>
</controls:SettingsCard>
<controls:SettingsCard ContentAlignment="Left">
<CheckBox x:Uid="WallpaperLayoutScreenPicker" IsChecked="{Binding IsRememberSelectedScreen, Mode=TwoWay, Converter={StaticResource BoolNegationConverter}}" />
Expand Down

0 comments on commit f007584

Please sign in to comment.