- March 24, 2007
- 12,073
- 7,459
- Home Country
- Germany
- Moderator
- #1
The "Default" skin of MP2 is the base for all other skins. It's developed as a basic, fast and extensible skin. It's designed as 1280x720 resolution.
All (or the majority) of the other Skins (Reflexion, Titanium, ApolloOne, BlueVision) are full HD (1920x1080).
Because of the MP2 skin resource lookup chain, a fallback for missing screens and resources happens, selection the "Default" versions in the end.
Where is the problem?
Inbuilt plugins come with Skin support for Default, some of them also for Reflexion and Titanium. The most differences come from defined constants, like image sizes, grid widths, margins etc.
So to add support for greater sizes requires some changes to support all new 1080 Skins.
How can we solve this?
My idea is to define constants inside Skins for both common sizes: 720 and 1080.
I've created a custom MultiValueConverter which decides internally if it should use the first or second argument (720 or 1080 resolution).
The XAML attributes then should use the new converter and bind both 720/1080 resources to it. It's not much more work then using single resources, but save all other designers most of the work.
Examples
Weather icon:
Where the constants are defined as:
So it's now no longer required to define the same constants for each 1080 skin over and over again, but only once inside the plugin.
Full changes for "Weather": https://github.com/MediaPortal/MediaPortal-2/commit/6b13c779e604a601d32be539cf9d08933d579510
Same for "News": https://github.com/MediaPortal/MediaPortal-2/commit/3e13557b0ad3a43baa09ebb317f4e251f1003983
This change is especially thought for all new Skins which are under development (ApolloOne + BlueVision).
@Designers and @Developers
All (or the majority) of the other Skins (Reflexion, Titanium, ApolloOne, BlueVision) are full HD (1920x1080).
Because of the MP2 skin resource lookup chain, a fallback for missing screens and resources happens, selection the "Default" versions in the end.
Where is the problem?
Inbuilt plugins come with Skin support for Default, some of them also for Reflexion and Titanium. The most differences come from defined constants, like image sizes, grid widths, margins etc.
So to add support for greater sizes requires some changes to support all new 1080 Skins.
How can we solve this?
My idea is to define constants inside Skins for both common sizes: 720 and 1080.
I've created a custom MultiValueConverter which decides internally if it should use the first or second argument (720 or 1080 resolution).
The XAML attributes then should use the new converter and bind both 720/1080 resources to it. It's not much more work then using single resources, but save all other designers most of the work.
Examples
Weather icon:
XML:
<Image x:Name="BigIcon" Source="{Binding CurrentLocation.Condition.BigIconProperty}" Stretch="Uniform">
<Image.Width>
<MultiBinding Converter="{StaticResource SkinResolutionMultiValueConverter}">
<Binding Source="{StaticResource WeatherIconBigWidth720}"/>
<Binding Source="{StaticResource WeatherIconBigWidth1080}"/>
</MultiBinding>
</Image.Width>
<Image.Height>
<MultiBinding Converter="{StaticResource SkinResolutionMultiValueConverter}">
<Binding Source="{StaticResource WeatherIconBigHeight720}"/>
<Binding Source="{StaticResource WeatherIconBigHeight1080}"/>
</MultiBinding>
</Image.Height>
</Image>
XML:
<ResourceWrapper x:Key="WeatherIconBigWidth720">128</ResourceWrapper>
<ResourceWrapper x:Key="WeatherIconBigHeight720">128</ResourceWrapper>
<ResourceWrapper x:Key="WeatherIconBigWidth1080">192</ResourceWrapper>
<ResourceWrapper x:Key="WeatherIconBigHeight1080">192</ResourceWrapper>
Full changes for "Weather": https://github.com/MediaPortal/MediaPortal-2/commit/6b13c779e604a601d32be539cf9d08933d579510
Same for "News": https://github.com/MediaPortal/MediaPortal-2/commit/3e13557b0ad3a43baa09ebb317f4e251f1003983
This change is especially thought for all new Skins which are under development (ApolloOne + BlueVision).
@Designers and @Developers