Browse Source

Made hello there window WrapPanel look good

CPKreuz 4 years ago
parent
commit
53b695b52c

+ 7 - 6
PixiEditor/Views/Dialogs/HelloTherePopup.xaml

@@ -6,7 +6,7 @@
         xmlns:dataHolders="clr-namespace:PixiEditor.Models.DataHolders" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters"
         xmlns:sys="clr-namespace:System;assembly=System.Runtime"
         mc:Ignorable="d"
-        Title="Hello there!" Height="630" Width="545"
+        Title="Hello there!" Height="615" Width="625"
         WindowStyle="None" WindowStartupLocation="CenterScreen">
 
     <Window.Resources>
@@ -40,7 +40,7 @@
                     Command="{x:Static SystemCommands.CloseWindowCommand}" />
         </DockPanel>
 
-        <ScrollViewer Grid.Row="1">
+        <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
             <Grid Grid.Row="1" Margin="0,30,0,0">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="90"/>
@@ -73,18 +73,19 @@
                                 </Binding.ConverterParameter>
                             </Binding>
                         </TextBlock.Visibility>
-                        Such empty here
+                        So much empty here
                     </TextBlock>
                     <ItemsControl ItemsSource="{Binding RecentlyOpened}">
                         <ItemsControl.ItemTemplate>
                             <DataTemplate DataType="{x:Type dataHolders:RecentlyOpenedDocument}">
                                 <StackPanel Margin="8,5,8,0" ToolTip="{Binding FilePath}">
                                     <Button Style="{StaticResource DarkRoundButton}" Margin="0,10,0,0" HorizontalAlignment="Center"
+                                            Width="90" Height="90"
                                             Command="{Binding DataContext.OpenRecentCommand, RelativeSource={RelativeSource AncestorType=WrapPanel}}" CommandParameter="{Binding FilePath}">
-                                        <Image Source="{Binding PreviewBitmap}" Height="50" Margin="20"/>
+                                        <Image Source="{Binding PreviewBitmap}" Margin="20"/>
                                     </Button>
 
-                                    <TextBlock Text="{Binding FileName}" FontSize="18" Margin="10,2,10,2" HorizontalAlignment="Center" Foreground="White"/>
+                                    <TextBlock Text="{Binding FileName}" Width="100" TextAlignment="Center" TextTrimming="CharacterEllipsis" FontSize="18" Margin="10,2,10,2" HorizontalAlignment="Center" Foreground="White"/>
                                 </StackPanel>
                             </DataTemplate>
                         </ItemsControl.ItemTemplate>
@@ -96,7 +97,7 @@
                     </ItemsControl>
                 </StackPanel>
 
-                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,15">
+                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,18">
                     <StackPanel.Style>
                         <Style TargetType="StackPanel">
                             <Style.Resources>

+ 11 - 0
PixiEditor/Views/Dialogs/HelloTherePopup.xaml.cs

@@ -55,6 +55,17 @@ namespace PixiEditor.Views.Dialogs
             RecentlyOpened.CollectionChanged += RecentlyOpened_CollectionChanged;
 
             InitializeComponent();
+
+            if (RecentlyOpenedEmpty)
+            {
+                Height = 450;
+                Width = 522;
+            }
+            else if (RecentlyOpened.Count < 7)
+            {
+                Height = 612;
+                Width = 506;
+            }
         }
 
         protected override void OnDeactivated(EventArgs e)