|
12 | 12 | xmlns:uc="using:Files.App.UserControls" |
13 | 13 | xmlns:vm="using:Files.App.ViewModels.Settings" |
14 | 14 | xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters" |
| 15 | + SizeChanged="Page_SizeChanged" |
15 | 16 | mc:Ignorable="d"> |
16 | 17 |
|
17 | 18 | <Page.Resources> |
|
70 | 71 | <ColumnDefinition Width="*" /> |
71 | 72 | <ColumnDefinition Width="Auto" /> |
72 | 73 | </Grid.ColumnDefinitions> |
| 74 | + |
73 | 75 | <Grid.RowDefinitions> |
74 | 76 | <RowDefinition Height="*" /> |
75 | 77 | <RowDefinition Height="*" /> |
| 78 | + <RowDefinition Height="Auto" /> |
76 | 79 | </Grid.RowDefinitions> |
| 80 | + |
| 81 | + <!-- IDE Path --> |
77 | 82 | <TextBlock |
78 | 83 | x:Name="IDEPath" |
79 | 84 | MaxWidth="200" |
80 | 85 | VerticalAlignment="Center" |
| 86 | + x:Load="{x:Bind ViewModel.IsEditingIDEConfig, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" |
81 | 87 | LineHeight="18" |
82 | 88 | Text="{helpers:ResourceString Name=PathOrAlias}" |
83 | 89 | TextTrimming="CharacterEllipsis" /> |
|
90 | 96 | TextTrimming="CharacterEllipsis" |
91 | 97 | Visibility="{x:Bind ViewModel.IsEditingIDEConfig, Converter={StaticResource InvertedBoolVisibilityConverter}, Mode=OneWay}" /> |
92 | 98 |
|
93 | | - <StackPanel |
94 | | - Grid.Column="1" |
95 | | - Orientation="Horizontal" |
96 | | - Spacing="8" |
| 99 | + <Grid |
| 100 | + x:Name="IDEPathGrid" |
| 101 | + Grid.ColumnSpan="3" |
| 102 | + Margin="0,0,0,8" |
| 103 | + ColumnSpacing="8" |
97 | 104 | Visibility="{x:Bind ViewModel.IsEditingIDEConfig, Converter={StaticResource BoolVisibilityConverter}, Mode=OneWay}"> |
| 105 | + <Grid.ColumnDefinitions> |
| 106 | + <ColumnDefinition Width="Auto" /> |
| 107 | + <ColumnDefinition Width="Auto" /> |
| 108 | + <ColumnDefinition Width="*" /> |
| 109 | + </Grid.ColumnDefinitions> |
| 110 | + |
| 111 | + <Grid.RowDefinitions> |
| 112 | + <RowDefinition Height="*" /> |
| 113 | + <RowDefinition Height="Auto" /> |
| 114 | + <RowDefinition Height="Auto" /> |
| 115 | + </Grid.RowDefinitions> |
| 116 | + |
98 | 117 | <TextBox |
99 | 118 | x:Name="IDEPathTextBox" |
100 | 119 | Width="300" |
|
106 | 125 | </TextBox.Resources> |
107 | 126 | </TextBox> |
108 | 127 |
|
109 | | - <Button |
110 | | - x:Name="PickIDEExe" |
111 | | - Command="{x:Bind ViewModel.OpenFilePickerForIDECommand, Mode=OneWay}" |
112 | | - Content="{helpers:ResourceString Name=Browse}" /> |
113 | | - <Button |
114 | | - x:Name="TestIDE" |
115 | | - Command="{x:Bind ViewModel.TestIDECommand, Mode=OneWay}" |
116 | | - Content="{helpers:ResourceString Name=Test}" /> |
117 | | - </StackPanel> |
118 | | - |
119 | | - <Grid |
120 | | - x:Name="InvalidPathWarning" |
121 | | - Grid.Column="2" |
122 | | - Padding="12,4" |
123 | | - VerticalAlignment="Stretch" |
124 | | - x:Load="{x:Bind ViewModel.IsEditingIDEConfig, Mode=OneWay}" |
125 | | - Background="{ThemeResource SystemFillColorCriticalBackgroundBrush}" |
126 | | - BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
127 | | - BorderThickness="1" |
128 | | - ColumnSpacing="8" |
129 | | - CornerRadius="4" |
130 | | - ToolTipService.ToolTip="{helpers:ResourceString Name=InvalidLocation}" |
131 | | - Visibility="{x:Bind ViewModel.IsIDEPathValid, Mode=OneWay, Converter={StaticResource InvertedBoolVisibilityConverter}}"> |
132 | | - <Grid.ColumnDefinitions> |
133 | | - <ColumnDefinition Width="Auto" /> |
134 | | - <ColumnDefinition Width="Auto" /> |
135 | | - </Grid.ColumnDefinitions> |
136 | | - <TextBlock |
137 | | - VerticalAlignment="Center" |
138 | | - AutomationProperties.AccessibilityView="Raw" |
139 | | - FontFamily="{ThemeResource SymbolThemeFontFamily}" |
140 | | - FontSize="{StaticResource InfoBarIconFontSize}" |
141 | | - Foreground="{ThemeResource InfoBarErrorSeverityIconBackground}" |
142 | | - Text="{StaticResource InfoBarIconBackgroundGlyph}" /> |
143 | | - <TextBlock |
144 | | - VerticalAlignment="Center" |
145 | | - FontFamily="{ThemeResource SymbolThemeFontFamily}" |
146 | | - FontSize="{StaticResource InfoBarIconFontSize}" |
147 | | - Foreground="{ThemeResource InfoBarInformationalSeverityIconForeground}" |
148 | | - Text="{StaticResource InfoBarErrorIconGlyph}" /> |
149 | | - <TextBlock |
| 128 | + <StackPanel |
| 129 | + x:Name="IDEPathButtons" |
150 | 130 | Grid.Column="1" |
151 | | - VerticalAlignment="Center" |
152 | | - Text="{helpers:ResourceString Name=InvalidPath}" /> |
| 131 | + VerticalAlignment="Bottom" |
| 132 | + Orientation="Horizontal" |
| 133 | + Spacing="16"> |
| 134 | + <Button |
| 135 | + x:Name="PickIDEExe" |
| 136 | + Command="{x:Bind ViewModel.OpenFilePickerForIDECommand, Mode=OneWay}" |
| 137 | + Content="{helpers:ResourceString Name=Browse}" /> |
| 138 | + |
| 139 | + <Button |
| 140 | + x:Name="TestIDE" |
| 141 | + Command="{x:Bind ViewModel.TestIDECommand, Mode=OneWay}" |
| 142 | + Content="{helpers:ResourceString Name=Test}" /> |
| 143 | + </StackPanel> |
| 144 | + |
| 145 | + <Grid |
| 146 | + x:Name="InvalidPathWarning" |
| 147 | + Grid.Column="2" |
| 148 | + Padding="12,4" |
| 149 | + VerticalAlignment="Stretch" |
| 150 | + x:Load="{x:Bind ViewModel.IsEditingIDEConfig, Mode=OneWay}" |
| 151 | + Background="{ThemeResource SystemFillColorCriticalBackgroundBrush}" |
| 152 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 153 | + BorderThickness="1" |
| 154 | + ColumnSpacing="8" |
| 155 | + CornerRadius="4" |
| 156 | + ToolTipService.ToolTip="{helpers:ResourceString Name=InvalidLocation}" |
| 157 | + Visibility="{x:Bind ViewModel.IsIDEPathValid, Mode=OneWay, Converter={StaticResource InvertedBoolVisibilityConverter}}"> |
| 158 | + <Grid.ColumnDefinitions> |
| 159 | + <ColumnDefinition Width="Auto" /> |
| 160 | + <ColumnDefinition Width="Auto" /> |
| 161 | + </Grid.ColumnDefinitions> |
| 162 | + |
| 163 | + <TextBlock |
| 164 | + VerticalAlignment="Center" |
| 165 | + AutomationProperties.AccessibilityView="Raw" |
| 166 | + FontFamily="{ThemeResource SymbolThemeFontFamily}" |
| 167 | + FontSize="{StaticResource InfoBarIconFontSize}" |
| 168 | + Foreground="{ThemeResource InfoBarErrorSeverityIconBackground}" |
| 169 | + Text="{StaticResource InfoBarIconBackgroundGlyph}" /> |
| 170 | + |
| 171 | + <TextBlock |
| 172 | + VerticalAlignment="Center" |
| 173 | + FontFamily="{ThemeResource SymbolThemeFontFamily}" |
| 174 | + FontSize="{StaticResource InfoBarIconFontSize}" |
| 175 | + Foreground="{ThemeResource InfoBarInformationalSeverityIconForeground}" |
| 176 | + Text="{StaticResource InfoBarErrorIconGlyph}" /> |
| 177 | + |
| 178 | + <TextBlock |
| 179 | + Grid.Column="1" |
| 180 | + VerticalAlignment="Center" |
| 181 | + Text="{helpers:ResourceString Name=InvalidPath}" /> |
| 182 | + </Grid> |
153 | 183 | </Grid> |
154 | 184 |
|
| 185 | + <!-- IDE Friendly Name --> |
155 | 186 | <TextBlock |
156 | 187 | x:Name="IDEFriendlyName" |
157 | 188 | Grid.Row="1" |
158 | 189 | MaxWidth="200" |
159 | 190 | VerticalAlignment="Center" |
| 191 | + x:Load="{x:Bind ViewModel.IsEditingIDEConfig, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" |
160 | 192 | LineHeight="18" |
161 | 193 | Text="{helpers:ResourceString Name=FriendlyName}" |
162 | 194 | TextTrimming="CharacterEllipsis" /> |
|
172 | 204 | <TextBox |
173 | 205 | x:Name="IDEFriendlyNameTextBox" |
174 | 206 | Grid.Row="1" |
175 | | - Grid.Column="1" |
| 207 | + Grid.ColumnSpan="2" |
176 | 208 | Width="300" |
177 | 209 | HorizontalAlignment="Left" |
178 | 210 | VerticalAlignment="Center" |
| 211 | + PlaceholderText="{helpers:ResourceString Name=FriendlyName}" |
179 | 212 | Text="{x:Bind ViewModel.IDEFriendlyName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" |
180 | 213 | Visibility="{x:Bind ViewModel.IsEditingIDEConfig, Converter={StaticResource BoolVisibilityConverter}, Mode=OneWay}"> |
181 | 214 | <TextBox.Resources> |
|
201 | 234 | <ColumnDefinition Width="Auto" /> |
202 | 235 | <ColumnDefinition Width="Auto" /> |
203 | 236 | </Grid.ColumnDefinitions> |
| 237 | + |
204 | 238 | <TextBlock |
205 | 239 | VerticalAlignment="Center" |
206 | 240 | AutomationProperties.AccessibilityView="Raw" |
|
217 | 251 | <TextBlock |
218 | 252 | Grid.Column="1" |
219 | 253 | VerticalAlignment="Center" |
220 | | - Text="{helpers:ResourceString Name=InvalidTagNameWarning}" /> |
| 254 | + Text="{helpers:ResourceString Name=InvalidFriendlyNameError}" /> |
221 | 255 | </Grid> |
222 | 256 |
|
223 | 257 | <!-- Edit --> |
224 | 258 | <Button |
225 | 259 | x:Name="EditIDEConfigButton" |
226 | | - Grid.RowSpan="2" |
| 260 | + Grid.RowSpan="3" |
227 | 261 | Grid.Column="2" |
228 | 262 | Padding="8,4" |
229 | 263 | Background="Transparent" |
|
279 | 313 | </local:SettingsBlockControl> |
280 | 314 |
|
281 | 315 | </StackPanel> |
| 316 | + |
| 317 | + <VisualStateManager.VisualStateGroups> |
| 318 | + <VisualStateGroup> |
| 319 | + <VisualState x:Name="DefaultState"> |
| 320 | + <VisualState.Setters> |
| 321 | + <Setter Target="IDEPathTextBox.Width" Value="300" /> |
| 322 | + <Setter Target="IDEPathTextBox.HorizontalAlignment" Value="Left" /> |
| 323 | + <Setter Target="IDEPathTextBox.(Grid.Column)" Value="0" /> |
| 324 | + <Setter Target="IDEFriendlyNameTextBox.Width" Value="300" /> |
| 325 | + <Setter Target="IDEFriendlyNameTextBox.HorizontalAlignment" Value="Left" /> |
| 326 | + <Setter Target="IDEFriendlyNameTextBox.(Grid.ColumnSpan)" Value="2" /> |
| 327 | + <Setter Target="IDEPathButtons.(Grid.Column)" Value="1" /> |
| 328 | + <Setter Target="IDEPathButtons.(Grid.Row)" Value="0" /> |
| 329 | + <Setter Target="IDEPathButtons.Orientation" Value="Horizontal" /> |
| 330 | + <Setter Target="IDEPathButtons.Spacing" Value="16" /> |
| 331 | + <Setter Target="InvalidPathWarning.(Grid.Column)" Value="2" /> |
| 332 | + <Setter Target="InvalidPathWarning.(Grid.Row)" Value="0" /> |
| 333 | + <Setter Target="IDEPathGrid.RowSpacing" Value="0" /> |
| 334 | + <Setter Target="IDEPathGrid.ColumnSpacing" Value="8" /> |
| 335 | + <Setter Target="InvalidFriendlyNameWarning.(Grid.Column)" Value="2" /> |
| 336 | + <Setter Target="InvalidFriendlyNameWarning.(Grid.Row)" Value="1" /> |
| 337 | + <Setter Target="InvalidFriendlyNameWarning.(Grid.ColumnSpan)" Value="1" /> |
| 338 | + </VisualState.Setters> |
| 339 | + </VisualState> |
| 340 | + <VisualState x:Name="CompactState"> |
| 341 | + <VisualState.Setters> |
| 342 | + <Setter Target="IDEPathTextBox.Width" Value="Auto" /> |
| 343 | + <Setter Target="IDEPathTextBox.HorizontalAlignment" Value="Stretch" /> |
| 344 | + <Setter Target="IDEPathTextBox.(Grid.Column)" Value="2" /> |
| 345 | + <Setter Target="IDEFriendlyNameTextBox.Width" Value="Auto" /> |
| 346 | + <Setter Target="IDEFriendlyNameTextBox.HorizontalAlignment" Value="Stretch" /> |
| 347 | + <Setter Target="IDEFriendlyNameTextBox.(Grid.ColumnSpan)" Value="3" /> |
| 348 | + <Setter Target="IDEPathButtons.(Grid.Column)" Value="2" /> |
| 349 | + <Setter Target="IDEPathButtons.(Grid.Row)" Value="1" /> |
| 350 | + <Setter Target="IDEPathButtons.Orientation" Value="Vertical" /> |
| 351 | + <Setter Target="IDEPathButtons.Spacing" Value="8" /> |
| 352 | + <Setter Target="InvalidPathWarning.(Grid.Column)" Value="2" /> |
| 353 | + <Setter Target="InvalidPathWarning.(Grid.Row)" Value="2" /> |
| 354 | + <Setter Target="IDEPathGrid.RowSpacing" Value="12" /> |
| 355 | + <Setter Target="IDEPathGrid.ColumnSpacing" Value="0" /> |
| 356 | + <Setter Target="InvalidFriendlyNameWarning.(Grid.Column)" Value="0" /> |
| 357 | + <Setter Target="InvalidFriendlyNameWarning.(Grid.Row)" Value="2" /> |
| 358 | + <Setter Target="InvalidFriendlyNameWarning.(Grid.ColumnSpan)" Value="3" /> |
| 359 | + </VisualState.Setters> |
| 360 | + </VisualState> |
| 361 | + </VisualStateGroup> |
| 362 | + </VisualStateManager.VisualStateGroups> |
282 | 363 | </Grid> |
283 | 364 | </Page> |
0 commit comments