Skip to content

Commit

Permalink
设置UI细节更改
Browse files Browse the repository at this point in the history
  • Loading branch information
natsurainko committed Jul 20, 2024
1 parent e73155e commit 93a6a9b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 23 deletions.
31 changes: 16 additions & 15 deletions Natsurainko.FluentLauncher/Views/Settings/DownloadPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,22 @@
Description="Please optimize and adjust according to the actual network environment"
Header="Maximum number of download threads"
HeaderIcon="{xh:FontIcon Glyph=}">
<Slider
Width="128"
Maximum="256"
Minimum="32"
Value="{Binding MaxDownloadThreads, Mode=TwoWay}">
<Slider.Header>
<TextBlock
VerticalAlignment="Center"
Style="{ThemeResource BaseTextBlockStyle}"
Text="{Binding MaxDownloadThreads}" />
</Slider.Header>
<i:Interaction.Behaviors>
<behaviors:SettingsCardContentMaxWidthBehavior AscendentType="Grid" AutoMaxWidth="True" />
</i:Interaction.Behaviors>
</Slider>
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock
VerticalAlignment="Center"
Style="{ThemeResource BaseTextBlockStyle}"
Text="{Binding MaxDownloadThreads}" />

<Slider
Width="128"
Maximum="256"
Minimum="32"
Value="{Binding MaxDownloadThreads, Mode=TwoWay}">
<i:Interaction.Behaviors>
<behaviors:SettingsCardContentMaxWidthBehavior AscendentType="Grid" AutoMaxWidth="True" />
</i:Interaction.Behaviors>
</Slider>
</StackPanel>
</controls:SettingsCard>

<controls:SettingsCard
Expand Down
34 changes: 32 additions & 2 deletions Natsurainko.FluentLauncher/Views/Settings/LaunchPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,21 @@
Loaded="Card_Loaded"
Tag="ActiveMinecraftFolder">
<controls:SettingsCard.Header>
<TextBlock x:Uid="Settings_LaunchPage_Text1" Text="Minecraft Folder" />
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock x:Uid="Settings_LaunchPage_Text1" Text="Minecraft Folder" />
<Border
Name="EnableText"
Padding="5,0"
CornerRadius="4">
<Border.Background>
<SolidColorBrush Opacity="0.15" Color="{ThemeResource SystemAccentColor}" />
</Border.Background>
<TextBlock
Foreground="{ThemeResource SystemAccentColor}"
Style="{ThemeResource BaseTextBlockStyle}"
Text="Enabled" />
</Border>
</StackPanel>
</controls:SettingsCard.Header>
<StackPanel
Name="Operations"
Expand Down Expand Up @@ -150,10 +164,26 @@
ActionIcon="{xh:FontIcon Glyph=&#xED43;}"
CommandParameter="{Binding}"
Description="{Binding}"
Header="{Binding Converter={ThemeResource JavaInfoConverter}}"
IsClickEnabled="True"
Loaded="Card_Loaded"
Tag="ActiveJava">
<controls:SettingsCard.Header>
<StackPanel Orientation="Horizontal" Spacing="10">
<TextBlock Text="{Binding Converter={ThemeResource JavaInfoConverter}}" />
<Border
Name="EnableText"
Padding="5,0"
CornerRadius="4">
<Border.Background>
<SolidColorBrush Opacity="0.25" Color="{ThemeResource SystemAccentColor}" />
</Border.Background>
<TextBlock
Foreground="{ThemeResource SystemAccentColor}"
Style="{ThemeResource BaseTextBlockStyle}"
Text="Enabled" />
</Border>
</StackPanel>
</controls:SettingsCard.Header>
<controls:SettingsCard.HeaderIcon>
<ImageIcon Source="{Binding Converter={ThemeResource JavaIconConverter}}" />
</controls:SettingsCard.HeaderIcon>
Expand Down
9 changes: 4 additions & 5 deletions Natsurainko.FluentLauncher/Views/Settings/LaunchPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using FluentLauncher.Infra.UI.Navigation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Natsurainko.FluentLauncher.Services.Settings;
using Natsurainko.FluentLauncher.Services.UI.Messaging;

Expand Down Expand Up @@ -36,12 +35,12 @@ private void Card_Loaded(object sender, RoutedEventArgs e)
if (m.PropertyName != tag)
return;
card.Background = path == m.Value ? (Brush)this.Resources["AccentButtonBackground"] : defaultBackground;
card.RequestedTheme = path == m.Value ? ElementTheme.Light : defaultTheme;
var enableText = card.FindName("EnableText") as Border;
enableText!.Visibility = path == m.Value ? Visibility.Visible : Visibility.Collapsed;
});

card.Background = path == current ? (Brush)this.Resources["AccentButtonBackground"] : defaultBackground;
card.RequestedTheme = path == current ? ElementTheme.Light : defaultTheme;
var enableText = card.FindName("EnableText") as Border;
enableText!.Visibility = path == current ? Visibility.Visible : Visibility.Collapsed;

card.Unloaded += (s, e) => WeakReferenceMessenger.Default.Unregister<SettingsStringValueChangedMessage>(sender);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<BreadcrumbBar
Grid.Row="0"
MaxWidth="1020"
Margin="30,15"
ItemsSource="{Binding Routes}">
<i:Interaction.Behaviors>
Expand Down

0 comments on commit 93a6a9b

Please sign in to comment.