Browse Source

Fix warnings, remove 'u' from 'favourites' cause 'u' is british

Equbuxu 3 years ago
parent
commit
9a3df54b22

+ 1 - 1
PixiEditor/Views/Dialogs/PalettesBrowser.xaml

@@ -83,7 +83,7 @@
                                    FocusNext="True"
                                    Value="{Binding ColorsNumber, ElementName=palettesBrowser, Mode=TwoWay}"/>
                 <CheckBox Margin="10 0 0 0" VerticalAlignment="Center"
-                          IsChecked="{Binding ShowOnlyFavourites, ElementName=palettesBrowser}" Content="Favourites"/>
+                          IsChecked="{Binding ShowOnlyFavourites, ElementName=palettesBrowser}" Content="Favorites"/>
             </StackPanel>
             <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 10 0">
                 <Button ToolTip="Add from current palette" Click="AddFromPalette_OnClick" Cursor="Hand" Margin="10 0" Style="{StaticResource ImageButtonStyle}" Width="24" Height="24">

+ 12 - 12
PixiEditor/Views/Dialogs/PalettesBrowser.xaml.cs

@@ -27,6 +27,12 @@ namespace PixiEditor.Views.Dialogs
     {
         private const int ItemsPerLoad = 10;
 
+        private readonly string[] stopItTexts = new[]
+        {
+            "That's enough. Tidy up your file names.",
+            "Can you stop copying these names please?", "No, really, stop it.", "Don't you have anything better to do?"
+        };
+
         public PaletteList PaletteList
         {
             get => (PaletteList)GetValue(PaletteListProperty);
@@ -146,12 +152,6 @@ namespace PixiEditor.Views.Dialogs
 
         private LocalPalettesFetcher localPalettesFetcher;
 
-        private readonly string[] stopItTexts = new[]
-        {
-            "That's enough. Tidy up your file names.",
-            "Can you stop copying these names please?", "No, really, stop it.", "Don't you have anything better to do?"
-        };
-
         public PalettesBrowser()
         {
             InitializeComponent();
@@ -237,7 +237,7 @@ namespace PixiEditor.Views.Dialogs
         private void HandleCacheItemUpdated(Palette updatedItem)
         {
             var item = SortedResults.FirstOrDefault(x => x.FileName == updatedItem.FileName);
-            if (item is null) 
+            if (item is null)
                 return;
 
             item.Name = updatedItem.Name;
@@ -280,7 +280,7 @@ namespace PixiEditor.Views.Dialogs
             {
                 if (ConfirmationDialog.Show("Are you sure you want to delete this palette? This cannot be undone.", "Warning!") == ConfirmationType.Yes)
                 {
-                    LocalPalettesFetcher.DeletePalette(palette.FileName);
+                    _ = LocalPalettesFetcher.DeletePalette(palette.FileName);
                     RemoveFavouritePalette(palette);
                 }
             }
@@ -479,7 +479,7 @@ namespace PixiEditor.Views.Dialogs
 
         private async void AddFromPalette_OnClick(object sender, RoutedEventArgs e)
         {
-            if (CurrentEditingPalette?.Count == 0) 
+            if (CurrentEditingPalette?.Count == 0)
                 return;
 
             string finalFileName = LocalPalettesFetcher.GetNonExistingName("Unnamed Palette.pal", true);
@@ -490,12 +490,12 @@ namespace PixiEditor.Views.Dialogs
         {
             PaletteItem item = (PaletteItem)sender;
             item.Palette.Name = e.OldText;
-            
+
             if (string.IsNullOrWhiteSpace(e.NewText) || e.NewText == item.Palette.Name || e.NewText.Length > 50)
                 return;
 
             string oldFileName = $"{e.OldText}.pal";
-            
+
             string finalNewName = LocalPalettesFetcher.GetNonExistingName($"{Palette.ReplaceInvalidChars(e.NewText)}.pal", true);
             string newPath = Path.Join(LocalPalettesFetcher.PathToPalettesFolder, finalNewName);
 
@@ -504,7 +504,7 @@ namespace PixiEditor.Views.Dialogs
                 NoticeDialog.Show(stopItTexts[Random.Shared.Next(stopItTexts.Length - 1)], "The name is too long.");
                 return;
             }
-            
+
             LocalPalettesFetcher.RenamePalette(oldFileName, finalNewName);
         }