Browse Source

Updated import file popup

flabbet 5 years ago
parent
commit
b28dc4528f
4 changed files with 17 additions and 9 deletions
  1. 6 0
      PixiEditor/PixiEditor.csproj
  2. 11 9
      PixiEditor/Views/ImportFilePopup.xaml
  3. BIN
      PixiEditor/icon.ico
  4. BIN
      icon.ico

+ 6 - 0
PixiEditor/PixiEditor.csproj

@@ -11,10 +11,16 @@
     <RootNamespace>PixiEditor</RootNamespace>
     <RootNamespace>PixiEditor</RootNamespace>
     <RepositoryUrl>https://github.com/flabbet/PixiEditor</RepositoryUrl>
     <RepositoryUrl>https://github.com/flabbet/PixiEditor</RepositoryUrl>
     <PackageLicenseFile>LICENSE</PackageLicenseFile>
     <PackageLicenseFile>LICENSE</PackageLicenseFile>
+    <PackageIcon>icon.ico</PackageIcon>
+    <ApplicationIcon>icon.ico</ApplicationIcon>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
     <None Remove="Images\SwapArrows.png" />
     <None Remove="Images\SwapArrows.png" />
+    <None Include="..\icon.ico">
+      <Pack>True</Pack>
+      <PackagePath></PackagePath>
+    </None>
     <None Include="..\LICENSE">
     <None Include="..\LICENSE">
       <Pack>True</Pack>
       <Pack>True</Pack>
       <PackagePath></PackagePath>
       <PackagePath></PackagePath>

+ 11 - 9
PixiEditor/Views/ImportFilePopup.xaml

@@ -7,13 +7,15 @@
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:vm="clr-namespace:PixiEditor.ViewModels"
         xmlns:vm="clr-namespace:PixiEditor.ViewModels"
         xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
         xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
+        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
         mc:Ignorable="d"
         mc:Ignorable="d"
         Title="ImportFilePopup" Height="350" Width="300" WindowStyle="None" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Name="importFilePopup" DataContext="{DynamicResource ImportFilePopupViewModel}">
         Title="ImportFilePopup" Height="350" Width="300" WindowStyle="None" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Name="importFilePopup" DataContext="{DynamicResource ImportFilePopupViewModel}">
     <Window.Resources>
     <Window.Resources>
         <vm:ImportFilePopupViewModel x:Key="ImportFilePopupViewModel"/>
         <vm:ImportFilePopupViewModel x:Key="ImportFilePopupViewModel"/>
+        <helpers:ToolSizeToIntConverter x:Key="ToolSizeToIntConverter"/>
     </Window.Resources>
     </Window.Resources>
     <Border BorderBrush="Black" BorderThickness="1">
     <Border BorderBrush="Black" BorderThickness="1">
-    <Grid Background="#303030">
+    <Grid Background="#404040">
         <Grid.RowDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition Height="4*"/>
             <RowDefinition Height="4*"/>
             <RowDefinition Height="67*"/>
             <RowDefinition Height="67*"/>
@@ -24,7 +26,7 @@
                     <i:InvokeCommandAction Command="{Binding DragMoveCommand}"/>
                     <i:InvokeCommandAction Command="{Binding DragMoveCommand}"/>
                 </i:EventTrigger>
                 </i:EventTrigger>
             </i:Interaction.Triggers>
             </i:Interaction.Triggers>
-            <Button Width="20" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right" BorderThickness="0" Command="{Binding CloseButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
+            <Button Width="20" Height="20" Style="{StaticResource ImageButtonStyle}" Cursor="Hand" VerticalAlignment="Top" HorizontalAlignment="Right" BorderThickness="0" Command="{Binding CloseButtonCommand}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">
                 <Button.Background>
                 <Button.Background>
                     <ImageBrush ImageSource="/Images/Cross.png" Stretch="Uniform"/>
                     <ImageBrush ImageSource="/Images/Cross.png" Stretch="Uniform"/>
                 </Button.Background>
                 </Button.Background>
@@ -32,21 +34,21 @@
         </Grid>
         </Grid>
         <StackPanel Grid.Row="1" >
         <StackPanel Grid.Row="1" >
             <Label Height="40" Width="120" VerticalAlignment="Top" Content="Import" Foreground="Snow" HorizontalContentAlignment="Center" FontSize="24" Margin="0,10,0,0"/>
             <Label Height="40" Width="120" VerticalAlignment="Top" Content="Import" Foreground="Snow" HorizontalContentAlignment="Center" FontSize="24" Margin="0,10,0,0"/>
-        <StackPanel Background="#2D2D2D" Height="85" Width="190" Margin="0,10,0,0">
+        <StackPanel Background="#2D2D2D" Height="85" Width="200" Margin="0,10,0,0">
                 <DockPanel Height="20" Margin="0,15,0,0" Width="150">
                 <DockPanel Height="20" Margin="0,15,0,0" Width="150">
                     <TextBlock Width="40" HorizontalAlignment="Left" Text="Width:" Foreground="Snow" FontSize="14"/>
                     <TextBlock Width="40" HorizontalAlignment="Left" Text="Width:" Foreground="Snow" FontSize="14"/>
-                    <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="75" Margin="-10,0,0,0" Text="{Binding ImportWidth, Mode=TwoWay}">
+                    <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="75" Margin="-10,0,0,0" Text="{Binding ImportWidth, Converter={StaticResource ToolSizeToIntConverter}, Mode=TwoWay}">
                         <i:Interaction.Behaviors>
                         <i:Interaction.Behaviors>
-                            <behaviors:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
-                        </i:Interaction.Behaviors>
+                                <behaviors:TextBoxFocusBehavior FillSize="True" NextFocusDirection="Next"/>
+                            </i:Interaction.Behaviors>
                     </TextBox>
                     </TextBox>
                 </DockPanel>
                 </DockPanel>
                 <DockPanel Height="20" Margin="0,15,0,0" Width="150">
                 <DockPanel Height="20" Margin="0,15,0,0" Width="150">
                     <TextBlock Width="45" HorizontalAlignment="Left" Text="Height:" Foreground="Snow" FontSize="14"/>
                     <TextBlock Width="45" HorizontalAlignment="Left" Text="Height:" Foreground="Snow" FontSize="14"/>
-                    <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="75" Margin="-15,0,0,0" Text="{Binding ImportHeight, Mode=TwoWay}">
+                    <TextBox Style="{StaticResource DarkTextBoxStyle}" Width="75" Margin="-15,0,0,0" Text="{Binding ImportHeight, Converter={StaticResource ToolSizeToIntConverter}, Mode=TwoWay}">
                         <i:Interaction.Behaviors>
                         <i:Interaction.Behaviors>
-                            <behaviors:AllowableCharactersTextBoxBehavior RegularExpression="^[0-9./-]+$" MaxLength="4"/>
-                        </i:Interaction.Behaviors>
+                                <behaviors:TextBoxFocusBehavior FillSize="True" NextFocusDirection="Next"/>
+                            </i:Interaction.Behaviors>
                     </TextBox>
                     </TextBox>
                 </DockPanel>
                 </DockPanel>
 
 

BIN
PixiEditor/icon.ico


BIN
icon.ico