[Image Resizer] Add settings button (#13773)

* Add deeplink

* Update InputPage.xaml

Co-authored-by: Laute <Niels.Laute@philips.com>
This commit is contained in:
Niels Laute 2021-10-12 13:23:06 +02:00 committed by GitHub
parent 7e8e954de7
commit 4803180bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 10 deletions

View File

@ -204,6 +204,15 @@ namespace ImageResizer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Open settings.
/// </summary>
public static string Open_settings {
get {
return ResourceManager.GetString("Open_settings", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Phone.
/// </summary>

View File

@ -277,4 +277,7 @@
<data name="Width" xml:space="preserve">
<value>Width</value>
</data>
<data name="Open_settings" xml:space="preserve">
<value>Open settings</value>
</data>
</root>

View File

@ -8,6 +8,7 @@ using ImageResizer.Helpers;
using ImageResizer.Models;
using ImageResizer.Properties;
using ImageResizer.Views;
using Microsoft.PowerToys.Common.UI;
namespace ImageResizer.ViewModels
{
@ -35,6 +36,7 @@ namespace ImageResizer.ViewModels
ResizeCommand = new RelayCommand(Resize);
CancelCommand = new RelayCommand(Cancel);
OpenSettingsCommand = new RelayCommand(OpenSettings);
}
public Settings Settings { get; }
@ -43,6 +45,8 @@ namespace ImageResizer.ViewModels
public ICommand CancelCommand { get; }
public ICommand OpenSettingsCommand { get; }
public bool TryingToResizeGifFiles
{
get
@ -58,6 +62,11 @@ namespace ImageResizer.ViewModels
_mainViewModel.CurrentPage = new ProgressViewModel(_batch, _mainViewModel, _mainView);
}
public static void OpenSettings()
{
SettingsDeepLink.OpenSettings(SettingsDeepLink.SettingsWindow.ImageResizer);
}
public void Cancel()
=> _mainView.Close();
}

View File

@ -131,6 +131,17 @@
<CheckBox Margin="12,4,12,0"
Content="{x:Static p:Resources.Input_IgnoreOrientation}"
IsChecked="{Binding Settings.IgnoreOrientation}"/>
<TextBlock Grid.Column="0"
FontWeight="Bold"
Text="{x:Static p:Resources.Input_GifWarning}"
TextWrapping="Wrap"
Margin="12,12,12,0"
HorizontalAlignment="Right"
TextAlignment="Left"
Foreground="{ui:ThemeResource SystemControlErrorTextForegroundBrush}"
Visibility="{Binding TryingToResizeGifFiles, Converter={StaticResource BoolValueConverter}}"
/>
</StackPanel>
<Border Margin="0,12,0,0"
@ -145,16 +156,18 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
FontWeight="Bold"
Text="{x:Static p:Resources.Input_GifWarning}"
TextWrapping="Wrap"
MaxWidth="250"
HorizontalAlignment="Left"
TextAlignment="Left"
Foreground="{ui:ThemeResource SystemControlErrorTextForegroundBrush}"
Visibility="{Binding TryingToResizeGifFiles, Converter={StaticResource BoolValueConverter}}"
/>
<Button Width="36"
Command="{Binding OpenSettingsCommand}"
Height="36"
Margin="-8,0,0,0"
Content="&#xE713;"
Background="Transparent"
FontFamily="Segoe MDL2 Assets"
FontSize="16"
HorizontalAlignment="Left"
ToolTipService.ToolTip="{x:Static p:Resources.Open_settings}"
AutomationProperties.Name="{x:Static p:Resources.Open_settings}" />
<Button Grid.Column="1"
Style="{StaticResource AccentButtonStyle}"
MinWidth="76"