Browse Source

Added customizable background size

Krzysztof Krysiński 3 months ago
parent
commit
c631e827c2

+ 8 - 0
src/PixiEditor.Extensions.CommonApi/UserPreferences/PreferencesConstants.cs

@@ -33,6 +33,14 @@ public static class PreferencesConstants
 
     public const string AnalyticsEnabled = "AnalyticsEnabled";
     public const bool AnalyticsEnabledDefault = true;
+
     public const string PrimaryToolset = "PrimaryToolset";
     public const string PrimaryToolsetDefault = "PAINT_TOOLSET";
+
+    public const string AutoScaleBackground = "AutoScaleBackground";
+    public const bool AutoScaleBackgroundDefault = true;
+
+    public const string CustomBackgroundScaleX = "CustomBackgroundScaleX";
+    public const string CustomBackgroundScaleY = "CustomBackgroundScaleY";
+    public const double CustomBackgroundScaleDefault = 16;
 }

+ 7 - 0
src/PixiEditor.Extensions.CommonApi/UserPreferences/Settings/PixiEditor/PixiEditorSettings.cs

@@ -71,4 +71,11 @@ public static class PixiEditorSettings
     {
         public static SyncedSetting<bool> AnalyticsEnabled { get; } = SyncedSetting.NonOwned(PixiEditor, true);
     }
+
+    public static class Scene
+    {
+        public static SyncedSetting<bool> AutoScaleBackground { get; } = SyncedSetting.NonOwned(PixiEditor, PreferencesConstants.AutoScaleBackgroundDefault, PreferencesConstants.AutoScaleBackground);
+        public static SyncedSetting<double> CustomBackgroundScaleX { get; } = SyncedSetting.NonOwned(PixiEditor, PreferencesConstants.CustomBackgroundScaleDefault, PreferencesConstants.CustomBackgroundScaleX);
+        public static SyncedSetting<double> CustomBackgroundScaleY { get; } = SyncedSetting.NonOwned(PixiEditor, PreferencesConstants.CustomBackgroundScaleDefault, PreferencesConstants.CustomBackgroundScaleY);
+    }
 }

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

@@ -1025,5 +1025,9 @@
   "ONB_SHORTCUTS": "Select Your Shortcuts",
   "GRAPH_STATE_UNABLE_TO_CREATE_MEMBER": "Current Node Graph setup disallows creation of a new layer next to the selected one.",
   "PRIMARY_TOOLSET": "Primary Toolset",
-  "OPEN_ONBOARDING_WINDOW": "Open onboarding window"
+  "OPEN_ONBOARDING_WINDOW": "Open onboarding window",
+  "AUTO_SCALE_BACKGROUND": "Auto scale background",
+  "UPDATES": "Updates",
+  "SCENE": "Scene",
+  "CUSTOM_BACKGROUND_SCALE": "Custom background scale",
 }

+ 2 - 0
src/PixiEditor/ViewModels/SettingsWindowViewModel.cs

@@ -270,7 +270,9 @@ internal partial class SettingsWindowViewModel : ViewModelBase
             new("GENERAL"),
             new("DISCORD"),
             new("KEY_BINDINGS"),
+            new SettingsPage("UPDATES"),
             new("EXPORT"),
+            new SettingsPage("SCENE")
         };
 
         ILocalizationProvider.Current.OnLanguageChanged += OnLanguageChanged;

+ 69 - 6
src/PixiEditor/ViewModels/SubViewModels/ViewportWindowViewModel.cs

@@ -5,6 +5,8 @@ using PixiDocks.Core.Docking.Events;
 using PixiEditor.Helpers.UI;
 using PixiEditor.Models.DocumentModels;
 using Drawie.Numerics;
+using PixiEditor.Extensions.CommonApi.UserPreferences.Settings;
+using PixiEditor.Extensions.CommonApi.UserPreferences.Settings.PixiEditor;
 using PixiEditor.Models.Handlers;
 using PixiEditor.ViewModels.Dock;
 using PixiEditor.ViewModels.Document;
@@ -91,6 +93,39 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
         }
     }
 
+    private bool autoScaleBackground = true;
+    public bool AutoScaleBackground
+    {
+        get => autoScaleBackground;
+        set
+        {
+            autoScaleBackground = value;
+            OnPropertyChanged(nameof(AutoScaleBackground));
+        }
+    }
+
+    private double customBackgroundScaleX = 16;
+    public double CustomBackgroundScaleX
+    {
+        get => customBackgroundScaleX;
+        set
+        {
+            customBackgroundScaleX = value;
+            OnPropertyChanged(nameof(CustomBackgroundScaleX));
+        }
+    }
+
+    private double customBackgroundScaleY = 16;
+    public double CustomBackgroundScaleY
+    {
+        get => customBackgroundScaleY;
+        set
+        {
+            customBackgroundScaleY = value;
+            OnPropertyChanged(nameof(CustomBackgroundScaleY));
+        }
+    }
+
     private PreviewPainterControl previewPainterControl;
 
     public void IndexChanged()
@@ -106,6 +141,15 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
         Document = document;
         Document.SizeChanged += DocumentOnSizeChanged;
         Document.PropertyChanged += DocumentOnPropertyChanged;
+
+        AutoScaleBackground = PixiEditorSettings.Scene.AutoScaleBackground.Value;
+        CustomBackgroundScaleX = PixiEditorSettings.Scene.CustomBackgroundScaleX.Value;
+        CustomBackgroundScaleY = PixiEditorSettings.Scene.CustomBackgroundScaleY.Value;
+
+        PixiEditorSettings.Scene.AutoScaleBackground.ValueChanged += UpdateAutoScaleBackground;
+        PixiEditorSettings.Scene.CustomBackgroundScaleX.ValueChanged += UpdateCustomBackgroundScaleX;
+        PixiEditorSettings.Scene.CustomBackgroundScaleY.ValueChanged += UpdateCustomBackgroundScaleY;
+
         previewPainterControl = new PreviewPainterControl(Document.PreviewPainter,
             Document.AnimationDataViewModel.ActiveFrameTime.Frame);
         TabCustomizationSettings.Icon = previewPainterControl;
@@ -132,12 +176,6 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
         }
     }
 
-    ~ViewportWindowViewModel()
-    {
-        Document.SizeChanged -= DocumentOnSizeChanged;
-        Document.PropertyChanged -= DocumentOnPropertyChanged;
-    }
-
     private void DocumentOnSizeChanged(object? sender, DocumentSizeChangedEventArgs e)
     {
         previewPainterControl.QueueNextFrame();
@@ -154,6 +192,15 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
                 {
                     _closeRequested =
                         await Owner.OnViewportWindowCloseButtonPressed(this);
+                    if (_closeRequested)
+                    {
+                        Document.SizeChanged -= DocumentOnSizeChanged;
+                        Document.PropertyChanged -= DocumentOnPropertyChanged;
+
+                        PixiEditorSettings.Scene.AutoScaleBackground.ValueChanged -= UpdateAutoScaleBackground;
+                        PixiEditorSettings.Scene.CustomBackgroundScaleX.ValueChanged -= UpdateCustomBackgroundScaleX;
+                        PixiEditorSettings.Scene.CustomBackgroundScaleY.ValueChanged -= UpdateCustomBackgroundScaleY;
+                    }
                 });
             });
         }
@@ -161,6 +208,21 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
         return _closeRequested;
     }
 
+    private void UpdateAutoScaleBackground(Setting<bool> setting, bool newValue)
+    {
+        AutoScaleBackground = newValue;
+    }
+
+    private void UpdateCustomBackgroundScaleX(Setting<double> setting, double newValue)
+    {
+        CustomBackgroundScaleX = newValue;
+    }
+
+    private void UpdateCustomBackgroundScaleY(Setting<double> setting, double newValue)
+    {
+        CustomBackgroundScaleY = newValue;
+    }
+
     private static SavedState GetSaveState(DocumentViewModel document)
     {
         if (document.AllChangesSaved)
@@ -186,4 +248,5 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
     {
         Owner.Owner.ShortcutController.ClearContext(GetType());
     }
+
 }

+ 28 - 0
src/PixiEditor/ViewModels/UserPreferences/Settings/SceneSettings.cs

@@ -0,0 +1,28 @@
+using Drawie.Numerics;
+using PixiEditor.Extensions.CommonApi.UserPreferences;
+
+namespace PixiEditor.ViewModels.UserPreferences.Settings;
+
+internal class SceneSettings : SettingsGroup
+{
+    private bool autoScaleBackground = GetPreference(PreferencesConstants.AutoScaleBackground, PreferencesConstants.AutoScaleBackgroundDefault);
+    public bool AutoScaleBackground
+    {
+        get => autoScaleBackground;
+        set => RaiseAndUpdatePreference(ref autoScaleBackground, value);
+    }
+
+    private double customBackgroundScaleX = GetPreference(PreferencesConstants.CustomBackgroundScaleX, PreferencesConstants.CustomBackgroundScaleDefault);
+    public double CustomBackgroundScaleX
+    {
+        get => customBackgroundScaleX;
+        set => RaiseAndUpdatePreference(ref customBackgroundScaleX, value);
+    }
+
+    private double customBackgroundScaleY = GetPreference(PreferencesConstants.CustomBackgroundScaleY, PreferencesConstants.CustomBackgroundScaleDefault);
+    public double CustomBackgroundScaleY
+    {
+        get => customBackgroundScaleY;
+        set => RaiseAndUpdatePreference(ref customBackgroundScaleY, value);
+    }
+}

+ 2 - 0
src/PixiEditor/ViewModels/UserPreferences/SettingsViewModel.cs

@@ -15,6 +15,8 @@ internal class SettingsViewModel : SubViewModel<SettingsWindowViewModel>
 
     public DiscordSettings Discord { get; set; } = new();
 
+    public SceneSettings Scene { get; set; } = new();
+
     public SettingsViewModel(SettingsWindowViewModel owner)
         : base(owner)
     {

+ 3 - 0
src/PixiEditor/Views/Dock/DocumentTemplate.axaml

@@ -40,6 +40,9 @@
         SnappingEnabled="{Binding ViewportSubViewModel.SnappingEnabled, Source={viewModels1:MainVM}, Mode=TwoWay}"
         AvailableRenderOutputs="{Binding ActiveDocument.NodeGraph.AvailableRenderOutputs, Source={viewModels1:MainVM DocumentManagerSVM}}"
         ViewportRenderOutput="{Binding RenderOutputName, Mode=TwoWay}"
+        AutoBackgroundScale="{Binding AutoScaleBackground, Mode=OneWay}"
+        CustomBackgroundScaleX="{Binding CustomBackgroundScaleX, Mode=OneWay}"
+        CustomBackgroundScaleY="{Binding CustomBackgroundScaleY, Mode=OneWay}"
         HudVisible="{Binding HudVisible}"
         Document="{Binding Document}">
     </viewportControls:Viewport>

+ 5 - 5
src/PixiEditor/Views/Input/SizeInput.axaml.cs

@@ -13,11 +13,11 @@ internal partial class SizeInput : UserControl
     public static readonly StyledProperty<double> SizeProperty =
         AvaloniaProperty.Register<SizeInput, double>(nameof(Size), defaultValue: 1);
 
-    public static readonly StyledProperty<int> MinSizeProperty = AvaloniaProperty.Register<SizeInput, int>(
+    public static readonly StyledProperty<double> MinSizeProperty = AvaloniaProperty.Register<SizeInput, double>(
         nameof(MinSize), defaultValue: 1);
 
-    public static readonly StyledProperty<int> MaxSizeProperty =
-        AvaloniaProperty.Register<SizeInput, int>(nameof(MaxSize), defaultValue: int.MaxValue);
+    public static readonly StyledProperty<double> MaxSizeProperty =
+        AvaloniaProperty.Register<SizeInput, double>(nameof(MaxSize), defaultValue: double.MaxValue);
 
     public static readonly StyledProperty<bool> BehaveLikeSmallEmbeddedFieldProperty =
         AvaloniaProperty.Register<SizeInput, bool>(nameof(BehaveLikeSmallEmbeddedField), defaultValue: true);
@@ -58,13 +58,13 @@ internal partial class SizeInput : UserControl
         set => SetValue(SizeProperty, value);
     }
 
-    public int MinSize
+    public double MinSize
     {
         get => GetValue(MinSizeProperty);
         set => SetValue(MinSizeProperty, value);
     }
 
-    public int MaxSize
+    public double MaxSize
     {
         get => (int)GetValue(MaxSizeProperty);
         set => SetValue(MaxSizeProperty, value);

+ 11 - 6
src/PixiEditor/Views/Main/ViewportControls/Viewport.axaml

@@ -43,9 +43,10 @@
                                         PassEventArgsToCommand="True"/>
             </EventTriggerBehavior>-->
         </Interaction.Behaviors>
-        <overlays:TogglableFlyout IsVisible="{Binding HudVisible, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}}" 
-                                  Margin="5" Icon="{DynamicResource icon-tool}"
-                                  ZIndex="2" HorizontalAlignment="Right" VerticalAlignment="Top">
+        <overlays:TogglableFlyout
+            IsVisible="{Binding HudVisible, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}}"
+            Margin="5" Icon="{DynamicResource icon-tool}"
+            ZIndex="2" HorizontalAlignment="Right" VerticalAlignment="Top">
             <overlays:TogglableFlyout.Child>
                 <Border Padding="5"
                         CornerRadius="{DynamicResource ControlCornerRadius}"
@@ -112,7 +113,7 @@
                                           IsChecked="{Binding FlipX, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=TwoWay}"
                                           Content="{DynamicResource icon-y-flip}"
                                           Cursor="Hand" />
-                            <ToggleButton  Width="32" Height="32"
+                            <ToggleButton Width="32" Height="32"
                                           ui:Translator.TooltipKey="FLIP_VIEWPORT_VERTICALLY"
                                           Classes="OverlayToggleButton pixi-icon"
                                           IsChecked="{Binding FlipY, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=TwoWay}"
@@ -135,7 +136,7 @@
                         </StackPanel>
                         <Separator />
                         <TextBlock HorizontalAlignment="Center"
-                                   ui:Translator.Key="GRIDLINES_SIZE" Margin="0 0 0 10"/>
+                                   ui:Translator.Key="GRIDLINES_SIZE" Margin="0 0 0 10" />
                         <input:NumberInput Min="1"
                                            Max="1024"
                                            Value="{Binding GridLinesXSize, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=TwoWay}" />
@@ -160,7 +161,8 @@
                 </Border>
             </overlays:TogglableFlyout.Child>
         </overlays:TogglableFlyout>
-        <Grid IsVisible="{Binding HudVisible, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}}"
+        <Grid
+            IsVisible="{Binding HudVisible, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}}"
             ZIndex="100" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10">
             <Grid.RowDefinitions>
                 <RowDefinition MinHeight="40" MaxHeight="120" />
@@ -206,6 +208,9 @@
             FadeOut="{Binding Source={viewModels:ToolVM ColorPickerToolViewModel}, Path=PickOnlyFromReferenceLayer, Mode=OneWay}"
             DefaultCursor="{Binding Source={viewModels:MainVM}, Path=ToolsSubViewModel.ToolCursor, Mode=OneWay}"
             RenderOutput="{Binding ViewportRenderOutput, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=OneWay}"
+            AutoBackgroundScale="{Binding AutoBackgroundScale, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=OneWay}"
+            CustomBackgroundScaleX="{Binding CustomBackgroundScaleX, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=OneWay}"
+            CustomBackgroundScaleY="{Binding CustomBackgroundScaleY, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=viewportControls:Viewport}, Mode=OneWay}"
             CheckerImagePath="/Images/CheckerTile.png"
             PointerPressed="Scene_OnContextMenuOpening"
             ui:RenderOptionsBindable.BitmapInterpolationMode="{Binding Scale, Converter={converters:ScaleToBitmapScalingModeConverter}, RelativeSource={RelativeSource Self}}">

+ 26 - 0
src/PixiEditor/Views/Main/ViewportControls/Viewport.axaml.cs

@@ -114,6 +114,32 @@ internal partial class Viewport : UserControl, INotifyPropertyChanged
     public static readonly StyledProperty<bool> HighResPreviewProperty =
         AvaloniaProperty.Register<Viewport, bool>(nameof(HighResPreview), true);
 
+    public static readonly StyledProperty<bool> AutoBackgroundScaleProperty = AvaloniaProperty.Register<Viewport, bool>(
+        nameof(AutoBackgroundScale), true);
+
+    public static readonly StyledProperty<double> CustomBackgroundScaleXProperty = AvaloniaProperty.Register<Viewport, double>(
+        nameof(CustomBackgroundScaleX));
+
+    public static readonly StyledProperty<double> CustomBackgroundScaleYProperty = AvaloniaProperty.Register<Viewport, double>(
+        nameof(CustomBackgroundScaleY));
+
+    public double CustomBackgroundScaleY
+    {
+        get => GetValue(CustomBackgroundScaleYProperty);
+        set => SetValue(CustomBackgroundScaleYProperty, value);
+    }
+    public double CustomBackgroundScaleX
+    {
+        get => GetValue(CustomBackgroundScaleXProperty);
+        set => SetValue(CustomBackgroundScaleXProperty, value);
+    }
+
+    public bool AutoBackgroundScale
+    {
+        get => GetValue(AutoBackgroundScaleProperty);
+        set => SetValue(AutoBackgroundScaleProperty, value);
+    }
+
     public SnappingViewModel SnappingViewModel
     {
         get => GetValue(SnappingViewModelProperty);

+ 37 - 4
src/PixiEditor/Views/Rendering/Scene.cs

@@ -65,6 +65,33 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
         AvaloniaProperty.Register<Scene, SceneRenderer>(
             nameof(SceneRenderer));
 
+    public static readonly StyledProperty<bool> AutoBackgroundScaleProperty = AvaloniaProperty.Register<Scene, bool>(
+        nameof(AutoBackgroundScale), true);
+
+    public bool AutoBackgroundScale
+    {
+        get => GetValue(AutoBackgroundScaleProperty);
+        set => SetValue(AutoBackgroundScaleProperty, value);
+    }
+
+    public static readonly StyledProperty<double> CustomBackgroundScaleXProperty = AvaloniaProperty.Register<Scene, double>(
+        nameof(CustomBackgroundScaleX));
+
+    public double CustomBackgroundScaleX
+    {
+        get => GetValue(CustomBackgroundScaleXProperty);
+        set => SetValue(CustomBackgroundScaleXProperty, value);
+    }
+
+    public static readonly StyledProperty<double> CustomBackgroundScaleYProperty = AvaloniaProperty.Register<Scene, double>(
+        nameof(CustomBackgroundScaleY));
+
+    public double CustomBackgroundScaleY
+    {
+        get => GetValue(CustomBackgroundScaleYProperty);
+        set => SetValue(CustomBackgroundScaleYProperty, value);
+    }
+
     public SceneRenderer SceneRenderer
     {
         get => GetValue(SceneRendererProperty);
@@ -113,7 +140,6 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
         set { SetValue(RenderOutputProperty, value); }
     }
 
-
     private Bitmap? checkerBitmap;
 
     private Overlay? capturedOverlay;
@@ -150,7 +176,8 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
     {
         AffectsRender<Scene>(BoundsProperty, WidthProperty, HeightProperty, ScaleProperty, AngleRadiansProperty,
             FlipXProperty,
-            FlipYProperty, DocumentProperty, AllOverlaysProperty, ContentDimensionsProperty);
+            FlipYProperty, DocumentProperty, AllOverlaysProperty, ContentDimensionsProperty,
+            AutoBackgroundScaleProperty, CustomBackgroundScaleXProperty, CustomBackgroundScaleYProperty);
 
         FadeOutProperty.Changed.AddClassHandler<Scene>(FadeOutChanged);
         CheckerImagePathProperty.Changed.AddClassHandler<Scene>(CheckerImagePathChanged);
@@ -160,6 +187,9 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
         DocumentProperty.Changed.AddClassHandler<Scene>(DocumentChanged);
         FlipXProperty.Changed.AddClassHandler<Scene>(Refresh);
         FlipYProperty.Changed.AddClassHandler<Scene>(Refresh);
+        AutoBackgroundScaleProperty.Changed.AddClassHandler<Scene>(Refresh);
+        CustomBackgroundScaleXProperty.Changed.AddClassHandler<Scene>(Refresh);
+        CustomBackgroundScaleYProperty.Changed.AddClassHandler<Scene>(Refresh);
     }
 
     private static void Refresh(Scene scene, AvaloniaPropertyChangedEventArgs args)
@@ -279,7 +309,10 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
         if (checkerBitmap == null) return;
 
         RectD operationSurfaceRectToRender = new RectD(0, 0, dirtyBounds.Width, dirtyBounds.Height);
-        float checkerScale = (float)ZoomToViewportConverter.ZoomToViewport(16, Scale) * 0.5f;
+        VecD checkerScale = AutoBackgroundScale
+            ? new VecD(ZoomToViewportConverter.ZoomToViewport(16, Scale) * 0.5f)
+            : new VecD(CustomBackgroundScaleX, CustomBackgroundScaleY);
+        checkerScale = new VecD(Math.Max(0.5, checkerScale.X), Math.Max(0.5, checkerScale.Y));
         checkerPaint?.Shader?.Dispose();
         checkerPaint?.Dispose();
         checkerPaint = new Paint
@@ -287,7 +320,7 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
             Shader = Shader.CreateBitmap(
                 checkerBitmap,
                 TileMode.Repeat, TileMode.Repeat,
-                Matrix3X3.CreateScale(checkerScale, checkerScale)),
+                Matrix3X3.CreateScale((float)checkerScale.X, (float)checkerScale.Y)),
             FilterQuality = FilterQuality.None
         };
 

+ 74 - 30
src/PixiEditor/Views/Windows/Settings/SettingsWindow.axaml

@@ -192,36 +192,6 @@
                                       IsChecked="{Binding SettingsSubViewModel.Tools.EnableSharedToolbar}"
                                       ui:Translator.Key="ENABLE_SHARED_TOOLBAR" />
 
-                            <TextBlock ui:Translator.Key="AUTOMATIC_UPDATES" Classes="h5" />
-
-                            <CheckBox
-                                VerticalAlignment="Center"
-                                IsEnabled="{Binding Path=ShowUpdateTab}"
-                                IsChecked="{Binding SettingsSubViewModel.Update.CheckUpdatesOnStartup}"
-                                ui:Translator.Key="CHECK_FOR_UPDATES"
-                                Classes="leftOffset" />
-
-                            <StackPanel Orientation="Horizontal" Classes="leftOffset">
-                                <Label Target="updateStreamComboBox" ui:Translator.Key="UPDATE_STREAM"
-                                       VerticalAlignment="Center" />
-                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
-                                            HorizontalAlignment="Left">
-                                    <ComboBox Width="110"
-                                              Name="updateStreamComboBox"
-                                              VerticalAlignment="Center"
-                                              IsEnabled="{Binding Path=ShowUpdateTab}"
-                                              ItemsSource="{Binding SettingsSubViewModel.Update.UpdateChannels}"
-                                              SelectedValue="{Binding SettingsSubViewModel.Update.UpdateChannelName}" />
-                                    <Image Cursor="Help"
-                                           Source="/Images/Commands/PixiEditor/Links/OpenDocumentation.png"
-                                           VerticalAlignment="Center"
-                                           ToolTip.ShowDelay="0"
-                                           IsVisible="{Binding !ShowUpdateTab}"
-                                           ui:Translator.TooltipKey="UPDATE_CHANNEL_HELP_TOOLTIP" />
-                                    <!-- ToolTipService.InitialShowDelay="0"-->
-                                </StackPanel>
-                            </StackPanel>
-
                             <TextBlock ui:Translator.Key="DEBUG" Classes="h5" />
                             <CheckBox Classes="leftOffset"
                                       IsChecked="{Binding SettingsSubViewModel.General.IsDebugModeEnabled}"
@@ -329,6 +299,49 @@
                             </Binding>
                         </ScrollViewer.IsVisible>
                         <!--Background="{StaticResource AccentColor}"-->
+                        <controls:FixedSizeStackPanel Orientation="Vertical" ChildSize="32"
+                                                      VerticalChildrenAlignment="Center" Margin="12">
+                            <TextBlock ui:Translator.Key="AUTOMATIC_UPDATES" Classes="h5" />
+
+                            <CheckBox
+                                VerticalAlignment="Center"
+                                IsEnabled="{Binding Path=ShowUpdateTab}"
+                                IsChecked="{Binding SettingsSubViewModel.Update.CheckUpdatesOnStartup}"
+                                ui:Translator.Key="CHECK_FOR_UPDATES"
+                                Classes="leftOffset" />
+
+                            <StackPanel Orientation="Horizontal" Classes="leftOffset">
+                                <Label Target="updateStreamComboBox" ui:Translator.Key="UPDATE_STREAM"
+                                       VerticalAlignment="Center" />
+                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+                                            HorizontalAlignment="Left">
+                                    <ComboBox Width="110"
+                                              Name="updateStreamComboBox"
+                                              VerticalAlignment="Center"
+                                              IsEnabled="{Binding Path=ShowUpdateTab}"
+                                              ItemsSource="{Binding SettingsSubViewModel.Update.UpdateChannels}"
+                                              SelectedValue="{Binding SettingsSubViewModel.Update.UpdateChannelName}" />
+                                    <Image Cursor="Help"
+                                           Source="/Images/Commands/PixiEditor/Links/OpenDocumentation.png"
+                                           VerticalAlignment="Center"
+                                           ToolTip.ShowDelay="0"
+                                           IsVisible="{Binding !ShowUpdateTab}"
+                                           ui:Translator.TooltipKey="UPDATE_CHANNEL_HELP_TOOLTIP" />
+                                    <!-- ToolTipService.InitialShowDelay="0"-->
+                                </StackPanel>
+                            </StackPanel>
+                        </controls:FixedSizeStackPanel>
+                    </ScrollViewer>
+
+                    <ScrollViewer>
+                        <ScrollViewer.IsVisible>
+                            <Binding Path="CurrentPage" Converter="{converters:IsEqualConverter}">
+                                <Binding.ConverterParameter>
+                                    <sys:Int32>4</sys:Int32>
+                                </Binding.ConverterParameter>
+                            </Binding>
+                        </ScrollViewer.IsVisible>
+                        <!--Background="{StaticResource AccentColor}"-->
                         <controls:FixedSizeStackPanel Orientation="Vertical" ChildSize="32"
                                                       VerticalChildrenAlignment="Center" Margin="12">
 
@@ -337,6 +350,37 @@
                                       IsChecked="{Binding SettingsSubViewModel.File.OpenDirectoryOnExport}" />
                         </controls:FixedSizeStackPanel>
                     </ScrollViewer>
+                    <ScrollViewer>
+                        <ScrollViewer.IsVisible>
+                            <Binding Path="CurrentPage" Converter="{converters:IsEqualConverter}">
+                                <Binding.ConverterParameter>
+                                    <sys:Int32>5</sys:Int32>
+                                </Binding.ConverterParameter>
+                            </Binding>
+                        </ScrollViewer.IsVisible>
+                        <!--Background="{StaticResource AccentColor}"-->
+                        <controls:FixedSizeStackPanel Orientation="Vertical" ChildSize="32"
+                                                      VerticalChildrenAlignment="Center" Margin="12">
+
+                            <TextBlock ui:Translator.Key="BACKGROUND" Classes="h4" />
+
+                            <CheckBox Classes="leftOffset" Width="200" HorizontalAlignment="Left"
+                                      ui:Translator.Key="AUTO_SCALE_BACKGROUND"
+                                      IsChecked="{Binding SettingsSubViewModel.Scene.AutoScaleBackground}" />
+
+                            <TextBlock ui:Translator.Key="CUSTOM_BACKGROUND_SCALE" Classes="h5" />
+                            <StackPanel Spacing="5" Orientation="Horizontal" Classes="leftOffset">
+                                <Label Content="X" />
+                                <input:SizeInput MinSize="0.5" Decimals="1"
+                                                 Size="{Binding SettingsSubViewModel.Scene.CustomBackgroundScaleX, Mode=TwoWay}"
+                                                 HorizontalAlignment="Left" />
+                                <Label Content="Y" />
+                                <input:SizeInput MinSize="0.5" Decimals="1"
+                                                 Size="{Binding SettingsSubViewModel.Scene.CustomBackgroundScaleY, Mode=TwoWay}"
+                                                 HorizontalAlignment="Left" />
+                            </StackPanel>
+                        </controls:FixedSizeStackPanel>
+                    </ScrollViewer>
                 </Grid>
             </Border>
         </DockPanel>