Kaynağa Gözat

Removed a thing from palette browser

Krzysztof Krysiński 2 yıl önce
ebeveyn
işleme
7bcd00bd68

+ 0 - 1
src/PixiEditor.Extensions/Common/UserPreferences/PreferencesConstants.cs

@@ -7,5 +7,4 @@ public static class PreferencesConstants
 
     public const string MaxOpenedRecently = "MaxOpenedRecently";
     public const int MaxOpenedRecentlyDefault = 8;
-    public const string HideBuySupporterPackText = "HideBuySupporterPackText";
 }

+ 2 - 18
src/PixiEditor/Views/Dialogs/PalettesBrowser.xaml

@@ -141,23 +141,8 @@
                 <Image Width="128" Height="128" Source="/Images/Search.png"/>
             </StackPanel>
             <ScrollViewer x:Name="scrollViewer" Margin="5" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" ScrollChanged="ScrollViewer_ScrollChanged">
-                <StackPanel Orientation="Vertical">
-                    <Border Visibility="{Binding ElementName=palettesBrowser, Path=ShowBuyText, Converter={converters:BoolToVisibilityConverter}}"
-                            Margin="0 0 0 5" Padding="5" Background="{StaticResource MainColor}" CornerRadius="5">
-                        <DockPanel>
-                            <TextBlock FontSize="14" VerticalAlignment="Center" DockPanel.Dock="Left" ui:Translator.Key="PALETTE_BROWSER_BUY_TEXT" Foreground="White"/>
-                            <Button Cursor="Hand" Margin="5 0" DockPanel.Dock="Right" HorizontalAlignment="Right" Content="&#x2715;"
-                                    Click="HideBuyText_OnClick"
-                                    Style="{StaticResource ImageButtonStyle}" VerticalAlignment="Center"
-                                    Padding="0" Background="Transparent" Foreground="White" BorderThickness="0" FontSize="18"/>
-                            <Button DockPanel.Dock="Right" Margin="10 0" HorizontalAlignment="Left" ui:Translator.Key="BUY_NOW"
-                                    Background="{StaticResource AccentRed}"
-                                    Command="{xaml:Command PixiEditor.Links.OpenHyperlink, UseProvided=True}" CommandParameter="https://store.steampowered.com/app/2435860/PixiEditor__Supporter_Pack/"
-                                    Style="{StaticResource DarkRoundButton}"/>
-                        </DockPanel>
-                    </Border>
-                    <ItemsControl x:Name="itemsControl" ItemsSource="{Binding SortedResults, ElementName=palettesBrowser}"
-                                  Visibility="{Binding PaletteList.FetchedCorrectly, Converter={StaticResource BoolToVisibilityConverter}, ElementName=palettesBrowser}">
+                <ItemsControl x:Name="itemsControl" ItemsSource="{Binding SortedResults, ElementName=palettesBrowser}"
+                              Visibility="{Binding PaletteList.FetchedCorrectly, Converter={StaticResource BoolToVisibilityConverter}, ElementName=palettesBrowser}">
                     <ItemsControl.ItemTemplate>
                         <DataTemplate>
                             <local:PaletteItem Palette="{Binding}"
@@ -168,7 +153,6 @@
                         </DataTemplate>
                     </ItemsControl.ItemTemplate>
                 </ItemsControl>
-                </StackPanel>
             </ScrollViewer>
             <Image gif:ImageBehavior.AnimatedSource="/Images/Processing.gif" HorizontalAlignment="Center" VerticalAlignment="Center"
                    Visibility="{Binding IsFetching, Converter={StaticResource BoolToVisibilityConverter}, ElementName=palettesBrowser}"

+ 0 - 29
src/PixiEditor/Views/Dialogs/PalettesBrowser.xaml.cs

@@ -147,17 +147,6 @@ internal partial class PalettesBrowser : Window, IPopupWindow
         set { SetValue(PaletteProviderProperty, value); }
     }
     public RelayCommand<Palette> ToggleFavouriteCommand { get; set; }
-
-    public static readonly DependencyProperty ShowBuyTextProperty = DependencyProperty.Register(
-        nameof(ShowBuyText), typeof(bool), typeof(PalettesBrowser),
-        new PropertyMetadata(!IPreferences.Current.GetPreference(PreferencesConstants.HideBuySupporterPackText, false)));
-
-    public bool ShowBuyText
-    {
-        get { return (bool)GetValue(ShowBuyTextProperty); }
-        set { SetValue(ShowBuyTextProperty, value); }
-    }
-
     public int SortingIndex { get; set; } = 0;
     public ColorsNumberMode ColorsNumberMode { get; set; } = ColorsNumberMode.Any;
 
@@ -191,18 +180,6 @@ internal partial class PalettesBrowser : Window, IPopupWindow
         InitializeComponent();
         Title = new LocalizedString("PALETTE_BROWSER");
         Instance = this;
-        if (IPlatform.Current?.AdditionalContentProvider != null)
-        {
-            ShowBuyText =
-                IPlatform.Current.AdditionalContentProvider.PlatformHasContent(AdditionalContentProduct.SupporterPack) &&
-                !IPlatform.Current.AdditionalContentProvider.IsContentInstalled(AdditionalContentProduct
-                    .SupporterPack) &&
-                !IPreferences.Current.GetPreference(PreferencesConstants.HideBuySupporterPackText, false);
-        }
-        else
-        {
-            ShowBuyText = false;
-        }
 
         DeletePaletteCommand = new RelayCommand<Palette>(DeletePalette, CanDeletePalette);
         ToggleFavouriteCommand = new RelayCommand<Palette>(ToggleFavourite, CanToggleFavourite);
@@ -677,10 +654,4 @@ internal partial class PalettesBrowser : Window, IPopupWindow
 
         IPreferences.Current.RemoveCallback(PreferencesConstants.FavouritePalettes, OnFavouritePalettesChanged);
     }
-
-    private void HideBuyText_OnClick(object sender, RoutedEventArgs e)
-    {
-        IPreferences.Current.UpdatePreference(PreferencesConstants.HideBuySupporterPackText, true);
-        ShowBuyText = false;
-    }
 }