ソースを参照

Fixed update property action an titlebar

Krzysztof Krysiński 1 ヶ月 前
コミット
5554125c67

+ 1 - 1
src/PixiEditor/ViewModels/Document/DocumentViewModel.cs

@@ -445,7 +445,7 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
                 {
                     object value =
                         SerializationUtil.Deserialize(propertyValue.Value, config, allFactories, serializerData);
-                    acc.AddActions(new UpdatePropertyValue_Action(guid, propertyValue.Key, value));
+                    acc.AddActions(new UpdatePropertyValue_Action(guid, propertyValue.Key, value), new EndUpdatePropertyValue_Action());
                 }
             }
 

+ 171 - 167
src/PixiEditor/Views/Main/MainTitleBar.axaml

@@ -19,181 +19,185 @@
     <Design.DataContext>
         <menu:MenuBarViewModel />
     </Design.DataContext>
-    <Grid>
-        <dialogs:DialogTitleBar
-            DockPanel.Dock="Top">
-            <dialogs:DialogTitleBar.AdditionalElement>
-                <StackPanel Margin="5 0" Spacing="5" Orientation="Horizontal"
-                            Name="MainBarAdditionalElementPanel"
-                            DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType=main:MainTitleBar}}">
-                    <auth:UserAvatarToggle Width="26" Height="26" DataContext="{Binding Path=UserViewModel}" />
-                </StackPanel>
-            </dialogs:DialogTitleBar.AdditionalElement>
-        </dialogs:DialogTitleBar>
-        <Panel DockPanel.Dock="Left"
-               HorizontalAlignment="Left" Width="20" Height="20">
-            <Panel.Margin>
-                <OnPlatform>
-                    <OnPlatform.macOS>
-                        <Thickness>75, 0, 0, 0</Thickness>
-                    </OnPlatform.macOS>
-                    <OnPlatform.Default>
-                        <Thickness>10, 0, 0, 0</Thickness>
-                    </OnPlatform.Default>
-                </OnPlatform>
-            </Panel.Margin>
-            <ToggleButton Name="LogoButton" Padding="0" BorderThickness="0">
-                <Interaction.Behaviors>
-                    <behaviours:ShowFlyoutOnTrigger Trigger="{Binding OpenPixiEditorMenuTrigger}" />
-                </Interaction.Behaviors>
-                <ToggleButton.Background>
-                    <VisualBrush>
-                        <VisualBrush.Visual>
-                            <Svg Path="/Images/PixiEditorLogo.svg" />
-                        </VisualBrush.Visual>
-                    </VisualBrush>
-                </ToggleButton.Background>
-                <ToggleButton.Styles>
-                    <Style Selector="FlyoutPresenter.arrow">
-                        <Setter Property="Cursor" Value="Arrow" />
-                    </Style>
-                </ToggleButton.Styles>
-                <ToggleButton.Flyout>
-                    <Flyout Placement="BottomEdgeAlignedLeft" FlyoutPresenterClasses="arrow">
-                        <Flyout.Content>
-                            <StackPanel Spacing="5" Margin="5">
-                                <TextBlock Text="PixiEditor" Classes="h3" />
-                                <TextBlock Text="{Binding UpdateViewModel.VersionText}" />
-                                <TextBlock IsVisible="{Binding UpdateViewModel.SelfUpdatingAvailable}"
-                                           Text="{Binding UpdateViewModel.UpdateStateString}" />
-                                <Button ui:Translator.Key="DOWNLOAD_UPDATE"
-                                        Background="{DynamicResource ThemeAccentBrush}"
-                                        Command="{Binding UpdateViewModel.DownloadCommand}"
-                                        IsVisible="{Binding UpdateViewModel.IsUpdateAvailable}" />
-                                <ProgressBar IsVisible="{Binding UpdateViewModel.IsDownloading}" 
-                                             ShowProgressText="True" Value="{Binding UpdateViewModel.CurrentProgress}"
-                                              Maximum="100" Minimum="0"/>
-                                <Button ui:Translator.Key="SWITCH_TO_NEW_VERSION"
-                                        Background="{DynamicResource ThemeAccentBrush}"
-                                        Command="{Binding UpdateViewModel.InstallCommand}"
-                                        IsVisible="{Binding UpdateViewModel.UpdateReadyToInstall}" />
-                            </StackPanel>
-                        </Flyout.Content>
-                    </Flyout>
-                </ToggleButton.Flyout>
-            </ToggleButton>
-            <Panel ClipToBounds="False" Margin="10, 10, 0, 0"
-                   IsVisible="{Binding UpdateViewModel.SelfUpdatingAvailable}"
-                   IsHitTestVisible="False" VerticalAlignment="Bottom" HorizontalAlignment="Right">
-                <Panel.Styles>
-                    <Style Selector="TextBlock.pulse">
-                        <Style.Animations>
-                            <Animation Duration="0:0:1" DelayBetweenIterations="0:0:2.5" IterationCount="60">
-                                <Animation.Easing>
-                                    <CubicEaseInOut />
-                                </Animation.Easing>
-                                <KeyFrame Cue="0%">
-                                    <Setter Property="ScaleTransform.ScaleX" Value="1" />
-                                    <Setter Property="ScaleTransform.ScaleY" Value="1" />
-                                    <Setter Property="RotateTransform.Angle" Value="0" />
-                                </KeyFrame>
-                                <KeyFrame Cue="50%">
-                                    <Setter Property="ScaleTransform.ScaleX" Value="1.5" />
-                                    <Setter Property="ScaleTransform.ScaleY" Value="1.5" />
-                                    <Setter Property="RotateTransform.Angle" Value="45" />
-                                </KeyFrame>
-                                <KeyFrame Cue="75%">
-                                    <Setter Property="RotateTransform.Angle" Value="-45" />
-                                </KeyFrame>
-                                <KeyFrame Cue="100%">
-                                    <Setter Property="ScaleTransform.ScaleX" Value="1" />
-                                    <Setter Property="ScaleTransform.ScaleY" Value="1" />
-                                    <Setter Property="RotateTransform.Angle" Value="0" />
-                                </KeyFrame>
-                            </Animation>
-                        </Style.Animations>
-                    </Style>
-                </Panel.Styles>
-                <TextBlock Text="!" IsVisible="{Binding UpdateViewModel.IsUpdateAvailable}"
-                           ClipToBounds="False"
-                           FontWeight="SemiBold" Classes="pulse"
-                           Foreground="Yellow" FontSize="18" />
-                <TextBlock Text="{DynamicResource icon-settings}"
-                           ClipToBounds="False"
-                           Width="16" Height="16"
-                           IsVisible="{Binding UpdateViewModel.IsDownloading}"
-                           Classes="pixi-icon" Foreground="DarkGray" FontSize="16">
-                    <TextBlock.Styles>
-                        <Style Selector="TextBlock">
+    <Panel>
+        <Panel Background="{DynamicResource ThemeBackgroundBrush1}" IsHitTestVisible="False"/>
+        <DockPanel>
+            <dialogs:DialogTitleBar
+                DockPanel.Dock="Right">
+                <dialogs:DialogTitleBar.AdditionalElement>
+                    <StackPanel Margin="5 0" Spacing="5" Orientation="Horizontal"
+                                Name="MainBarAdditionalElementPanel"
+                                DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType=main:MainTitleBar}}">
+                        <auth:UserAvatarToggle Width="26" Height="26" DataContext="{Binding Path=UserViewModel}" />
+                    </StackPanel>
+                </dialogs:DialogTitleBar.AdditionalElement>
+            </dialogs:DialogTitleBar>
+            <Panel DockPanel.Dock="Left"
+                   HorizontalAlignment="Left" Width="20" Height="20">
+                <Panel.Margin>
+                    <OnPlatform>
+                        <OnPlatform.macOS>
+                            <Thickness>75, 0, 0, 0</Thickness>
+                        </OnPlatform.macOS>
+                        <OnPlatform.Default>
+                            <Thickness>10, 0, 0, 0</Thickness>
+                        </OnPlatform.Default>
+                    </OnPlatform>
+                </Panel.Margin>
+                <ToggleButton Name="LogoButton" Padding="0" BorderThickness="0">
+                    <Interaction.Behaviors>
+                        <behaviours:ShowFlyoutOnTrigger Trigger="{Binding OpenPixiEditorMenuTrigger}" />
+                    </Interaction.Behaviors>
+                    <ToggleButton.Background>
+                        <VisualBrush>
+                            <VisualBrush.Visual>
+                                <Svg Path="/Images/PixiEditorLogo.svg" />
+                            </VisualBrush.Visual>
+                        </VisualBrush>
+                    </ToggleButton.Background>
+                    <ToggleButton.Styles>
+                        <Style Selector="FlyoutPresenter.arrow">
+                            <Setter Property="Cursor" Value="Arrow" />
+                        </Style>
+                    </ToggleButton.Styles>
+                    <ToggleButton.Flyout>
+                        <Flyout Placement="BottomEdgeAlignedLeft" FlyoutPresenterClasses="arrow">
+                            <Flyout.Content>
+                                <StackPanel Spacing="5" Margin="5">
+                                    <TextBlock Text="PixiEditor" Classes="h3" />
+                                    <TextBlock Text="{Binding UpdateViewModel.VersionText}" />
+                                    <TextBlock IsVisible="{Binding UpdateViewModel.SelfUpdatingAvailable}"
+                                               Text="{Binding UpdateViewModel.UpdateStateString}" />
+                                    <Button ui:Translator.Key="DOWNLOAD_UPDATE"
+                                            Background="{DynamicResource ThemeAccentBrush}"
+                                            Command="{Binding UpdateViewModel.DownloadCommand}"
+                                            IsVisible="{Binding UpdateViewModel.IsUpdateAvailable}" />
+                                    <ProgressBar IsVisible="{Binding UpdateViewModel.IsDownloading}"
+                                                 ShowProgressText="True"
+                                                 Value="{Binding UpdateViewModel.CurrentProgress}"
+                                                 Maximum="100" Minimum="0" />
+                                    <Button ui:Translator.Key="SWITCH_TO_NEW_VERSION"
+                                            Background="{DynamicResource ThemeAccentBrush}"
+                                            Command="{Binding UpdateViewModel.InstallCommand}"
+                                            IsVisible="{Binding UpdateViewModel.UpdateReadyToInstall}" />
+                                </StackPanel>
+                            </Flyout.Content>
+                        </Flyout>
+                    </ToggleButton.Flyout>
+                </ToggleButton>
+                <Panel ClipToBounds="False" Margin="10, 10, 0, 0"
+                       IsVisible="{Binding UpdateViewModel.SelfUpdatingAvailable}"
+                       IsHitTestVisible="False" VerticalAlignment="Bottom" HorizontalAlignment="Right">
+                    <Panel.Styles>
+                        <Style Selector="TextBlock.pulse">
                             <Style.Animations>
-                                <Animation Duration="0:0:5" IterationCount="Infinite">
+                                <Animation Duration="0:0:1" DelayBetweenIterations="0:0:2.5" IterationCount="60">
+                                    <Animation.Easing>
+                                        <CubicEaseInOut />
+                                    </Animation.Easing>
                                     <KeyFrame Cue="0%">
-                                        <Setter Property="RotateTransform.Angle" Value="0.0" />
+                                        <Setter Property="ScaleTransform.ScaleX" Value="1" />
+                                        <Setter Property="ScaleTransform.ScaleY" Value="1" />
+                                        <Setter Property="RotateTransform.Angle" Value="0" />
+                                    </KeyFrame>
+                                    <KeyFrame Cue="50%">
+                                        <Setter Property="ScaleTransform.ScaleX" Value="1.5" />
+                                        <Setter Property="ScaleTransform.ScaleY" Value="1.5" />
+                                        <Setter Property="RotateTransform.Angle" Value="45" />
+                                    </KeyFrame>
+                                    <KeyFrame Cue="75%">
+                                        <Setter Property="RotateTransform.Angle" Value="-45" />
                                     </KeyFrame>
                                     <KeyFrame Cue="100%">
-                                        <Setter Property="RotateTransform.Angle" Value="360" />
+                                        <Setter Property="ScaleTransform.ScaleX" Value="1" />
+                                        <Setter Property="ScaleTransform.ScaleY" Value="1" />
+                                        <Setter Property="RotateTransform.Angle" Value="0" />
                                     </KeyFrame>
                                 </Animation>
                             </Style.Animations>
                         </Style>
-                    </TextBlock.Styles>
-                </TextBlock>
-                <Ellipse
-                    ClipToBounds="False"
-                    Fill="{DynamicResource ThemeAccent3Brush}"
-                    IsVisible="{Binding UpdateViewModel.UpdateReadyToInstall}"
-                    Width="8" Height="8" />
+                    </Panel.Styles>
+                    <TextBlock Text="!" IsVisible="{Binding UpdateViewModel.IsUpdateAvailable}"
+                               ClipToBounds="False"
+                               FontWeight="SemiBold" Classes="pulse"
+                               Foreground="Yellow" FontSize="18" />
+                    <TextBlock Text="{DynamicResource icon-settings}"
+                               ClipToBounds="False"
+                               Width="16" Height="16"
+                               IsVisible="{Binding UpdateViewModel.IsDownloading}"
+                               Classes="pixi-icon" Foreground="DarkGray" FontSize="16">
+                        <TextBlock.Styles>
+                            <Style Selector="TextBlock">
+                                <Style.Animations>
+                                    <Animation Duration="0:0:5" IterationCount="Infinite">
+                                        <KeyFrame Cue="0%">
+                                            <Setter Property="RotateTransform.Angle" Value="0.0" />
+                                        </KeyFrame>
+                                        <KeyFrame Cue="100%">
+                                            <Setter Property="RotateTransform.Angle" Value="360" />
+                                        </KeyFrame>
+                                    </Animation>
+                                </Style.Animations>
+                            </Style>
+                        </TextBlock.Styles>
+                    </TextBlock>
+                    <Ellipse
+                        ClipToBounds="False"
+                        Fill="{DynamicResource ThemeAccent3Brush}"
+                        IsVisible="{Binding UpdateViewModel.UpdateReadyToInstall}"
+                        Width="8" Height="8" />
+                </Panel>
             </Panel>
-        </Panel>
 
-        <StackPanel Orientation="Horizontal">
-            <StackPanel.Margin>
-                <OnPlatform>
-                    <OnPlatform.macOS>
-                        <Thickness>95, 0, 0, 0</Thickness>
-                    </OnPlatform.macOS>
-                </OnPlatform>
-            </StackPanel.Margin>
-            <xaml:Menu IsVisible="{OnPlatform macOS=false, Default=true}"
-                       Margin="40, 0, 0, 0"
-                       DockPanel.Dock="Left"
-                       HorizontalAlignment="Left"
-                       VerticalAlignment="Center"
-                       ItemsSource="{Binding MenuEntries}"
-                       Background="Transparent" />
-            <Border DockPanel.Dock="Left" Height="25" Width="150"
-                    Background="{DynamicResource ThemeBackgroundBrush}"
-                    CornerRadius="5" BorderThickness="1"
-                    Margin="10,0,0,0"
-                    Cursor="IBeam">
-                <Border.Styles>
-                    <Style Selector="Border">
-                        <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
-                    </Style>
-                    <Style Selector="Border:pointerover">
-                        <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}" />
-                    </Style>
-                </Border.Styles>
-                <Interaction.Behaviors>
-                    <EventTriggerBehavior
-                        EventName="PointerPressed">
-                        <InvokeCommandAction
-                            Command="{xaml:Command PixiEditor.Search.Toggle}" />
-                    </EventTriggerBehavior>
-                </Interaction.Behaviors>
-                <Grid Margin="5,0" VerticalAlignment="Center">
-                    <TextBlock ui:Translator.Key="SEARCH" />
-                    <TextBlock
-                        Text="{xaml:ShortcutBinding PixiEditor.Search.Toggle, Converter={converters:KeyToStringConverter}}"
-                        HorizontalAlignment="Right" />
-                </Grid>
-            </Border>
-        </StackPanel>
-        <main:MiniAnimationPlayer
-            Name="MiniPlayer"
-            ActiveFrame="{Binding ActiveDocument.AnimationDataViewModel.ActiveFrameBindable, Source={viewModels:MainVM DocumentManagerSVM}, Mode=TwoWay}"
-            FramesCount="{Binding ActiveDocument.AnimationDataViewModel.FramesCount, Source={viewModels:MainVM DocumentManagerSVM}}"
-            IsPlaying="{Binding ActiveDocument.AnimationDataViewModel.IsPlayingBindable, Source={viewModels:MainVM DocumentManagerSVM}, Mode=TwoWay}"
-            Margin="0 4" />
-    </Grid>
+            <StackPanel Orientation="Horizontal">
+                <StackPanel.Margin>
+                    <OnPlatform>
+                        <OnPlatform.macOS>
+                            <Thickness>95, 0, 0, 0</Thickness>
+                        </OnPlatform.macOS>
+                    </OnPlatform>
+                </StackPanel.Margin>
+                <xaml:Menu IsVisible="{OnPlatform macOS=false, Default=true}"
+                           Margin="5, 0, 0, 0"
+                           DockPanel.Dock="Left"
+                           HorizontalAlignment="Left"
+                           VerticalAlignment="Center"
+                           ItemsSource="{Binding MenuEntries}"
+                           Background="Transparent" />
+                <Border DockPanel.Dock="Left" Height="25" Width="150"
+                        Background="{DynamicResource ThemeBackgroundBrush}"
+                        CornerRadius="5" BorderThickness="1"
+                        Margin="10,0,0,0"
+                        Cursor="IBeam">
+                    <Border.Styles>
+                        <Style Selector="Border">
+                            <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
+                        </Style>
+                        <Style Selector="Border:pointerover">
+                            <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}" />
+                        </Style>
+                    </Border.Styles>
+                    <Interaction.Behaviors>
+                        <EventTriggerBehavior
+                            EventName="PointerPressed">
+                            <InvokeCommandAction
+                                Command="{xaml:Command PixiEditor.Search.Toggle}" />
+                        </EventTriggerBehavior>
+                    </Interaction.Behaviors>
+                    <Grid Margin="5,0" VerticalAlignment="Center">
+                        <TextBlock ui:Translator.Key="SEARCH" />
+                        <TextBlock
+                            Text="{xaml:ShortcutBinding PixiEditor.Search.Toggle, Converter={converters:KeyToStringConverter}}"
+                            HorizontalAlignment="Right" />
+                    </Grid>
+                </Border>
+            </StackPanel>
+            <main:MiniAnimationPlayer
+                Name="MiniPlayer"
+                ActiveFrame="{Binding ActiveDocument.AnimationDataViewModel.ActiveFrameBindable, Source={viewModels:MainVM DocumentManagerSVM}, Mode=TwoWay}"
+                FramesCount="{Binding ActiveDocument.AnimationDataViewModel.FramesCount, Source={viewModels:MainVM DocumentManagerSVM}}"
+                IsPlaying="{Binding ActiveDocument.AnimationDataViewModel.IsPlayingBindable, Source={viewModels:MainVM DocumentManagerSVM}, Mode=TwoWay}"
+                Margin="0 4" />
+        </DockPanel>
+    </Panel>
 </UserControl>