mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
Updating UI and making it Fluent
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ui:ThemeResources />
|
||||
<ui:XamlControlsResources />
|
||||
<!-- Other merged dictionaries here -->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<ObjectDataProvider x:Key="ResizeFitValues"
|
||||
@@ -21,6 +20,7 @@
|
||||
<x:Type Type="{x:Type m:ResizeFit}"/>
|
||||
</ObjectDataProvider.MethodParameters>
|
||||
</ObjectDataProvider>
|
||||
|
||||
<ObjectDataProvider x:Key="ResizeUnitValues"
|
||||
MethodName="GetValues"
|
||||
ObjectType="sys:Enum">
|
||||
@@ -28,58 +28,11 @@
|
||||
<x:Type Type="{x:Type m:ResizeUnit}"/>
|
||||
</ObjectDataProvider.MethodParameters>
|
||||
</ObjectDataProvider>
|
||||
|
||||
<v:EnumValueConverter x:Key="EnumValueConverter"/>
|
||||
<v:AutoDoubleConverter x:Key="AutoDoubleConverter"/>
|
||||
<v:BoolValueConverter x:Key="BoolValueConverter"/>
|
||||
<v:VisibilityBoolConverter x:Key="VisibilityBoolConverter"/>
|
||||
<Style x:Key="MainInstructionTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="12pt"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HotTrackColor}}"/>
|
||||
</Style>
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<Style x:Key="AccessibleComboBoxStyle" TargetType="ComboBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
|
||||
<Border Name="SelectedItemBorder"
|
||||
Padding="2"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter TargetName="SelectedItemBorder"
|
||||
Property="Background"
|
||||
Value="#FF91b9d8"/>
|
||||
<Setter Property="Foreground"
|
||||
Value="Black" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="true">
|
||||
<Setter TargetName="SelectedItemBorder"
|
||||
Property="Background"
|
||||
Value="#FFdadada" />
|
||||
<Setter Property="Foreground"
|
||||
Value="Black" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="true" />
|
||||
<Condition Property="IsHighlighted" Value="true" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="SelectedItemBorder"
|
||||
Property="Background"
|
||||
Value="#FF619ccb"/>
|
||||
<Setter Property="Foreground"
|
||||
Value="Black" />
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace ImageResizer.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Advanced Options.
|
||||
/// Looks up a localized string similar to Settings.
|
||||
/// </summary>
|
||||
public static string Advanced_Title {
|
||||
get {
|
||||
@@ -268,7 +268,7 @@ namespace ImageResizer.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Image Resizer for Windows.
|
||||
/// Looks up a localized string similar to Image Resizer.
|
||||
/// </summary>
|
||||
public static string ImageResizer {
|
||||
get {
|
||||
@@ -312,15 +312,6 @@ namespace ImageResizer.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Resize your pictures.
|
||||
/// </summary>
|
||||
public static string Input_MainInstruction {
|
||||
get {
|
||||
return ResourceManager.GetString("Input_MainInstruction", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to R_esize the original pictures (don't create copies).
|
||||
/// </summary>
|
||||
@@ -340,7 +331,7 @@ namespace ImageResizer.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Advanced options....
|
||||
/// Looks up a localized string similar to Settings.
|
||||
/// </summary>
|
||||
public static string Input_ShowAdvanced {
|
||||
get {
|
||||
|
||||
@@ -201,9 +201,6 @@
|
||||
<data name="Input_IgnoreOrientation" xml:space="preserve">
|
||||
<value>Ign_ore the orientation of pictures</value>
|
||||
</data>
|
||||
<data name="Input_MainInstruction" xml:space="preserve">
|
||||
<value>Resize your pictures</value>
|
||||
</data>
|
||||
<data name="Input_Replace" xml:space="preserve">
|
||||
<value>R_esize the original pictures (don't create copies)</value>
|
||||
</data>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
|
||||
|
||||
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FFededed" />
|
||||
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFe5e5e5" />
|
||||
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="WindowBorderBrush" Color="Black"/>
|
||||
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF949494"/>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
|
||||
|
||||
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FFededed" />
|
||||
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFe5e5e5" />
|
||||
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="WindowBorderBrush" Color="#FFf7f7f7"/>
|
||||
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF949494"/>
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace ImageResizer.ViewModels
|
||||
}
|
||||
else
|
||||
{
|
||||
_mainView.Close();
|
||||
// _mainView.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
xmlns:m="clr-namespace:ImageResizer.Models"
|
||||
xmlns:p="clr-namespace:ImageResizer.Properties"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
MinWidth="390"
|
||||
MinHeight="340"
|
||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
|
||||
ui:WindowHelper.UseModernWindowStyle="True"
|
||||
ui:TitleBar.IsIconVisible="True"
|
||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||
Name="_this"
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
@@ -33,19 +36,19 @@
|
||||
<local:ContainerFormatConverter x:Key="ContainerFormatConverter"/>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="11">
|
||||
<Grid Margin="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TabControl>
|
||||
<TabItem Header="{x:Static p:Resources.Advanced_Sizes}">
|
||||
<StackPanel Margin="11">
|
||||
<StackPanel Margin="12">
|
||||
<!-- TODO: Allow these to be drag-and-drop reordered (issue #15) -->
|
||||
<ItemsControl Grid.IsSharedSizeScope="True" ItemsSource="{Binding Settings.Sizes}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="m:ResizeSize">
|
||||
<Grid Margin="0,0,0,7">
|
||||
<Grid Margin="0,0,0,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="0"/>
|
||||
<ColumnDefinition SharedSizeGroup="1"/>
|
||||
@@ -55,10 +58,12 @@
|
||||
<ColumnDefinition SharedSizeGroup="5"/>
|
||||
<ColumnDefinition SharedSizeGroup="6"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Width="66" Text="{Binding Name}"/>
|
||||
<TextBox Width="96"
|
||||
MaxWidth="96"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding Name}"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
Height="23"
|
||||
Margin="5,0,0,0"
|
||||
Margin="8,0,0,0"
|
||||
ItemsSource="{Binding Source={StaticResource ResizeFitValues}}"
|
||||
SelectedItem="{Binding Fit}">
|
||||
<ComboBox.ItemTemplate>
|
||||
@@ -68,9 +73,10 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBox Grid.Column="2"
|
||||
Width="43"
|
||||
Height="23"
|
||||
Margin="7,0,0,0">
|
||||
Width="56"
|
||||
MaxWidth="56"
|
||||
TextWrapping="Wrap"
|
||||
Margin="8,0,0,0">
|
||||
<TextBox.Text>
|
||||
<Binding Converter="{StaticResource AutoDoubleConverter}"
|
||||
Path="Width"
|
||||
@@ -82,15 +88,15 @@
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBlock Grid.Column="3"
|
||||
Margin="5,0,0,0"
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}">
|
||||
×
|
||||
</TextBlock>
|
||||
<TextBox Grid.Column="4"
|
||||
Width="43"
|
||||
Height="23"
|
||||
Margin="5,0,0,0"
|
||||
Width="56"
|
||||
MaxWidth="56"
|
||||
TextWrapping="Wrap"
|
||||
Margin="8,0,0,0"
|
||||
Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}">
|
||||
<TextBox.Text>
|
||||
<Binding Converter="{StaticResource AutoDoubleConverter}"
|
||||
@@ -103,8 +109,7 @@
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<ComboBox Grid.Column="5"
|
||||
Height="23"
|
||||
Margin="7,0,0,0"
|
||||
Margin="8,0,0,0"
|
||||
ItemsSource="{Binding Source={StaticResource ResizeUnitValues}}"
|
||||
SelectedItem="{Binding Unit}">
|
||||
<ComboBox.ItemTemplate>
|
||||
@@ -113,11 +118,15 @@
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBlock Grid.Column="6" Margin="5,0,0,0" VerticalAlignment="Center">
|
||||
<local:AccessibleHyperlink ControlType="Button" Command="{Binding DataContext.RemoveSizeCommand,ElementName=_this}" CommandParameter="{Binding}">
|
||||
<Run Text="{x:Static p:Resources.Advanced_DeleteSize}"/>
|
||||
</local:AccessibleHyperlink>
|
||||
</TextBlock>
|
||||
<Button Content=""
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Background="Transparent"
|
||||
Grid.Column="6"
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip="{x:Static p:Resources.Advanced_DeleteSize}"
|
||||
Command="{Binding DataContext.RemoveSizeCommand,ElementName=_this}"
|
||||
CommandParameter="{Binding}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
@@ -130,7 +139,7 @@
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="{x:Static p:Resources.Advanced_Encoding}">
|
||||
<Grid Margin="11" VerticalAlignment="Top">
|
||||
<Grid Margin="12" VerticalAlignment="Top">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
@@ -142,10 +151,9 @@
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="{x:Static p:Resources.Advanced_FallbackEncoder}"
|
||||
Padding="0,5,5,0"
|
||||
Padding="0,8,8,0"
|
||||
Target="{Binding ElementName=_fallbackEncoderComboBox}"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
Height="23"
|
||||
HorizontalAlignment="Left"
|
||||
ItemsSource="{Binding Encoders}"
|
||||
Name="_fallbackEncoderComboBox"
|
||||
@@ -157,27 +165,26 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<Label Grid.Row="1"
|
||||
Margin="0,7,0,0"
|
||||
Margin="0,8,0,0"
|
||||
Content="{x:Static p:Resources.Advanced_JpegQualityLevel}"
|
||||
Padding="0,5,5,0"
|
||||
Padding="0,8,8,0"
|
||||
Target="{Binding ElementName=_jpegQualityLevelTextBox}"/>
|
||||
<TextBox Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="34"
|
||||
Height="23"
|
||||
Margin="0,7,0,0"
|
||||
Width="56"
|
||||
TextWrapping="Wrap"
|
||||
Margin="0,8,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Name="_jpegQualityLevelTextBox"
|
||||
Text="{Binding Settings.JpegQualityLevel,ValidatesOnExceptions=True,ValidatesOnDataErrors=True}"/>
|
||||
<Label Grid.Row="2"
|
||||
Margin="0,7,0,0"
|
||||
Margin="0,8,0,0"
|
||||
Content="{x:Static p:Resources.Advanced_PngInterlaceOption}"
|
||||
Padding="0,5,5,0"
|
||||
Padding="0,8,8,0"
|
||||
Target="{Binding ElementName=_pngInterlaceComboBox}"/>
|
||||
<ComboBox Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Height="23"
|
||||
Margin="0,7,0,0"
|
||||
Margin="0,8,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
ItemsSource="{Binding Source={StaticResource PngInterlaceOptionValues}}"
|
||||
Name="_pngInterlaceComboBox"
|
||||
@@ -189,14 +196,13 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<Label Grid.Row="3"
|
||||
Margin="0,7,0,0"
|
||||
Margin="0,8,0,0"
|
||||
Content="{x:Static p:Resources.Advanced_TiffCompressOption}"
|
||||
Padding="0,5,5,0"
|
||||
Padding="0,8,8,0"
|
||||
Target="{Binding ElementName=_tiffCompressComboBox}"/>
|
||||
<ComboBox Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Height="23"
|
||||
Margin="0,7,0,0"
|
||||
Margin="0,8,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
ItemsSource="{Binding Source={StaticResource TiffCompressOptionValues}}"
|
||||
Name="_tiffCompressComboBox"
|
||||
@@ -210,9 +216,9 @@
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="{x:Static p:Resources.Advanced_File}">
|
||||
<StackPanel Margin="11,9">
|
||||
<StackPanel Margin="12,8">
|
||||
<TextBlock Text="{x:Static p:Resources.Advanced_FileNameTokens}"/>
|
||||
<TextBlock Margin="9,5,0,0">
|
||||
<TextBlock Margin="0,8,0,0">
|
||||
<Run Text="%1 -"/>
|
||||
<Run Text="{x:Static p:Resources.Advanced_FileNameToken1}"/>
|
||||
<LineBreak/>
|
||||
@@ -231,42 +237,46 @@
|
||||
<Run>%6 -</Run>
|
||||
<Run Text="{x:Static p:Resources.Advanced_FileNameToken6}"/>
|
||||
</TextBlock>
|
||||
<Grid Margin="0,7,0,0">
|
||||
<Grid Margin="0,8,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label HorizontalAlignment="Left"
|
||||
Content="{x:Static p:Resources.Advanced_FileName}"
|
||||
Padding="0,5,5,0"
|
||||
Padding="0,4,4,0"
|
||||
Target="{Binding ElementName=_fileNameTextBox}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Height="23"
|
||||
TextWrapping="Wrap"
|
||||
Name="_fileNameTextBox"
|
||||
Text="{Binding Settings.FileName}"/>
|
||||
</Grid>
|
||||
<Separator Margin="0,11,0,0"/>
|
||||
<CheckBox Margin="0,11,0,0"
|
||||
<Separator Margin="0,12,0,0"/>
|
||||
<CheckBox Margin="0,12,0,0"
|
||||
Content="{x:Static p:Resources.Advanced_KeepDateModified}"
|
||||
IsChecked="{Binding Settings.KeepDateModified}"/>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<StackPanel Grid.Row="1"
|
||||
Margin="0,11,0,0"
|
||||
<Border Grid.Row="1"
|
||||
Margin="0,24,0,0"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||
Padding="12">
|
||||
|
||||
<StackPanel
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button Height="23"
|
||||
MinWidth="75"
|
||||
<Button MinWidth="76"
|
||||
Click="HandleAcceptClick"
|
||||
Style="{StaticResource AccentButtonStyle}"
|
||||
Content="{x:Static p:Resources.OK}"
|
||||
IsDefault="True"/>
|
||||
<Button Height="23"
|
||||
MinWidth="75"
|
||||
Margin="7,0,0,0"
|
||||
<Button MinWidth="76"
|
||||
Margin="8,0,0,0"
|
||||
Content="{x:Static p:Resources.Cancel}"
|
||||
IsCancel="True"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
xmlns:local="clr-namespace:ImageResizer.Views"
|
||||
xmlns:m="clr-namespace:ImageResizer.Models"
|
||||
xmlns:p="clr-namespace:ImageResizer.Properties"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
MinWidth="350">
|
||||
|
||||
<StackPanel Background="{DynamicResource PrimaryBackgroundBrush}">
|
||||
<TextBlock Margin="11,11,11,0"
|
||||
Style="{StaticResource MainInstructionTextBlockStyle}"
|
||||
Text="{x:Static p:Resources.Input_MainInstruction}"/>
|
||||
<Label Margin="11,11,11,0"
|
||||
<Label Margin="12,12,12,0"
|
||||
FontSize="16"
|
||||
Content="{x:Static p:Resources.Input_Content}"
|
||||
Target="{Binding ElementName=_selectedSizeListBox}"/>
|
||||
<ListBox Margin="20,0,11,0"
|
||||
<ListBox Margin="12,12,12,0"
|
||||
BorderThickness="0"
|
||||
Background="Transparent"
|
||||
ItemsSource="{Binding Settings.AllSizes}"
|
||||
Name="_selectedSizeListBox"
|
||||
SelectedIndex="{Binding Settings.SelectedSizeIndex}">
|
||||
@@ -23,8 +23,9 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<RadioButton Margin="0,7,0,0"
|
||||
VerticalContentAlignment="Center"
|
||||
<RadioButton Margin="0,4,0,0"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Top"
|
||||
Focusable="False"
|
||||
IsChecked="{Binding IsSelected,RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter/>
|
||||
@@ -37,35 +38,33 @@
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type m:ResizeSize}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
<TextBlock Text=" ("/>
|
||||
<TextBlock Text="{Binding Name}" FontWeight="Bold"/>
|
||||
<TextBlock Text="(" Margin="4,0,0,0"/>
|
||||
<TextBlock Text="{Binding Fit,Converter={StaticResource EnumValueConverter},ConverterParameter=ThirdPersonSingular}"/>
|
||||
<TextBlock Text=" "/>
|
||||
<TextBlock Text="{Binding Width,Converter={StaticResource AutoDoubleConverter},ConverterParameter=Auto}"/>
|
||||
<TextBlock Text=" × " Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}"/>
|
||||
<TextBlock Text="{Binding Height,Converter={StaticResource AutoDoubleConverter},ConverterParameter=Auto}" Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}"/>
|
||||
<TextBlock Text=" "/>
|
||||
<TextBlock Text="{Binding Unit,Converter={StaticResource EnumValueConverter},ConverterParameter=ToLower}"/>
|
||||
<TextBlock Text="{Binding Width,Converter={StaticResource AutoDoubleConverter},ConverterParameter=Auto}" Margin="4,0,0,0"/>
|
||||
<TextBlock Text="x" Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}" Margin="4,0,0,0"/>
|
||||
<TextBlock Text="{Binding Height,Converter={StaticResource AutoDoubleConverter},ConverterParameter=Auto}" Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}" Margin="4,0,0,0"/>
|
||||
<TextBlock Text="{Binding Unit,Converter={StaticResource EnumValueConverter},ConverterParameter=ToLower}" Margin="4,0,0,0"/>
|
||||
<TextBlock Text=")"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type m:CustomSize}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding Name}"/>
|
||||
<ComboBox Height="23"
|
||||
Margin="5,0,0,0"
|
||||
<StackPanel Orientation="Horizontal" Margin="0,-8,0,0">
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontWeight="Bold"/>
|
||||
<ComboBox
|
||||
Margin="8,0,0,0"
|
||||
ItemsSource="{Binding Source={StaticResource ResizeFitValues}}"
|
||||
SelectedItem="{Binding Fit}"
|
||||
ItemContainerStyle="{StaticResource AccessibleComboBoxStyle}">
|
||||
SelectedItem="{Binding Fit}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type m:ResizeFit}">
|
||||
<ContentPresenter Content="{Binding Converter={StaticResource EnumValueConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<TextBox Width="43"
|
||||
Height="23"
|
||||
Margin="7,0,0,0">
|
||||
<TextBox Width="56"
|
||||
Style="{StaticResource DefaultTextBoxStyle}"
|
||||
TextWrapping="Wrap"
|
||||
Margin="8,0,0,0">
|
||||
<TextBox.Text>
|
||||
<Binding Converter="{StaticResource AutoDoubleConverter}"
|
||||
Path="Width"
|
||||
@@ -76,14 +75,14 @@
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<TextBlock Margin="5,0,0,0"
|
||||
<TextBlock Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}">
|
||||
×
|
||||
</TextBlock>
|
||||
<TextBox Width="43"
|
||||
Height="23"
|
||||
Margin="5,0,0,0"
|
||||
<TextBox Width="56"
|
||||
Style="{StaticResource DefaultTextBoxStyle}"
|
||||
Margin="0,0,0,0"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}">
|
||||
<TextBox.Text>
|
||||
<Binding Converter="{StaticResource AutoDoubleConverter}"
|
||||
@@ -95,11 +94,11 @@
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
<ComboBox Height="23"
|
||||
Margin="7,0,0,0"
|
||||
<ComboBox
|
||||
Margin="8,0,0,0"
|
||||
ItemsSource="{Binding Source={StaticResource ResizeUnitValues}}"
|
||||
SelectedItem="{Binding Unit}"
|
||||
ItemContainerStyle="{StaticResource AccessibleComboBoxStyle}">
|
||||
>
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type m:ResizeUnit}">
|
||||
<ContentPresenter Content="{Binding Converter={StaticResource EnumValueConverter}}"/>
|
||||
@@ -110,22 +109,20 @@
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
</ListBox>
|
||||
<CheckBox Margin="11,11,11,0"
|
||||
<CheckBox Margin="12,24,12,0"
|
||||
Content="{x:Static p:Resources.Input_ShrinkOnly}"
|
||||
IsChecked="{Binding Settings.ShrinkOnly}"/>
|
||||
<!-- TODO: This option doesn't make much sense when resizing into a directory. We should swap it for an option
|
||||
to overwrite any files in the directory instead (issue #88) -->
|
||||
<CheckBox Margin="11,7,11,0"
|
||||
<CheckBox Margin="12,4,12,0"
|
||||
Content="{x:Static p:Resources.Input_Replace}"
|
||||
IsChecked="{Binding Settings.Replace}"/>
|
||||
<CheckBox Margin="11,7,11,0"
|
||||
<CheckBox Margin="12,4,12,0"
|
||||
Content="{x:Static p:Resources.Input_IgnoreOrientation}"
|
||||
IsChecked="{Binding Settings.IgnoreOrientation}"/>
|
||||
<Border Margin="0,11,0,0"
|
||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
|
||||
BorderThickness="0,1,0,0"
|
||||
Padding="11,11">
|
||||
<Border Margin="0,24,0,0"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||
Padding="12">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
@@ -133,26 +130,26 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock x:Name="AdvancedSettingsTextBlock"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ShowAdvancedSettings, Converter={StaticResource BoolValueConverter}}"
|
||||
IsEnabled="{Binding Visibility,ElementName=AdvancedSettingsTextBlock, Converter={StaticResource VisibilityBoolConverter}}"
|
||||
Focusable="{Binding Visibility,ElementName=AdvancedSettingsTextBlock, Converter={StaticResource VisibilityBoolConverter}}">
|
||||
<local:AccessibleHyperlink ControlType="Button" Command="{Binding ShowAdvancedCommand}">
|
||||
<Run Text="{x:Static p:Resources.Input_ShowAdvanced}"/>
|
||||
</local:AccessibleHyperlink>
|
||||
</TextBlock>
|
||||
|
||||
<Button Content=""
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Style="{StaticResource DefaultButtonStyle}"
|
||||
FontSize="16"
|
||||
ToolTip="{x:Static p:Resources.Input_ShowAdvanced}"
|
||||
Background="Transparent"
|
||||
Command="{Binding ShowAdvancedCommand}"
|
||||
/>
|
||||
<!-- Visibility="{Binding ShowAdvancedSettings, Converter={StaticResource BoolValueConverter}}" -->
|
||||
<Button Grid.Column="1"
|
||||
Height="23"
|
||||
MinWidth="75"
|
||||
Style="{StaticResource AccentButtonStyle}"
|
||||
MinWidth="76"
|
||||
Command="{Binding ResizeCommand}"
|
||||
Content="{x:Static p:Resources.Input_Resize}"
|
||||
IsDefault="True"/>
|
||||
|
||||
<Button Grid.Column="2"
|
||||
Height="23"
|
||||
MinWidth="75"
|
||||
Margin="7,0,0,0"
|
||||
Style="{StaticResource DefaultButtonStyle}"
|
||||
MinWidth="76"
|
||||
Margin="12,0,0,0"
|
||||
Command="{Binding CancelCommand}"
|
||||
Content="{x:Static p:Resources.Cancel}"
|
||||
IsCancel="True"/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Window x:Class="ImageResizer.Views.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:ImageResizer.Views"
|
||||
xmlns:p="clr-namespace:ImageResizer.Properties"
|
||||
@@ -11,7 +12,11 @@
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
Title="{x:Static p:Resources.ImageResizer}"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ui:WindowHelper.UseModernWindowStyle="True"
|
||||
ui:TitleBar.IsIconVisible="True"
|
||||
ui:TitleBar.Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||
>
|
||||
|
||||
<Window.Resources>
|
||||
<DataTemplate DataType="{x:Type vm:InputViewModel}">
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:ImageResizer.Views"
|
||||
xmlns:p="clr-namespace:ImageResizer.Properties"
|
||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||
MinWidth="350">
|
||||
|
||||
<UserControl.Resources>
|
||||
@@ -17,27 +18,23 @@
|
||||
</behaviors:Interaction.Triggers>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Margin="11,11,11,0"
|
||||
Style="{StaticResource MainInstructionTextBlockStyle}"
|
||||
<TextBlock Margin="12,12,12,0"
|
||||
FontSize="16"
|
||||
Text="{x:Static p:Resources.Progress_MainInstruction}"/>
|
||||
<TextBlock Margin="11,11,11,0" Text="{Binding TimeRemaining,Converter={StaticResource TimeRemainingConverter}}"/>
|
||||
<ProgressBar Height="15"
|
||||
Margin="11,11,11,0"
|
||||
<TextBlock Margin="12,12,12,0" Text="{Binding TimeRemaining,Converter={StaticResource TimeRemainingConverter}}"/>
|
||||
<ProgressBar Height="16"
|
||||
Margin="12,12,12,0"
|
||||
Value="{Binding Progress}"
|
||||
Maximum="1"/>
|
||||
<Border Margin="0,11,0,0"
|
||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
|
||||
BorderThickness="0,1,0,0"
|
||||
Padding="11,11">
|
||||
<Border Margin="0,12,0,0"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||
Padding="12,12">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Height="23"
|
||||
MinWidth="75"
|
||||
<Button MinWidth="76"
|
||||
Command="{Binding StopCommand}"
|
||||
Content="{x:Static p:Resources.Progress_Stop}"
|
||||
IsCancel="True"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -2,21 +2,22 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:p="clr-namespace:ImageResizer.Properties"
|
||||
MinWidth="350">
|
||||
MinWidth="350"
|
||||
Background="{DynamicResource PrimaryBackgroundBrush}">
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock Margin="11,11,11,0"
|
||||
Style="{StaticResource MainInstructionTextBlockStyle}"
|
||||
<TextBlock Margin="12,12,12,0"
|
||||
FontSize="16"
|
||||
Text="{x:Static p:Resources.Results_MainInstruction}"/>
|
||||
<ScrollViewer MaxWidth="363"
|
||||
MaxHeight="350"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl Margin="11,4,11,0" ItemsSource="{Binding Errors}">
|
||||
<ItemsControl Margin="12,4,12,0" ItemsSource="{Binding Errors}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="ResizeError">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="0,7,0,0"
|
||||
<TextBlock Margin="0,8,0,0"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding File}"/>
|
||||
<TextBlock Text="{Binding Error}" TextWrapping="Wrap"/>
|
||||
@@ -25,14 +26,13 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
<Border Margin="0,11,0,0"
|
||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
|
||||
<Border Margin="0,12,0,0"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
|
||||
BorderThickness="0,1,0,0"
|
||||
Padding="11,11">
|
||||
Padding="12,12">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Height="23"
|
||||
MinWidth="75"
|
||||
<Button MinWidth="76"
|
||||
Command="{Binding CloseCommand}"
|
||||
Content="{x:Static p:Resources.Results_Close}"
|
||||
IsCancel="True"
|
||||
@@ -40,5 +40,4 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user