浏览代码

Second startup window page WIP and more example files

CPKreuz 1 年之前
父节点
当前提交
97f3907e5c

二进制
src/PixiEditor.AvaloniaUI/Data/BetaExampleFiles/Outline.pixi


二进制
src/PixiEditor.AvaloniaUI/Data/BetaExampleFiles/Slime.pixi


+ 3 - 1
src/PixiEditor.AvaloniaUI/Data/Localization/Languages/en.json

@@ -677,5 +677,7 @@
   
   "BETA_EXAMPLE_FILES": "Beta Example Files",
   "POND_EXAMPLE": "Pond",
-  "TREE_EXAMPLE": "Windy Tree"
+  "TREE_EXAMPLE": "Windy Tree",
+  "OUTLINE_EXAMPLE": "Automatic Outline",
+  "SLIME_EXAMPLE": "Animated Slime"
 }

+ 2 - 1
src/PixiEditor.AvaloniaUI/Views/Windows/BetaExampleButton.axaml

@@ -34,6 +34,7 @@
         <TextBlock ui:Translator.Key="{Binding DisplayName, RelativeSource={RelativeSource AncestorType=windows:BetaExampleButton}}"
                    Width="110" TextAlignment="Center"
                    TextTrimming="CharacterEllipsis"
-                   FontSize="18" Margin="10,10,10,2" HorizontalAlignment="Center" />
+                   TextWrapping="Wrap"
+                   Margin="10,10,10,2" HorizontalAlignment="Center" />
     </StackPanel>
 </UserControl>

+ 46 - 1
src/PixiEditor.AvaloniaUI/Views/Windows/HelloTherePopup.axaml

@@ -35,7 +35,7 @@
                 <ColumnDefinition Width="300" />
             </Grid.ColumnDefinitions>
 
-            <ScrollViewer Grid.Column="0" VerticalScrollBarVisibility="Auto" Margin="3,0">
+            <ScrollViewer Grid.Column="0" VerticalScrollBarVisibility="Auto" IsVisible="{Binding !ShowAllBetaExamples, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" Margin="3,0">
                 <Grid Grid.Row="1" Margin="0,30,0,0">
                     <Grid.RowDefinitions>
                         <RowDefinition Height="90" />
@@ -84,6 +84,24 @@
                         <StackPanel Orientation="Horizontal">
                             <windows:BetaExampleButton FileName="Pond.pixi" DisplayName="POND_EXAMPLE" CloseCommand="{Binding CloseCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" />
                             <windows:BetaExampleButton FileName="Tree.pixi" DisplayName="TREE_EXAMPLE" CloseCommand="{Binding CloseCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" />
+                            
+                            <StackPanel>
+                                <Button Margin="0,10,0,0" HorizontalAlignment="Center"
+                                        Width="100" Height="100"
+                                        Padding="0"
+                                        Background="{DynamicResource ThemeAccentBrush2}"
+                                        Command="{Binding SetShowAllBetaExamplesCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}"
+                                        CommandParameter="{x:True}">
+                                    <Grid Width="100" Height="100">
+                                        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Show all 8 >"/>
+                                    </Grid>
+                                </Button>
+
+                                <TextBlock Text=" "
+                                           Width="110" TextAlignment="Center"
+                                           TextTrimming="CharacterEllipsis"
+                                           FontSize="18" Margin="10,10,10,2" HorizontalAlignment="Center" />
+                            </StackPanel>
                         </StackPanel>
                         
                         <TextBlock Margin="0,8,0,0" FontSize="23" FontWeight="SemiBold" HorizontalAlignment="Center"
@@ -305,6 +323,33 @@
                     </panels:AlignableWrapPanel>
                 </Grid>
             </ScrollViewer>
+            
+            <ScrollViewer Grid.Column="0" VerticalScrollBarVisibility="Auto" IsVisible="{Binding ShowAllBetaExamples, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" Margin="3,0">
+                <StackPanel>
+                    <Button Margin="0,5,0,0" HorizontalAlignment="Left"
+                            Command="{Binding SetShowAllBetaExamplesCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}"
+                            CommandParameter="{x:False}"
+                            Content="Go back" HorizontalContentAlignment="Left"/>
+                    
+                    <TextBlock Text="Procedural Generation" Margin="0,0,0,2" HorizontalAlignment="Center" TextAlignment="Center" FontSize="18" FontWeight="SemiBold" />
+                    
+                    <ScrollViewer HorizontalAlignment="Center" VerticalScrollBarVisibility="Auto">
+                        <StackPanel Orientation="Horizontal">
+                            <windows:BetaExampleButton FileName="Pond.pixi" DisplayName="POND_EXAMPLE" CloseCommand="{Binding CloseCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" />
+                            <windows:BetaExampleButton FileName="Tree.pixi" DisplayName="TREE_EXAMPLE" CloseCommand="{Binding CloseCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" />
+                            <windows:BetaExampleButton FileName="Outline.pixi" DisplayName="OUTLINE_EXAMPLE" CloseCommand="{Binding CloseCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" />
+                        </StackPanel>
+                    </ScrollViewer>
+                    
+                    <TextBlock Text="Animations" Margin="0,8,0,2" HorizontalAlignment="Center" TextAlignment="Center" FontSize="18" FontWeight="SemiBold" />
+                    
+                    <ScrollViewer HorizontalAlignment="Center" VerticalScrollBarVisibility="Auto">
+                        <StackPanel Orientation="Horizontal">
+                            <windows:BetaExampleButton FileName="Slime.pixi" DisplayName="SLIME_EXAMPLE" CloseCommand="{Binding CloseCommand, RelativeSource={RelativeSource AncestorType=windows:HelloTherePopup}}" />
+                        </StackPanel>
+                    </ScrollViewer>
+                </StackPanel>
+            </ScrollViewer>
 
             <ScrollViewer Grid.Column="1"
                           IsVisible="{Binding !NewsPanelCollapsed}">

+ 17 - 0
src/PixiEditor.AvaloniaUI/Views/Windows/HelloTherePopup.axaml.cs

@@ -35,6 +35,9 @@ internal partial class HelloTherePopup : PixiEditorPopup
     public static readonly StyledProperty<bool> IsFetchingNewsProperty =
         AvaloniaProperty.Register<HelloTherePopup, bool>(nameof(IsFetchingNews), defaultValue: default(bool));
 
+    public static readonly StyledProperty<bool> ShowAllBetaExamplesProperty =
+        AvaloniaProperty.Register<HelloTherePopup, bool>(nameof(ShowAllBetaExamples));
+
     public static readonly StyledProperty<bool> NewsPanelCollapsedProperty =
         AvaloniaProperty.Register<HelloTherePopup, bool>(nameof(NewsPanelCollapsed), defaultValue: false);
 
@@ -56,6 +59,12 @@ internal partial class HelloTherePopup : PixiEditorPopup
         get { return (bool)GetValue(IsFetchingNewsProperty); }
         set { SetValue(IsFetchingNewsProperty, value); }
     }
+    
+    public bool ShowAllBetaExamples
+    {
+        get => GetValue(ShowAllBetaExamplesProperty);
+        set => SetValue(ShowAllBetaExamplesProperty, value);
+    }
 
     public bool FailedFetchingNews
     {
@@ -80,6 +89,8 @@ internal partial class HelloTherePopup : PixiEditorPopup
     
     public RelayCommand<string> OpenInExplorerCommand { get; set; }
 
+    public RelayCommand<bool> SetShowAllBetaExamplesCommand { get; set; }
+
     public bool IsClosing { get; private set; }
 
     private NewsProvider NewsProvider { get; set; }
@@ -103,6 +114,7 @@ internal partial class HelloTherePopup : PixiEditorPopup
         OpenFileCommand = new AsyncRelayCommand(OpenFile);
         OpenNewFileCommand = new AsyncRelayCommand(OpenNewFile);
         OpenRecentCommand = new RelayCommand<string>(OpenRecent);
+        SetShowAllBetaExamplesCommand = new RelayCommand<bool>(SetShowAllBetaExamples);
         OpenInExplorerCommand = new RelayCommand<string>(OpenInExplorer, CanOpenInExplorer);
 
         RecentlyOpenedEmpty = RecentlyOpened.Count == 0;
@@ -143,6 +155,11 @@ internal partial class HelloTherePopup : PixiEditorPopup
         }
     }
 
+    private void SetShowAllBetaExamples(bool value)
+    {
+        ShowAllBetaExamples = value;
+    }
+
     private static void NewsPanelCollapsedChangedCallback(AvaloniaPropertyChangedEventArgs<bool> e)
     {
         HelloTherePopup helloTherePopup = (HelloTherePopup)e.Sender;