Ruben 4 лет назад
Родитель
Сommit
098eba90f0
2 измененных файлов с 63 добавлено и 111 удалено
  1. 40 107
      PicView/Views/Windows/ResizeWindow.xaml
  2. 23 4
      PicView/Views/Windows/ResizeWindow.xaml.cs

+ 40 - 107
PicView/Views/Windows/ResizeWindow.xaml

@@ -25,7 +25,6 @@
             <Setter Property="TextTrimming" Value="CharacterEllipsis" />
             <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
         </Style>
-
     </Window.Resources>
 
     <DockPanel Background="{StaticResource NoisyBg}">
@@ -50,6 +49,8 @@
                 DockPanel.Dock="Right" />
 
             <TextBlock
+                Width="Auto"
+                Margin="0,0,0,0"
                 VerticalAlignment="Center"
                 FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Bold"
                 FontSize="14"
@@ -67,20 +68,22 @@
             <StackPanel Margin="0,10,0,5" Orientation="Horizontal">
                 <TextBlock Text="Source folder" />
                 <TextBox
+                    x:Name="SourceFolderInput"
                     Width="298"
+                    d:Text="B:\Pictures\new folder"
                     FontSize="11"
-                    IsReadOnly="False"
-                    Text="B:\Pictures\new folder" />
+                    IsReadOnly="False" />
                 <uc:FolderButton x:Name="SourceFolderButton" />
             </StackPanel>
 
             <StackPanel Margin="0,0,0,10" Orientation="Horizontal">
                 <TextBlock Text="Output folder" />
                 <TextBox
+                    x:Name="OutputFolderInput"
                     Width="298"
+                    d:Text="B:\Pictures\another new folder"
                     FontSize="11"
-                    IsReadOnly="False"
-                    Text="B:\Pictures\another new folder" />
+                    IsReadOnly="False" />
                 <uc:FolderButton x:Name="OutputFolderButton" />
             </StackPanel>
 
@@ -245,108 +248,38 @@
                 </ComboBox>
             </StackPanel>
 
-            <StackPanel Margin="8,3,0,5" Orientation="Horizontal">
-                <TextBlock Width="188">
-                    <Run Text="Thumbnail" />
-                    <Run Text=" 1 " />
-                    <Run Text="output folder" />
-                </TextBlock>
-                <TextBox
-                    Width="231"
-                    FontSize="11"
-                    IsReadOnly="False"
-                    Text="B:\Pictures\another new folder\Large" />
-                <uc:FolderButton x:Name="OutputFolderThumb1" />
-            </StackPanel>
-
-            <StackPanel Margin="17,3,0,6" Orientation="Horizontal">
-
-                <TextBlock Width="179" Text="{StaticResource Resize}" />
-
-                <StackPanel Orientation="Horizontal">
-
-                    <ComboBox>
-                        <ComboBoxItem Content="{StaticResource Width}" />
-                        <ComboBoxItem Content="{StaticResource Height}" />
-                        <ComboBoxItem Content="Percentage" IsSelected="True" />
-                    </ComboBox>
-                    <TextBox
-                        Width="96"
-                        Margin="15,0,0,0"
-                        IsReadOnly="False"
-                        Text="80" />
-                </StackPanel>
-            </StackPanel>
-
-
-            <StackPanel Margin="8,3,0,5" Orientation="Horizontal">
-                <TextBlock Width="188">
-                    <Run Text="Thumbnail" />
-                    <Run Text=" 2 " />
-                    <Run Text="output folder" />
-                </TextBlock>
-                <TextBox
-                    Width="231"
-                    FontSize="11"
-                    IsReadOnly="False"
-                    Text="B:\Pictures\another new folder\Medium" />
-                <uc:FolderButton x:Name="OutputFolderThumb2" />
-            </StackPanel>
-
-            <StackPanel Margin="17,3,0,6" Orientation="Horizontal">
-
-                <TextBlock Width="179" Text="{StaticResource Resize}" />
-
-                <StackPanel Orientation="Horizontal">
-
-                    <ComboBox>
-                        <ComboBoxItem Content="{StaticResource Width}" />
-                        <ComboBoxItem Content="{StaticResource Height}" />
-                        <ComboBoxItem Content="Percentage" IsSelected="True" />
-                    </ComboBox>
-                    <TextBox
-                        Width="96"
-                        Margin="15,0,0,0"
-                        IsReadOnly="False"
-                        Text="50" />
-                </StackPanel>
-            </StackPanel>
-
-
-
-            <StackPanel Margin="8,3,0,5" Orientation="Horizontal">
-                <TextBlock Width="188">
-                    <Run Text="Thumbnail" />
-                    <Run Text=" 3 " />
-                    <Run Text="output folder" />
-                </TextBlock>
-                <TextBox
-                    Width="231"
-                    FontSize="11"
-                    IsReadOnly="False"
-                    Text="B:\Pictures\another new folder\Small" />
-                <uc:FolderButton x:Name="OutputFolderThumb3" />
-            </StackPanel>
-
-            <StackPanel Margin="17,3,0,6" Orientation="Horizontal">
-
-                <TextBlock Width="179" Text="{StaticResource Resize}" />
-
-                <StackPanel Orientation="Horizontal">
-
-                    <ComboBox>
-                        <ComboBoxItem Content="{StaticResource Width}" />
-                        <ComboBoxItem Content="{StaticResource Height}" />
-                        <ComboBoxItem Content="Percentage" IsSelected="True" />
-                    </ComboBox>
-                    <TextBox
-                        Width="96"
-                        Margin="15,0,0,0"
-                        IsReadOnly="False"
-                        Text="30" />
-                </StackPanel>
-            </StackPanel>
-
+            <ScrollViewer MaxHeight="420">
+                <ScrollViewer.Style>
+                    <Style TargetType="{x:Type ScrollViewer}">
+                        <Setter Property="OverridesDefaultStyle" Value="True" />
+                        <Setter Property="Template">
+                            <Setter.Value>
+                                <ControlTemplate TargetType="{x:Type ScrollViewer}">
+                                    <Grid>
+                                        <Grid.ColumnDefinitions>
+                                            <ColumnDefinition Width="*" />
+                                            <ColumnDefinition Width="Auto" />
+                                        </Grid.ColumnDefinitions>
+                                        <Grid.RowDefinitions>
+                                            <RowDefinition Height="*" />
+                                            <RowDefinition Height="Auto" />
+                                        </Grid.RowDefinitions>
+                                        <ScrollContentPresenter Grid.RowSpan="2" Grid.ColumnSpan="2" />
+                                        <ScrollBar
+                                            Name="PART_VerticalScrollBar"
+                                            Grid.Column="1"
+                                            Maximum="{TemplateBinding ScrollableHeight}"
+                                            ViewportSize="{TemplateBinding ViewportHeight}"
+                                            Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
+                                            Value="{TemplateBinding VerticalOffset}" />
+                                    </Grid>
+                                </ControlTemplate>
+                            </Setter.Value>
+                        </Setter>
+                    </Style>
+                </ScrollViewer.Style>
+                <StackPanel x:Name="GeneratedThumbnailsContainer" />
+            </ScrollViewer>
 
             <TextBox
                 Height="150"

+ 23 - 4
PicView/Views/Windows/ResizeWindow.xaml.cs

@@ -1,12 +1,12 @@
-using PicView.UILogic.Sizing;
+using PicView.ChangeImage;
+using PicView.UILogic;
+using PicView.UILogic.Sizing;
+using System.IO;
 using System.Windows;
 using System.Windows.Input;
 
 namespace PicView.Views.Windows
 {
-    /// <summary>
-    /// Interaction logic for ResizeWindow.xaml
-    /// </summary>
     public partial class ResizeWindow : Window
     {
         public ResizeWindow()
@@ -25,6 +25,25 @@ namespace PicView.Views.Windows
 
             ContentRendered += (sender, e) =>
             {
+                if (Error_Handling.CheckOutOfRange() == false)
+                {
+                    SourceFolderInput.Text = Path.GetDirectoryName(Navigation.Pics[Navigation.FolderIndex]);
+                    OutputFolderInput.Text = SourceFolderInput.Text + @"\Processed Pictures";
+                }
+
+                //GenerateThumbnailsCB.SelectionChanged += delegate
+                //{
+
+                //};
+
+                for (int i = 1; i <= 5; i++)
+                {
+                    GeneratedThumbnailsContainer.Children.Add(new UserControls.ThumbnailOutputUC(i, OutputFolderInput.Text, "xl"));
+                }
+
+                
+
+
                 MouseLeftButtonDown += (_, e) =>
                 { if (e.LeftButton == MouseButtonState.Pressed) { DragMove(); } };