Skip to content

Commit ad88e9f

Browse files
committed
Update CreateArchiveDialog.xaml
1 parent 49b2b71 commit ad88e9f

File tree

3 files changed

+95
-99
lines changed

3 files changed

+95
-99
lines changed

src/Files.App/Dialogs/CreateArchiveDialog.xaml

+89-90
Original file line numberDiff line numberDiff line change
@@ -23,138 +23,137 @@
2323

2424
<ContentDialog.Resources>
2525
<ResourceDictionary>
26-
<Style x:Key="GridSettingStyle" TargetType="Grid">
27-
<Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />
28-
<Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
29-
<Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
30-
<Setter Property="HorizontalAlignment" Value="Stretch" />
31-
<Setter Property="Padding" Value="-24,4,20,4" />
32-
<Setter Property="MinHeight" Value="{StaticResource ExpanderMinHeight}" />
33-
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
34-
</Style>
35-
3626
<ResourceDictionary.MergedDictionaries>
3727
<ResourceDictionary Source="/ResourceDictionaries/RightAlignedToggleSwitchStyle.xaml" />
3828
</ResourceDictionary.MergedDictionaries>
3929
</ResourceDictionary>
4030
</ContentDialog.Resources>
4131

42-
<StackPanel Padding="0,8,0,0" Spacing="24">
43-
44-
<Grid ColumnSpacing="8">
32+
<StackPanel Width="440" Spacing="8">
33+
<!-- Archive Name -->
34+
<Grid
35+
Padding="12"
36+
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
37+
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
38+
BorderThickness="1"
39+
ColumnSpacing="8"
40+
CornerRadius="4">
4541
<Grid.ColumnDefinitions>
4642
<ColumnDefinition Width="*" />
4743
<ColumnDefinition Width="Auto" />
4844
</Grid.ColumnDefinitions>
49-
45+
<TextBlock
46+
Grid.Column="0"
47+
VerticalAlignment="Center"
48+
Text="{helpers:ResourceString Name=ArchiveName}" />
5049
<TextBox
5150
x:Name="FileNameBox"
52-
Width="340"
53-
VerticalAlignment="Bottom"
54-
Header="{helpers:ResourceString Name=ArchiveName}"
51+
Grid.Column="1"
52+
Width="260"
5553
PlaceholderText="{helpers:ResourceString Name=EnterName}"
5654
Text="{x:Bind ViewModel.FileName, Mode=TwoWay}" />
55+
</Grid>
56+
57+
<!-- Archive Options -->
58+
<Grid
59+
Padding="12"
60+
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
61+
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
62+
BorderThickness="1"
63+
ColumnSpacing="8"
64+
CornerRadius="4"
65+
RowSpacing="12">
66+
<Grid.ColumnDefinitions>
67+
<ColumnDefinition Width="*" />
68+
<ColumnDefinition Width="Auto" />
69+
</Grid.ColumnDefinitions>
70+
<Grid.RowDefinitions>
71+
<RowDefinition Height="Auto" />
72+
<RowDefinition Height="Auto" />
73+
<RowDefinition Height="Auto" />
74+
</Grid.RowDefinitions>
75+
76+
<!-- Archive Format -->
77+
<TextBlock
78+
Grid.Row="0"
79+
Grid.Column="0"
80+
VerticalAlignment="Center"
81+
Text="{helpers:ResourceString Name=Format}" />
5782
<ComboBox
5883
x:Name="FileFormatSelector"
84+
Grid.Row="0"
5985
Grid.Column="1"
60-
MinWidth="100"
61-
VerticalAlignment="Bottom"
86+
Width="140"
6287
ItemsSource="{x:Bind ViewModel.FileFormats}"
6388
SelectedItem="{x:Bind ViewModel.FileFormat, Mode=TwoWay}"
6489
SelectedValuePath="Key">
6590
<ComboBox.ItemTemplate>
6691
<DataTemplate>
67-
<Grid ColumnSpacing="24">
68-
<Grid.ColumnDefinitions>
69-
<ColumnDefinition Width="Auto" />
70-
<ColumnDefinition Width="*" />
71-
</Grid.ColumnDefinitions>
72-
<TextBlock Text="{Binding Label}" />
73-
<TextBlock
74-
Grid.Column="1"
75-
VerticalAlignment="Bottom"
76-
FontSize="12"
77-
FontWeight="Light"
78-
Text="{Binding Description}"
79-
TextWrapping="Wrap"
80-
Visibility="{Binding IsDropDownOpen, ElementName=FileFormatSelector}" />
81-
</Grid>
92+
<TextBlock Text="{Binding Label}" />
8293
</DataTemplate>
8394
</ComboBox.ItemTemplate>
8495
</ComboBox>
96+
97+
<!-- Compression Level -->
98+
<TextBlock
99+
Grid.Row="1"
100+
Grid.Column="0"
101+
VerticalAlignment="Center"
102+
Text="{helpers:ResourceString Name=CompressionLevel}" />
103+
<ComboBox
104+
x:Name="CompressionLevelSelector"
105+
Grid.Row="1"
106+
Grid.Column="1"
107+
Width="140"
108+
HorizontalAlignment="Right"
109+
DisplayMemberPath="Label"
110+
ItemsSource="{x:Bind ViewModel.CompressionLevels}"
111+
SelectedItem="{x:Bind ViewModel.CompressionLevel, Mode=TwoWay}"
112+
SelectedValuePath="Key" />
113+
114+
<!-- Splitting Size -->
115+
<TextBlock
116+
Grid.Row="2"
117+
Grid.Column="0"
118+
VerticalAlignment="Center"
119+
Text="{helpers:ResourceString Name=SplittingSize}" />
120+
<ComboBox
121+
x:Name="SplittingSizeSelector"
122+
Grid.Row="2"
123+
Grid.Column="1"
124+
Width="140"
125+
HorizontalAlignment="Right"
126+
DisplayMemberPath="Label"
127+
IsEnabled="{x:Bind ViewModel.CanSplit, Mode=OneWay}"
128+
ItemsSource="{x:Bind ViewModel.SplittingSizes}"
129+
SelectedItem="{x:Bind ViewModel.SplittingSize, Mode=TwoWay}"
130+
SelectedValuePath="Key" />
85131
</Grid>
86132

87-
<StackPanel Spacing="4">
88-
<Grid Style="{StaticResource GridSettingStyle}">
89-
<settings:SettingsDisplayControl Title="{helpers:ResourceString Name=CompressionLevel}" HorizontalAlignment="Stretch">
90-
<ComboBox
91-
x:Name="CompressionLevelSelector"
92-
HorizontalAlignment="Right"
93-
DisplayMemberPath="Label"
94-
ItemsSource="{x:Bind ViewModel.CompressionLevels}"
95-
SelectedItem="{x:Bind ViewModel.CompressionLevel, Mode=TwoWay}"
96-
SelectedValuePath="Key" />
97-
</settings:SettingsDisplayControl>
98-
</Grid>
99-
<Grid
100-
x:Name="SplittingSizeLayout"
101-
x:Load="{x:Bind ViewModel.CanSplit, Mode=OneWay}"
102-
Style="{StaticResource GridSettingStyle}">
103-
<settings:SettingsDisplayControl Title="{helpers:ResourceString Name=SplittingSize}" HorizontalAlignment="Stretch">
104-
<ComboBox
105-
x:Name="SplittingSizeSelector"
106-
HorizontalAlignment="Right"
107-
DisplayMemberPath="Label"
108-
ItemsSource="{x:Bind ViewModel.SplittingSizes}"
109-
SelectedItem="{x:Bind ViewModel.SplittingSize, Mode=TwoWay}"
110-
SelectedValuePath="Key" />
111-
</settings:SettingsDisplayControl>
112-
</Grid>
113-
<StackPanel>
114-
<Grid Style="{StaticResource GridSettingStyle}">
115-
<settings:SettingsDisplayControl
116-
Title="{helpers:ResourceString Name=Encryption}"
117-
Padding="-24,4,20,4"
118-
HorizontalAlignment="Stretch">
119-
<ToggleSwitch
120-
x:Name="EncryptionSwitch"
121-
HorizontalAlignment="Right"
122-
IsOn="{x:Bind ViewModel.UseEncryption, Mode=TwoWay}"
123-
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
124-
</settings:SettingsDisplayControl>
125-
</Grid>
126-
<Grid
127-
x:Name="PasswordLayout"
128-
HorizontalAlignment="Stretch"
129-
x:Load="{x:Bind ViewModel.UseEncryption, Mode=OneWay}"
130-
Background="{StaticResource ExpanderDropDownBackground}"
131-
BorderBrush="{StaticResource ExpanderDropDownBorderBrush}"
132-
BorderThickness="{StaticResource ExpanderDropdownDownBorderThickness}"
133-
CornerRadius="{StaticResource ControlCornerRadius}">
133+
<!-- Encryption Options -->
134+
<Expander HorizontalAlignment="Stretch" Header="{helpers:ResourceString Name=Encryption}">
135+
<Expander.Content>
136+
<Grid Width="400">
134137
<Grid.ColumnDefinitions>
135-
<ColumnDefinition Width="Auto" />
136138
<ColumnDefinition Width="*" />
139+
<ColumnDefinition Width="Auto" />
137140
</Grid.ColumnDefinitions>
138141
<TextBlock
139-
Margin="36,0,0,0"
142+
Grid.Column="0"
140143
VerticalAlignment="Center"
141144
Text="{helpers:ResourceString Name=Password}" />
142145
<PasswordBox
143146
x:Name="PasswordBox"
144147
Grid.Column="1"
145-
MinWidth="160"
146-
MaxWidth="280"
147-
Margin="16,8"
148-
HorizontalAlignment="Right"
148+
Width="260"
149149
IsPasswordRevealButtonEnabled="True"
150150
Loading="PasswordBox_Loading"
151151
Password="{x:Bind ViewModel.Password, Mode=TwoWay}"
152152
PasswordRevealMode="Peek"
153153
PlaceholderText="{helpers:ResourceString Name=Password}" />
154154
</Grid>
155-
</StackPanel>
156-
</StackPanel>
157-
155+
</Expander.Content>
156+
</Expander>
158157
</StackPanel>
159158

160159
</ContentDialog>

src/Files.App/Dialogs/CreateArchiveDialog.xaml.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ public string Password
145145

146146
public IImmutableList<FileFormatItem> FileFormats { get; } = new List<FileFormatItem>
147147
{
148-
new(ArchiveFormats.Zip, ".zip", "CompressionFormatZipDescription".GetLocalizedResource()),
149-
new(ArchiveFormats.SevenZip, ".7z", "CompressionFormatSevenZipDescription".GetLocalizedResource()),
148+
new(ArchiveFormats.Zip, ".zip"),
149+
new(ArchiveFormats.SevenZip, ".7z"),
150150
}.ToImmutableList();
151151

152152
public IImmutableList<CompressionLevelItem> CompressionLevels { get; } = new List<CompressionLevelItem>
@@ -184,7 +184,7 @@ public DialogViewModel()
184184
private static string ToSizeText(ulong size) => ByteSize.FromMebiBytes(size).ShortString;
185185
private static string ToSizeText(ulong size, string labelKey) => $"{ToSizeText(size)} - {labelKey}";
186186

187-
public record FileFormatItem(ArchiveFormats Key, string Label, string Description);
187+
public record FileFormatItem(ArchiveFormats Key, string Label);
188188
public record CompressionLevelItem(ArchiveCompressionLevels Key, string Label);
189189
public record SplittingSizeItem(ArchiveSplittingSizes Key, string Label);
190190
}

src/Files.App/Strings/en-US/Resources.resw

+3-6
Original file line numberDiff line numberDiff line change
@@ -2877,12 +2877,6 @@
28772877
<data name="EnterName" xml:space="preserve">
28782878
<value>Enter a name</value>
28792879
</data>
2880-
<data name="CompressionFormatZipDescription" xml:space="preserve">
2881-
<value>Works natively with Windows.</value>
2882-
</data>
2883-
<data name="CompressionFormatSevenZipDescription" xml:space="preserve">
2884-
<value>Smaller archives but requires compatible software.</value>
2885-
</data>
28862880
<data name="CompressionLevel" xml:space="preserve">
28872881
<value>Compression level</value>
28882882
</data>
@@ -2931,4 +2925,7 @@
29312925
<data name="Password" xml:space="preserve">
29322926
<value>Password</value>
29332927
</data>
2928+
<data name="Format" xml:space="preserve">
2929+
<value>Format</value>
2930+
</data>
29342931
</root>

0 commit comments

Comments
 (0)