Added some style
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:GifResizer">
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Views/Resources/Style.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
|
||||
<PackageReference Include="WpfAnimatedGif" Version="2.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Resources\Style.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<XamlRuntime>Wpf</XamlRuntime>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
@@ -3,77 +3,71 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
||||
mc:Ignorable="d"
|
||||
Title="Gif resizer" Height="480" Width="640"
|
||||
ResizeMode="NoResize">
|
||||
|
||||
<Border BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Padding="5"
|
||||
Margin="20">
|
||||
|
||||
<StackPanel Orientation="Vertical" Margin="20">
|
||||
|
||||
<Border BorderBrush="Gray"
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Margin="10 10 10 5">
|
||||
<Grid Style="{StaticResource DarkGrid}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="3*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Image gif:ImageBehavior.AnimatedSource="{Binding FilePath}"
|
||||
Stretch="Uniform"
|
||||
Visibility="{Binding FilePath}"/>
|
||||
|
||||
<Button Grid.Row="0"
|
||||
Style="{StaticResource LinkButtonStyle}"
|
||||
Click="BrowseButton_Click"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Text="Browse files"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
TextDecorations="Underline"/>
|
||||
</Button>
|
||||
<TextBlock Grid.Row="1"
|
||||
Margin="0,0,0,5"
|
||||
Text="{Binding FilePath,
|
||||
TargetNullValue=No file selected,
|
||||
FallbackValue=Gif filepath...}"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Padding="5"
|
||||
Margin="20">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock
|
||||
Margin="0,0,0,5"
|
||||
Text="{
|
||||
Binding FilePath,
|
||||
TargetNullValue=No file selected,
|
||||
FallbackValue=Gif filepath...
|
||||
}"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
/>
|
||||
<Button
|
||||
Content="Browse..."
|
||||
Padding="5"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
Click="BrowseButton_Click"
|
||||
Margin="10 5 10 10">
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox Content="112x112" IsChecked="True" Margin="10"/>
|
||||
<CheckBox Content="500x500" IsChecked="True" Margin="10"/>
|
||||
<CheckBox Content="1000x1000" IsChecked="True" Margin="10"/>
|
||||
</StackPanel>
|
||||
<Button
|
||||
Style="{StaticResource ButtonStyle}"
|
||||
Content="Resize"
|
||||
Click="ResizeButton_Click"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<CheckBox Content="112x112" Margin="10"/>
|
||||
<CheckBox Content="500x500" Margin="10"/>
|
||||
<CheckBox Content="1000x1000" Margin="10"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button
|
||||
Content="Resize"
|
||||
Padding="5"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
Click="ResizeButton_Click"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<!--
|
||||
<TextBlock Grid.Row="3" Text="Options:" Margin="0,0,0,5"/>
|
||||
|
||||
<CheckBox Grid.Row="4"
|
||||
Content="Optimize file size"
|
||||
Margin="0,0,0,15"/>
|
||||
|
||||
<Button Grid.Row="5"
|
||||
Content="Resize GIF"
|
||||
Width="120"
|
||||
Height="35"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"/>
|
||||
-->
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
22
GifResizer/Views/Resources/Style.xaml
Normal file
22
GifResizer/Views/Resources/Style.xaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="DarkGrid" TargetType="Grid">
|
||||
<Setter Property="Background" Value="#F7F8F7" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="#BA2D0B"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="Width" Value="Auto"/>
|
||||
<Setter Property="Height" Value="Auto"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="LinkButtonStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Width" Value="Auto"/>
|
||||
<Setter Property="Height" Value="Auto"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user