Skip to content

Commit

Permalink
format xaml
Browse files Browse the repository at this point in the history
  • Loading branch information
United600 committed Feb 16, 2024
1 parent 60b6ef0 commit a056d19
Show file tree
Hide file tree
Showing 7 changed files with 340 additions and 282 deletions.
18 changes: 10 additions & 8 deletions src/Notepads/Resource/CustomSettingsStyle.xaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Notepads">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Notepads">

<!-- Common Control Properties -->
<!-- Common Control Properties -->
<Thickness x:Key="SettingsPagePadding">20,0</Thickness>
<Thickness x:Key="SettingsPageFooterMargin">0,0,0,32</Thickness>

<!-- Sections Spacing -->
<Thickness x:Key="ComboBoxBorderThemeThickness">1</Thickness>

<!-- Brushes -->
<StaticResource x:Key="ComboBoxBackground" ResourceKey="SystemControlTransparentBrush" />

<!-- Styles -->
<Style x:Key="SettingsSectionStyle" TargetType="StackPanel">
<Setter Property="Margin" Value="0,8" />
</Style>

<!-- Text Styles -->
<Style x:Key="CompactSubtitleTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubtitleTextBlockStyle}">
<Setter Property="FontSize" Value="18" />
<Setter Property="Margin" Value="0,0,0,10" />
</Style>

<Style x:Key="DescriptionTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource CaptionTextBlockStyle}">
<Setter Property="Foreground" Value="{ThemeResource SystemControlDescriptionTextForegroundBrush}" />
</Style>
Expand Down
59 changes: 32 additions & 27 deletions src/Notepads/Views/Settings/AboutPage.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Page
x:Class="Notepads.Views.Settings.AboutPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page x:Class="Notepads.Views.Settings.AboutPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid>
<Grid.ChildrenTransitions>
Expand All @@ -16,34 +15,36 @@
<BrushTransition />
</Grid.BackgroundTransition>

<ScrollViewer
Grid.Row="0"
Padding="{StaticResource SettingsPagePadding}"
IsTabStop="False"
UseSystemFocusVisuals="False"
VerticalScrollBarVisibility="Auto"
VerticalScrollMode="Auto">
<ScrollViewer Grid.Row="0"
Padding="{StaticResource SettingsPagePadding}"
VerticalScrollBarVisibility="Auto"
VerticalScrollMode="Auto"
IsTabStop="False"
UseSystemFocusVisuals="False">
<StackPanel Margin="{StaticResource SettingsPageFooterMargin}" HorizontalAlignment="Left">

<!-- About -->
<StackPanel Style="{StaticResource SettingsSectionStyle}" Orientation="Horizontal">
<Image x:Name="AppIconImage" Width="90" Margin="-6,0,12,0" Source="/Assets/appicon_ws.png" />
<Image x:Name="AppIconImage"
Width="90"
Margin="-6,0,12,0"
Source="/Assets/appicon_ws.png" />
<StackPanel>
<TextBlock
Margin="0,4"
FontWeight="Normal"
Style="{StaticResource TitleTextBlockStyle}"
Text="{x:Bind AppName, Mode=OneTime}" />
<TextBlock
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
Style="{StaticResource SubtitleTextBlockStyle}"
Text="{x:Bind AppVersion, Mode=OneTime}" />
<TextBlock Style="{StaticResource TitleTextBlockStyle}"
Margin="0,4"
FontWeight="Normal"
Text="{x:Bind AppName, Mode=OneTime}" />
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}"
Foreground="{ThemeResource SystemControlDescriptionTextForegroundBrush}"
Text="{x:Bind AppVersion, Mode=OneTime}" />
</StackPanel>
</StackPanel>

<!-- Description & Related Links -->
<StackPanel Style="{StaticResource SettingsSectionStyle}" Spacing="8">
<TextBlock x:Uid="/Settings/AboutPage_NotepadsShortDescription" Margin="0,0,0,8" TextWrapping="Wrap" />
<TextBlock x:Uid="/Settings/AboutPage_NotepadsShortDescription"
Margin="0,0,0,8"
TextWrapping="Wrap" />
<StackPanel Spacing="-4">
<TextBlock x:Uid="/Settings/AboutPage_Notepads_SourceCodeTitle" TextWrapping="Wrap" />
<HyperlinkButton Content="https://github.com/0x7c13/Notepads" NavigateUri="https://github.com/0x7c13/Notepads" />
Expand All @@ -65,13 +66,17 @@

<!-- Changelog -->
<StackPanel Style="{StaticResource SettingsSectionStyle}">
<TextBlock x:Uid="/Settings/AboutPage_ChangelogUrl_Title" Margin="0,0,0,4" Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<TextBlock x:Uid="/Settings/AboutPage_ChangelogUrl_Title"
Style="{StaticResource CompactSubtitleTextBlockStyle}"
Margin="0,0,0,4" />
<HyperlinkButton Content="Notepads Releases" NavigateUri="https://github.com/0x7c13/Notepads/releases" />
</StackPanel>

<!-- Dependencies & References -->
<StackPanel Style="{StaticResource SettingsSectionStyle}">
<TextBlock x:Uid="/Settings/AboutPage_DependenciesAndReferences_Title" Margin="0,0,0,4" Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<TextBlock x:Uid="/Settings/AboutPage_DependenciesAndReferences_Title"
Style="{StaticResource CompactSubtitleTextBlockStyle}"
Margin="0,0,0,4" />
<StackPanel Spacing="-4">
<HyperlinkButton Content="Windows UI Library" NavigateUri="https://github.com/Microsoft/microsoft-ui-xaml" />
<HyperlinkButton Content="Windows Community Toolkit" NavigateUri="https://github.com/windows-toolkit/WindowsCommunityToolkit" />
Expand Down
79 changes: 39 additions & 40 deletions src/Notepads/Views/Settings/AdvancedSettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<Page
x:Class="Notepads.Views.Settings.AdvancedSettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:utilities="using:Notepads.Utilities"
mc:Ignorable="d">
<Page x:Class="Notepads.Views.Settings.AdvancedSettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:utilities="using:Notepads.Utilities"
mc:Ignorable="d">

<Grid>
<Grid.ChildrenTransitions>
Expand All @@ -17,13 +16,12 @@
<BrushTransition />
</Grid.BackgroundTransition>

<ScrollViewer
Grid.Row="0"
Padding="{StaticResource SettingsPagePadding}"
IsTabStop="False"
UseSystemFocusVisuals="False"
VerticalScrollBarVisibility="Auto"
VerticalScrollMode="Auto">
<ScrollViewer Grid.Row="0"
Padding="{StaticResource SettingsPagePadding}"
VerticalScrollBarVisibility="Auto"
VerticalScrollMode="Auto"
IsTabStop="False"
UseSystemFocusVisuals="False">
<StackPanel Margin="{StaticResource SettingsPageFooterMargin}" HorizontalAlignment="Left">

<!-- Status Bar -->
Expand All @@ -45,7 +43,9 @@

<!-- Session Snapshot -->
<StackPanel x:Name="SessionSnapshotSettingsPanel" Style="{StaticResource SettingsSectionStyle}">
<TextBlock x:Name="SessionSnapshotSettingsTitle" x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_Title" Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<TextBlock x:Name="SessionSnapshotSettingsTitle"
x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_Title"
Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<StackPanel x:Name="SessionSnapshotSettingsControls">
<ToggleSwitch x:Name="EnableSessionSnapshotToggleSwitch" x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_OnOffToggleSwitch" Style="{StaticResource CustomToggleSwitchStyle}" />
<TextBlock x:Uid="/Settings/AdvancedPage_SessionSnapshotSettings_Description" Style="{ThemeResource DescriptionTextBlockStyle}" />
Expand All @@ -54,45 +54,44 @@

<!-- Launch -->
<StackPanel x:Name="LaunchPreferenceSettingsPanel" Style="{StaticResource SettingsSectionStyle}">
<TextBlock x:Name="LaunchPreferenceSettingsTitle" x:Uid="/Settings/AdvancedPage_LaunchPreferenceSettings_Title" Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<TextBlock x:Name="LaunchPreferenceSettingsTitle"
x:Uid="/Settings/AdvancedPage_LaunchPreferenceSettings_Title"
Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<StackPanel x:Name="LaunchPreferenceSettingsControls">
<ToggleSwitch x:Name="AlwaysOpenNewWindowToggleSwitch" x:Uid="/Settings/AdvancedPage_LaunchPreferenceSettings_AlwaysOpenNewWindowToggleSwitch" Style="{StaticResource CustomToggleSwitchStyle}" />
<TextBlock
x:Uid="/Settings/AdvancedPage_AlwaysOpenNewWindow_Description"
Margin="0,0,0,10"
Style="{ThemeResource DescriptionTextBlockStyle}" />
<TextBlock x:Uid="/Settings/AdvancedPage_AlwaysOpenNewWindow_Description"
Style="{ThemeResource DescriptionTextBlockStyle}"
Margin="0,0,0,10" />
<ToggleSwitch x:Name="ExitWhenLastTabClosedToggleSwitch" x:Uid="/Settings/AdvancedPage_LaunchPreferenceSettings_ExitWhenLastTabClosedToggleSwitch" Style="{StaticResource CustomToggleSwitchStyle}" />
</StackPanel>
</StackPanel>

<!-- Language -->
<StackPanel Style="{StaticResource SettingsSectionStyle}">
<TextBlock x:Name="LanguagePreferenceSettingsTitle" x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Title" Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<TextBlock x:Name="LanguagePreferenceSettingsTitle"
x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Title"
Style="{StaticResource CompactSubtitleTextBlockStyle}" />
<StackPanel x:Name="LanguagePreferenceSettingsControls" Margin="0,6,0,0">
<ComboBox
x:Name="LanguagePicker"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Background="Transparent"
IsTextSearchEnabled="True"
ItemsSource="{x:Bind SupportedLanguages, Mode=OneTime}">
<ComboBox x:Name="LanguagePicker"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsTextSearchEnabled="True"
ItemsSource="{x:Bind SupportedLanguages, Mode=OneTime}">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="utilities:LanguageItem">
<TextBlock Text="{x:Bind Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock
x:Name="RestartPrompt"
x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_RestartPrompt"
Margin="0,8,0,0"
Foreground="{ThemeResource SystemControlErrorTextForegroundBrush}"
Style="{ThemeResource DescriptionTextBlockStyle}"
Visibility="Collapsed" />
<TextBlock
x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Description"
Margin="0,6,0,0"
Style="{ThemeResource DescriptionTextBlockStyle}" />
<TextBlock x:Name="RestartPrompt"
x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_RestartPrompt"
Style="{ThemeResource DescriptionTextBlockStyle}"
Foreground="{ThemeResource SystemControlErrorTextForegroundBrush}"
Margin="0,8,0,0"
Visibility="Collapsed" />
<TextBlock x:Uid="/Settings/AdvancedPage_LanguagePreferenceSettings_Description"
Style="{ThemeResource DescriptionTextBlockStyle}"
Margin="0,6,0,0" />
</StackPanel>
</StackPanel>

Expand Down

0 comments on commit a056d19

Please sign in to comment.