Browse Source

Removed unnecessary pngs

flabbet 1 year ago
parent
commit
e044ec90ed
21 changed files with 33 additions and 3 deletions
  1. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/AddToMask.png
  2. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/Clear.png
  3. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/CropToSelection.png
  4. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/IntersectSelectionMask.png
  5. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/InvertSelection.png
  6. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/NewToMask.png
  7. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/SelectAll.png
  8. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/SubtractFromMask.png
  9. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/View/ToggleGrid.png
  10. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/View/ZoomIn.png
  11. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/View/ZoomOut.png
  12. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenAboutWindow.png
  13. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenNavigationWindow.png
  14. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenSettingsWindow.png
  15. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenShortcutWindow.png
  16. BIN
      src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenStartupWindow.png
  17. BIN
      src/PixiEditor.AvaloniaUI/Images/Load.png
  18. BIN
      src/PixiEditor.AvaloniaUI/Images/Placeholder.png
  19. 3 2
      src/PixiEditor.AvaloniaUI/ViewModels/SubViewModels/LayersViewModel.cs
  20. 7 0
      src/PixiEditor.UI.Common/Fonts/PixiPerfectIcons.axaml.cs
  21. 23 1
      src/PixiEditor.UI.Common/Rendering/IconImage.cs

BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/AddToMask.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/Clear.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/CropToSelection.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/IntersectSelectionMask.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/InvertSelection.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/NewToMask.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/SelectAll.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Selection/SubtractFromMask.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/View/ToggleGrid.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/View/ZoomIn.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/View/ZoomOut.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenAboutWindow.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenNavigationWindow.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenSettingsWindow.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenShortcutWindow.png


BIN
src/PixiEditor.AvaloniaUI/Images/Commands/PixiEditor/Window/OpenStartupWindow.png


BIN
src/PixiEditor.AvaloniaUI/Images/Load.png


BIN
src/PixiEditor.AvaloniaUI/Images/Placeholder.png


+ 3 - 2
src/PixiEditor.AvaloniaUI/ViewModels/SubViewModels/LayersViewModel.cs

@@ -447,9 +447,10 @@ internal class LayersViewModel : SubViewModel<ViewModelMain>
         var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
         var doc = Owner.DocumentManagerSubViewModel.ActiveDocument;
         if (doc is null || doc.ReferenceLayerViewModel.IsTopMost)
         if (doc is null || doc.ReferenceLayerViewModel.IsTopMost)
         {
         {
-            return ImagePathToBitmapConverter.LoadBitmapFromRelativePath("/Images/ReferenceLayerBelow.png");
+            
+            return PixiPerfectIcons.ToIcon(PixiPerfectIcons.ReferenceLayer);
         }
         }
 
 
-        return ImagePathToBitmapConverter.LoadBitmapFromRelativePath("/Images/ReferenceLayerAbove.png");
+        return PixiPerfectIcons.ToIcon(PixiPerfectIcons.ReferenceLayer, 18, 180);
     }
     }
 }
 }

+ 7 - 0
src/PixiEditor.UI.Common/Fonts/PixiPerfectIcons.axaml.cs

@@ -131,4 +131,11 @@ public static class PixiPerfectIcons
 
 
         return new IconImage(unicode, pixiPerfectFontFamily, size, Colors.White);
         return new IconImage(unicode, pixiPerfectFontFamily, size, Colors.White);
     }
     }
+    
+    public static IImage ToIcon(string unicode, double size, double rotation)
+    {
+        if(string.IsNullOrEmpty(unicode)) return null;
+
+        return new IconImage(unicode, pixiPerfectFontFamily, size, Colors.White, rotation);
+    }
 }
 }

+ 23 - 1
src/PixiEditor.UI.Common/Rendering/IconImage.cs

@@ -13,8 +13,11 @@ public class IconImage : IImage
     public SolidColorBrush Foreground { get; }
     public SolidColorBrush Foreground { get; }
     public Size Size { get; }
     public Size Size { get; }
     
     
+    public double RotationAngle { get; }
+    
     private Typeface _typeface;
     private Typeface _typeface;
     
     
+    
     public IconImage(string icon, FontFamily fontFamily, double fontSize, Color foreground)
     public IconImage(string icon, FontFamily fontFamily, double fontSize, Color foreground)
     {
     {
         Icon = icon;
         Icon = icon;
@@ -24,9 +27,28 @@ public class IconImage : IImage
         _typeface = new Typeface(FontFamily);
         _typeface = new Typeface(FontFamily);
         Size = new Size(FontSize, FontSize);
         Size = new Size(FontSize, FontSize);
     }
     }
-    
+
+    public IconImage(string unicode, FontFamily fontFamily, double fontSize, Color foreground, double rotationAngle)
+    {
+        Icon = unicode;
+        FontFamily = fontFamily;
+        FontSize = fontSize;
+        Foreground = new SolidColorBrush(foreground);
+        _typeface = new Typeface(FontFamily);
+        Size = new Size(FontSize, FontSize);
+        RotationAngle = rotationAngle;
+    }
+
     public void Draw(DrawingContext context, Rect sourceRect, Rect destRect)
     public void Draw(DrawingContext context, Rect sourceRect, Rect destRect)
     {
     {
+        if (RotationAngle != 0)
+        {
+            double radians = RotationAngle * Math.PI / 180;
+            context.PushTransform(Matrix.CreateTranslation(destRect.Width, destRect.Height));
+            context.PushTransform(Matrix.CreateRotation(radians));
+            context.PushTransform(Matrix.CreateTranslation(destRect.Width / 4f, destRect.Height / 4f));
+        }
+        
         context.DrawText(
         context.DrawText(
             new FormattedText(Icon, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, _typeface, FontSize, Foreground),
             new FormattedText(Icon, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, _typeface, FontSize, Foreground),
             destRect.TopLeft);
             destRect.TopLeft);