Skip to content

Commit

Permalink
Accesibility improvements + updated colors
Browse files Browse the repository at this point in the history
  • Loading branch information
niels9001 committed Nov 8, 2020
1 parent da36371 commit 0d43ea2
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 41 deletions.
27 changes: 27 additions & 0 deletions src/modules/imageresizer/ui/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/modules/imageresizer/ui/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
<data name="Advanced_FileNameTokens" xml:space="preserve">
<value>The following parameters can be used.</value>
</data>
<data name="Advanced_FileName_Tooltip" xml:space="preserve">
<value>Filename</value>
</data>
<data name="Advanced_JpegQualityLevel" xml:space="preserve">
<value>_JPEG quality level:</value>
</data>
Expand Down Expand Up @@ -222,6 +225,9 @@
<data name="OK" xml:space="preserve">
<value>OK</value>
</data>
<data name="OK_Tooltip" xml:space="preserve">
<value>Apply settings</value>
</data>
<data name="Phone" xml:space="preserve">
<value>Phone</value>
</data>
Expand Down Expand Up @@ -303,6 +309,9 @@
<data name="ResizeUnit_Pixel" xml:space="preserve">
<value>Pixels</value>
</data>
<data name="Resize_Tooltip" xml:space="preserve">
<value>Resize pictures</value>
</data>
<data name="Results_Close" xml:space="preserve">
<value>Close</value>
</data>
Expand Down
6 changes: 3 additions & 3 deletions src/modules/imageresizer/ui/Themes/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
<Color x:Key="Theme.PrimaryAccentColor">Black</Color>

<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF1f1f1f" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF000000" />
<SolidColorBrush x:Key="WindowBorderBrush" Color="#FF535353"/>
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF9a9a9a"/>

Expand All @@ -25,5 +25,5 @@

<SolidColorBrush x:Key="ColorControlBackgroundBrush" Color="#FF454545"/>
<SolidColorBrush x:Key="PrimaryForegroundBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF6b6b6b" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF999999" />
</ResourceDictionary>
38 changes: 21 additions & 17 deletions src/modules/imageresizer/ui/Views/AdvancedWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl>
<TabControl Style="{StaticResource TabControlPivotStyle}">
<TabItem Header="{x:Static p:Resources.Advanced_Sizes}">
<StackPanel Margin="12">
<StackPanel Margin="0,12,0,12">
<!-- TODO: Allow these to be drag-and-drop reordered (issue #15) -->
<ItemsControl Grid.IsSharedSizeScope="True" ItemsSource="{Binding Settings.Sizes}">
<ItemsControl Grid.IsSharedSizeScope="True" TabIndex="0" ItemsSource="{Binding Settings.Sizes}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="m:ResizeSize">
<Grid Margin="0,0,0,8">
Expand Down Expand Up @@ -131,15 +131,13 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock>
<local:AccessibleHyperlink ControlType="Button" Command="{Binding AddSizeCommand}">
<Run Text="{x:Static p:Resources.Advanced_CreateSize}"/>
</local:AccessibleHyperlink>
</TextBlock>
<Button Margin="0,12,0,0"
Command="{Binding AddSizeCommand}"
Content="{x:Static p:Resources.Advanced_CreateSize}"/>
</StackPanel>
</TabItem>
<TabItem Header="{x:Static p:Resources.Advanced_Encoding}">
<Grid Margin="12" VerticalAlignment="Top">
<Grid Margin="0,12,0,12" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
Expand Down Expand Up @@ -216,7 +214,7 @@
</Grid>
</TabItem>
<TabItem Header="{x:Static p:Resources.Advanced_File}">
<StackPanel Margin="12,8">
<StackPanel Margin="0,12,0,12">
<TextBlock Text="{x:Static p:Resources.Advanced_FileNameTokens}"/>
<TextBlock Margin="0,8,0,0">
<Run Text="%1 -"/>
Expand All @@ -243,14 +241,16 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label HorizontalAlignment="Left"
x:Name="fileNameTextBoxLabel"
Content="{x:Static p:Resources.Advanced_FileName}"
Padding="0,4,4,0"
Target="{Binding ElementName=_fileNameTextBox}"/>
Target="{Binding ElementName=fileNameTextBox}"/>
<TextBox Grid.Column="1"
Height="23"
TabIndex="1"
TabIndex="0"
TextWrapping="Wrap"
Name="_fileNameTextBox"
Name="fileNameTextBox"
AutomationProperties.Name="{x:Static p:Resources.Advanced_FileName_Tooltip}"
Text="{Binding Settings.FileName}"/>
</Grid>
<Separator Margin="0,12,0,0"/>
Expand All @@ -269,12 +269,16 @@
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button MinWidth="76"
Click="HandleAcceptClick"
Style="{StaticResource AccentButtonStyle}"
Content="{x:Static p:Resources.OK}"
IsDefault="True"/>
TabIndex="100"
Click="HandleAcceptClick"
Style="{StaticResource AccentButtonStyle}"
Content="{x:Static p:Resources.OK}"
AutomationProperties.Name="{x:Static p:Resources.OK_Tooltip}"
IsDefault="True"/>

<Button MinWidth="76"
Margin="8,0,0,0"
TabIndex="101"
Content="{x:Static p:Resources.Cancel}"
IsCancel="True"/>
</StackPanel>
Expand Down
52 changes: 31 additions & 21 deletions src/modules/imageresizer/ui/Views/InputPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
FontSize="16"
Content="{x:Static p:Resources.Input_Content}"
Target="{Binding ElementName=_selectedSizeListBox}"/>

<ListBox Margin="12,12,12,0"
BorderThickness="0"
Background="Transparent"
AutomationProperties.Name="Sizes listbox"
ItemsSource="{Binding Settings.AllSizes}"
Name="_selectedSizeListBox"
SelectedIndex="{Binding Settings.SelectedSizeIndex}">

<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
Expand All @@ -26,33 +29,38 @@
<RadioButton Margin="0,4,0,0"
VerticalAlignment="Center"
VerticalContentAlignment="Top"
AutomationProperties.Name="{Binding Name}"
Focusable="False"
IsChecked="{Binding IsSelected,RelativeSource={RelativeSource TemplatedParent}}">
<ContentPresenter/>
</RadioButton>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="AutomationProperties.Name" Value="{Binding Name}"/>
</Style>
</ListBox.ItemContainerStyle>

<ListBox.Resources>
<DataTemplate DataType="{x:Type m:ResizeSize}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" FontWeight="Bold"/>
<TextBlock Text="(" Margin="4,0,0,0"/>
<TextBlock Text="{Binding Fit,Converter={StaticResource EnumValueConverter},ConverterParameter=ThirdPersonSingular}"/>
<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=")"/>
<TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
<TextBlock Text="(" Margin="4,0,0,0" Foreground="{DynamicResource SecondaryForegroundBrush}"/>
<TextBlock Text="{Binding Fit,Converter={StaticResource EnumValueConverter},ConverterParameter=ThirdPersonSingular}" Foreground="{DynamicResource SecondaryForegroundBrush}"/>
<TextBlock Text="{Binding Width,Converter={StaticResource AutoDoubleConverter},ConverterParameter=Auto}" Margin="4,0,0,0" Foreground="{DynamicResource SecondaryForegroundBrush}"/>
<TextBlock Text="x" Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}" Margin="4,0,0,0" Foreground="{DynamicResource SecondaryForegroundBrush}"/>
<TextBlock Text="{Binding Height,Converter={StaticResource AutoDoubleConverter},ConverterParameter=Auto}" Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}" Margin="4,0,0,0" Foreground="{DynamicResource SecondaryForegroundBrush}"/>
<TextBlock Text="{Binding Unit,Converter={StaticResource EnumValueConverter},ConverterParameter=ToLower}" Margin="4,0,0,0" Foreground="{DynamicResource SecondaryForegroundBrush}"/>
<TextBlock Text=")" Foreground="{DynamicResource SecondaryForegroundBrush}"/>
</StackPanel>
</DataTemplate>

<DataTemplate DataType="{x:Type m:CustomSize}">
<StackPanel Orientation="Horizontal" Margin="0,-8,0,0">
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontWeight="Bold"/>
<ComboBox
Margin="8,0,0,0"
<TextBlock VerticalAlignment="Center"
Text="{Binding Name}"
FontWeight="Bold"/>
<ComboBox Margin="8,0,0,0"
ItemsSource="{Binding Source={StaticResource ResizeFitValues}}"
SelectedItem="{Binding Fit}">
<ComboBox.ItemTemplate>
Expand All @@ -77,8 +85,8 @@
</TextBox>
<TextBlock Margin="8,0,0,0"
VerticalAlignment="Center"
Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}">
</TextBlock>
Visibility="{Binding ShowHeight,Converter={StaticResource BoolValueConverter}}"/>

<TextBox Width="56"
Style="{StaticResource DefaultTextBoxStyle}"
Margin="0,0,0,0"
Expand All @@ -94,11 +102,9 @@
</Binding>
</TextBox.Text>
</TextBox>
<ComboBox
Margin="8,0,0,0"
<ComboBox Margin="8,0,0,0"
ItemsSource="{Binding Source={StaticResource ResizeUnitValues}}"
SelectedItem="{Binding Unit}"
>
SelectedItem="{Binding Unit}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type m:ResizeUnit}">
<ContentPresenter Content="{Binding Converter={StaticResource EnumValueConverter}}"/>
Expand All @@ -109,6 +115,7 @@
</DataTemplate>
</ListBox.Resources>
</ListBox>

<CheckBox Margin="12,24,12,0"
Content="{x:Static p:Resources.Input_ShrinkOnly}"
IsChecked="{Binding Settings.ShrinkOnly}"/>
Expand All @@ -117,9 +124,11 @@
<CheckBox Margin="12,4,12,0"
Content="{x:Static p:Resources.Input_Replace}"
IsChecked="{Binding Settings.Replace}"/>

<CheckBox Margin="12,4,12,0"
Content="{x:Static p:Resources.Input_IgnoreOrientation}"
IsChecked="{Binding Settings.IgnoreOrientation}"/>

<Border Margin="0,24,0,0"
Background="{DynamicResource SecondaryBackgroundBrush}"
Padding="12">
Expand All @@ -134,18 +143,20 @@
FontFamily="Segoe MDL2 Assets"
Style="{StaticResource DefaultButtonStyle}"
FontSize="16"
Margin="-10,0,0,0"
AutomationProperties.Name="{x:Static p:Resources.Input_ShowAdvanced}"
ToolTip="{x:Static p:Resources.Input_ShowAdvanced}"
Background="Transparent"
Command="{Binding ShowAdvancedCommand}"
/>
Command="{Binding ShowAdvancedCommand}"/>
<!-- Visibility="{Binding ShowAdvancedSettings, Converter={StaticResource BoolValueConverter}}" -->
<Button Grid.Column="1"
Style="{StaticResource AccentButtonStyle}"
MinWidth="76"
Command="{Binding ResizeCommand}"
AutomationProperties.Name="{x:Static p:Resources.Resize_Tooltip}"
Content="{x:Static p:Resources.Input_Resize}"
IsDefault="True"/>

<Button Grid.Column="2"
Style="{StaticResource DefaultButtonStyle}"
MinWidth="76"
Expand All @@ -156,5 +167,4 @@
</Grid>
</Border>
</StackPanel>

</UserControl>
1 change: 1 addition & 0 deletions src/modules/imageresizer/ui/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.IsIconVisible="True"
ui:TitleBar.Background="{DynamicResource PrimaryBackgroundBrush}"
AutomationProperties.Name="Image Resizer"
>

<Window.Resources>
Expand Down

1 comment on commit 0d43ea2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New misspellings found, please review:

  • modernwpf
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"aae abkseg actionkeyword aeroglass alfredtheme APPDATA APPID appxpackage AProduct baf bakudies basedir bfa bretan BYCOMMAND calculatorpinyindb cbegin cend cheatsheet Combobox COUNTSLABELFMT ctx deletefilefolder Deserialized desktoppreviewhandler desktopshortcutinstalled dicts dirn dropdownstypekey dropdowntypekey DString Dvs EBF Ecma ecmascript ei eig eigval eigvec ENTIREITEMNAME evt excmd executionengine EXPLR ftp Fx fxml GETDESKWALLPAPER GWL gwoyeu hanyu hglobal hicon Highcontrast hmon hyjiacan IAlphabet IExclusive iexplore IInstant IME IMonitor IMulti Indexerpinyindb Inlining isborderless Italiano jsonrpc KBHOOK KBM KListener KSeparator lastpos launcherpinyin Launcherpinyindb lbl lbx Linux LSHIFT MENUSTART nc NHotkey numberbox orphanedkey osdetection Pampalona pdk PERSISTEDDATA pimpl pinyindb Pipename Plist plistlib pls Pluginpinyindb Polski Portugu POWERTOYNAME Prepends PREVPANE progman Programpinyindb Progressbar reggedit remapkey remapkeyboard remapper remapshort Remoting reulst rgba rgn rk RPressed RStroked Rtc RWIN Scrollable scrollbar scrollviewer sessionending setings setwineventhook Shellpinyindb shortcutguide SHOWNA SHOWWINDOW Slovensk sni Srpski stefan strem stringstream subdir Subheader superfancyzones SYSKEYDOWN systemcolors Tcp temppath thr Tls tmpnam tohex transaprency TRANSPARENTGRADIENT TResult TZone uac uapmanifestschema uk Unsubscribe USERPROFILE VDId VGr VIRTUALDESKTOPCHANGE virtualized Virtualizing vkcode vstest Walkerpinyindb wangyiyun wca wcschr wcsrchr Webcam websearch wexfs winapi winlogo winr WINTAB WORKERW wsmatch wtmpnam Xecutor xyzpreviewhandler yinle yinyue yyy ZConfig "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"Actionkeyword appdata appid combobox Ctx deserialized ebf Entireitemname explr fx gwl HGLOBAL HICON IEXPLORE ime kbm lshift modernwpf pipename prevpane Progman Remapper Rgn rwin scrollable showwindow Subdir syskeydown UAC unsubscribe userprofile Wca webcam WINAPI "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

Please sign in to comment.