Skip to content

Commit

Permalink
added one more poster Icon, best suited for artworks or horizontal im…
Browse files Browse the repository at this point in the history
…ages.
  • Loading branch information
DineshSolanki committed Aug 9, 2021
1 parent bc1ea9d commit e693d24
Show file tree
Hide file tree
Showing 16 changed files with 112 additions and 18 deletions.
2 changes: 2 additions & 0 deletions FoliCon/FoliCon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dineshsolanki.github.io/folicon/</Description>
<None Remove="Resources\folicon Icon.png" />
<None Remove="Resources\LoadingPosterImage.png" />
<None Remove="Resources\mockup cover cropped.png" />
<None Remove="Resources\mockup faelpessoal base horizontal.png" />
<None Remove="Resources\Mockup faelpessoal base.png" />
<None Remove="Resources\mockup faelpessoal front.png" />
<None Remove="Resources\mockup liaher base.png" />
Expand Down Expand Up @@ -57,6 +58,7 @@ dineshsolanki.github.io/folicon/</Description>
<PackageReference Include="WinCopies.IconLib" Version="0.75.0-rc" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\mockup faelpessoal base horizontal.png" />
<Resource Include="Resources\PosterIconFaelpessoal 2.ico" />
<Resource Include="Resources\PosterIconFaelpessoalHorizontal2.ico" />
<Resource Include="Resources\PosterIconFaelpessoal.ico" />
Expand Down
1 change: 1 addition & 0 deletions FoliCon/Models/GlobalVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static IconOverlay IconOverlayType()
"Alternate" => IconOverlay.Alternate,
"Liaher" => IconOverlay.Liaher,
"Faelpessoal" => IconOverlay.Faelpessoal,
"FaelpessoalHorizontal" => IconOverlay.FaelpessoalHorizontal,
_ => IconOverlay.Alternate
};
}
Expand Down
3 changes: 2 additions & 1 deletion FoliCon/Models/IconOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum IconOverlay
Legacy,
Alternate,
Liaher,
Faelpessoal
Faelpessoal,
FaelpessoalHorizontal
}
}
6 changes: 6 additions & 0 deletions FoliCon/Modules/LangProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ private void UpdateLangs()
OnPropertyChanged(nameof(DeleteMediaInfoConfirmation));
OnPropertyChanged(nameof(ConfirmMediaInfoDeletion));
OnPropertyChanged(nameof(PosterIconOverlay));
OnPropertyChanged(nameof(SelectPosterIconOverlay));
OnPropertyChanged(nameof(BestSuitedForHorizontal));
}

public string About => Lang.About;
Expand Down Expand Up @@ -421,6 +423,8 @@ private void UpdateLangs()
public string DeleteMediaInfoTooltip => Lang.DeleteMediaInfoTooltip;
public string DeleteMediaInfo => Lang.DeleteMediaInfo;
public string PosterIconOverlay => Lang.PosterIconOverlay;
public string SelectPosterIconOverlay => Lang.SelectPosterIconOverlay;
public string BestSuitedForHorizontal => Lang.BestSuitedForHorizontal;


public event PropertyChangedEventHandler PropertyChanged;
Expand Down Expand Up @@ -685,5 +689,7 @@ public class LangKeys
public static string DeleteMediaInfoTooltip = nameof(DeleteMediaInfoTooltip);
public static string DeleteMediaInfo = nameof(DeleteMediaInfo);
public static string PosterIconOverlay = nameof(PosterIconOverlay);
public static string SelectPosterIconOverlay = nameof(SelectPosterIconOverlay);
public static string BestSuitedForHorizontal = nameof(BestSuitedForHorizontal);
}
}
3 changes: 3 additions & 0 deletions FoliCon/Modules/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ public static void BuildFolderIco(string iconMode, string filmFolderPath, string
IconOverlay.Faelpessoal => StaTask.Start(() => new PosterIconFaelpessoal(new PosterIcon(
filmFolderPath, rating,
ratingVisibility, mockupVisibility, mediaTitle)).RenderToBitmap()),
IconOverlay.FaelpessoalHorizontal => StaTask.Start(() => new PosterIconFaelpessoalHorizontal(new PosterIcon(
filmFolderPath, rating,
ratingVisibility, mockupVisibility, mediaTitle)).RenderToBitmap()),
_ => StaTask.Start(() =>
new Views.PosterIcon(new PosterIcon(filmFolderPath, rating, ratingVisibility, mockupVisibility))
.RenderToBitmap())
Expand Down
18 changes: 18 additions & 0 deletions FoliCon/Properties/Langs/Lang.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions FoliCon/Properties/Langs/Lang.ar.resx
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,10 @@
<data name="PosterIconOverlay" xml:space="preserve">
<value>تراكب أيقونة الملصق</value>
</data>
<data name="BestSuitedForHorizontal" xml:space="preserve">
<value>الأنسب للصور الأفقية ، مثل الأعمال الفنية للعبة.</value>
</data>
<data name="SelectPosterIconOverlay" xml:space="preserve">
<value>حدد تراكب أيقونة الملصق</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FoliCon/Properties/Langs/Lang.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,10 @@ Esto ayuda a folicon a identificar los medios sin tener que elegir entre título
<data name="PosterIconOverlay" xml:space="preserve">
<value>Superposición de icono de póster</value>
</data>
<data name="BestSuitedForHorizontal" xml:space="preserve">
<value>Más adecuado para imágenes horizontales, como obras de arte de juegos.</value>
</data>
<data name="SelectPosterIconOverlay" xml:space="preserve">
<value>Seleccionar superposición de icono de póster</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FoliCon/Properties/Langs/Lang.hi.resx
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,10 @@
<data name="PosterIconOverlay" xml:space="preserve">
<value>पोस्टर आइकन ओवरले</value>
</data>
<data name="BestSuitedForHorizontal" xml:space="preserve">
<value>क्षैतिज छवियों के लिए सबसे उपयुक्त, जैसे कि गेम आर्टवर्क।</value>
</data>
<data name="SelectPosterIconOverlay" xml:space="preserve">
<value>पोस्टर आइकन ओवरले का चयन करें</value>
</data>
</root>
6 changes: 6 additions & 0 deletions FoliCon/Properties/Langs/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
<data name="Auto" xml:space="preserve">
<value>Auto (Movies &amp; TV Shows)</value>
</data>
<data name="BestSuitedForHorizontal" xml:space="preserve">
<value>Best suited for horizontal images, such as game artworks.</value>
</data>
<data name="BrowseFolderDropHere" xml:space="preserve">
<value>Browse Folder/Drop here</value>
</data>
Expand Down Expand Up @@ -451,6 +454,9 @@ and refresh Icon Cache?</value>
<data name="SelectIconsDirectory" xml:space="preserve">
<value>Select Icons Directory</value>
</data>
<data name="SelectPosterIconOverlay" xml:space="preserve">
<value>Select Poster Icon overlay</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Settings</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions FoliCon/Properties/Langs/Lang.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,10 @@
<data name="PosterIconOverlay" xml:space="preserve">
<value>Наложение значка плаката</value>
</data>
<data name="BestSuitedForHorizontal" xml:space="preserve">
<value>Лучше всего подходит для горизонтальных изображений, таких как игровые иллюстрации.</value>
</data>
<data name="SelectPosterIconOverlay" xml:space="preserve">
<value>Выберите наложение значка плаката</value>
</data>
</root>
Binary file modified FoliCon/Resources/mockup faelpessoal base horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions FoliCon/ViewModels/posterIconConfigViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Prism.Services.Dialogs;
using System;
using System.Globalization;
using FoliCon.Properties.Langs;

namespace FoliCon.ViewModels
{
Expand All @@ -17,7 +18,7 @@ public PosterIconConfigViewModel()
.Property(p => p.IconOverlay, defaultValue: "Alternate")
.PersistOn(nameof(PropertyChanged));
Services.Tracker.Track(this);
IconOverlayChangedCommand = new DelegateCommand<object>(delegate (object parameter)
IconOverlayChangedCommand = new DelegateCommand<object>(delegate(object parameter)
{
IconOverlay = (string)parameter;
});
Expand All @@ -29,7 +30,7 @@ public string IconOverlay
set => SetProperty(ref _iconOverlay, value);
}

public string Title => "Select Poster Icon overlay";
public string Title => LangProvider.GetLang("SelectPosterIconOverlay");

#region DialogMethods

Expand Down
2 changes: 1 addition & 1 deletion FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ImageBrush Stretch="Fill" ImageSource="{Binding FolderJpg}" />
</Border.Background>
</Border>

<TextBlock Text="{Binding MediaTitle}" TextWrapping="Wrap" Foreground="White" FontFamily="Cormorant" TextTrimming="WordEllipsis" Margin="28,36,155,197"/>
<!--<Image Stretch="Fill" Source="{Binding FolderJpg}" RenderOptions.BitmapScalingMode="HighQuality" Grid.Row="0" Margin="34,10,42,21" />-->
<Image Source="/Resources/mockup faelpessoal front horizontal.png" RenderOptions.BitmapScalingMode="HighQuality" Margin="0,-4,8,9" Visibility="{Binding MockupVisibility}"/>
<Grid Grid.Row="0">
Expand Down
43 changes: 33 additions & 10 deletions FoliCon/Views/PosterIconFaelpessoalHorizontal.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FoliCon.Views
{
Expand All @@ -24,5 +16,36 @@ public PosterIconFaelpessoalHorizontal()
{
InitializeComponent();
}

public PosterIconFaelpessoalHorizontal(object dataContext)
{
DataContext = dataContext;
InitializeComponent();
}
public Bitmap RenderToBitmap()
{
return RenderTargetBitmapTo32BppArgb(AsRenderTargetBitmap());
}

private RenderTargetBitmap AsRenderTargetBitmap()
{
var size = new System.Windows.Size(256, 256);
Measure(size);
Arrange(new Rect(size));

var rtb = new RenderTargetBitmap((int)size.Width, (int)size.Height, 96, 96, PixelFormats.Default);
rtb.Render(this);

return rtb;
}

private static Bitmap RenderTargetBitmapTo32BppArgb(BitmapSource rtb)
{
var stream = new MemoryStream();
BitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(rtb));
encoder.Save(stream);
return new Bitmap(stream);
}
}
}
17 changes: 13 additions & 4 deletions FoliCon/Views/posterIconConfig.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Style TargetType="Window">
<Setter Property="Height" Value="300" />
<Setter Property="MaxHeight" Value="300"></Setter>
<!--<Setter Property="Width" Value="430" />-->
<Setter Property="Width" Value="1066" />
<!--<Setter Property="ResizeMode" Value="NoResize" />-->
<Setter Property="WindowStyle" Value="ToolWindow" />
<Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
Expand All @@ -30,15 +30,14 @@
<GroupBox hc:TitleElement.TitlePlacement="Top" Header="{langExtension:Lang Key={x:Static langs:LangKeys.PosterIconOverlay}}"
Style="{StaticResource GroupBoxTab}" FontSize="22" FontFamily="Cambria"
hc:TitleElement.Background="CornflowerBlue" Foreground="Black" BorderThickness="0"
Background="Transparent" Width="843">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
Background="Transparent" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch">
<Grid Margin="15,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<RadioButton x:Name="RPoster" Grid.Column="0" GroupName="PosterOverlay"
Command="{Binding IconOverlayChangedCommand}"
Expand Down Expand Up @@ -68,6 +67,7 @@
<Image Source="/Resources/PosterIconFaelpessoal.ico" />
</RadioButton.Content>
</RadioButton>

<RadioButton x:Name="RPosterLiaher" Grid.Column="3" GroupName="PosterOverlay"
Command="{Binding IconOverlayChangedCommand}"
CommandParameter="Liaher" FontSize="16"
Expand All @@ -77,6 +77,15 @@
<Image Source="/Resources/PosterIconLiaher.ico" />
</RadioButton.Content>
</RadioButton>
<RadioButton x:Name="RPosterFaelpessoalHorizontal" Grid.Column="4" GroupName="PosterOverlay" ToolTip="{langExtension:Lang Key={x:Static langs:LangKeys.BestSuitedForHorizontal}}"
Command="{Binding IconOverlayChangedCommand}"
CommandParameter="FaelpessoalHorizontal" FontSize="16"
HorizontalAlignment="Left" VerticalAlignment="Stretch"
IsChecked="{Binding IconOverlay, ConverterParameter= FaelpessoalHorizontal, Converter={StaticResource StringToBooleanConvertor}}">
<RadioButton.Content>
<Image Source="/Resources/PosterIconFaelpessoalHorizontal.ico" />
</RadioButton.Content>
</RadioButton>
</Grid>
</GroupBox>
</UserControl>

0 comments on commit e693d24

Please sign in to comment.