home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Skins and Design
Making inbuilt plugins Skin resolution aware
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="morpheus_xx" data-source="post: 1131078" data-attributes="member: 48495"><p>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. </p><p></p><p>All (or the majority) of the other Skins (Reflexion, Titanium, ApolloOne, BlueVision) are full HD (1920x1080). </p><p></p><p>Because of the MP2 skin resource lookup chain, a fallback for missing screens and resources happens, selection the "Default" versions in the end.</p><p></p><p><u>Where is the problem?</u></p><p>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. </p><p>So to add support for greater sizes requires some changes to support all new 1080 Skins.</p><p><u></u></p><p><u>How can we solve this?</u></p><p>My idea is to define constants inside Skins for both common sizes: 720 and 1080.</p><p></p><p>I've created a custom MultiValueConverter which decides internally if it should use the first or second argument (720 or 1080 resolution).</p><p></p><p>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.</p><p></p><p><u>Examples</u></p><p>Weather icon: </p><p>[CODE=XML] <Image x:Name="BigIcon" Source="{Binding CurrentLocation.Condition.BigIconProperty}" Stretch="Uniform"></p><p> <Image.Width></p><p> <MultiBinding Converter="{StaticResource SkinResolutionMultiValueConverter}"></p><p> <Binding Source="{StaticResource WeatherIconBigWidth720}"/></p><p> <Binding Source="{StaticResource WeatherIconBigWidth1080}"/></p><p> </MultiBinding></p><p> </Image.Width></p><p> <Image.Height></p><p> <MultiBinding Converter="{StaticResource SkinResolutionMultiValueConverter}"></p><p> <Binding Source="{StaticResource WeatherIconBigHeight720}"/></p><p> <Binding Source="{StaticResource WeatherIconBigHeight1080}"/></p><p> </MultiBinding></p><p> </Image.Height></p><p> </Image>[/CODE]</p><p>Where the constants are defined as:</p><p>[CODE=XML] <ResourceWrapper x:Key="WeatherIconBigWidth720">128</ResourceWrapper></p><p> <ResourceWrapper x:Key="WeatherIconBigHeight720">128</ResourceWrapper></p><p></p><p> <ResourceWrapper x:Key="WeatherIconBigWidth1080">192</ResourceWrapper></p><p> <ResourceWrapper x:Key="WeatherIconBigHeight1080">192</ResourceWrapper>[/CODE]</p><p>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.</p><p></p><p>Full changes for "Weather": <a href="https://github.com/MediaPortal/MediaPortal-2/commit/6b13c779e604a601d32be539cf9d08933d579510" target="_blank">https://github.com/MediaPortal/MediaPortal-2/commit/6b13c779e604a601d32be539cf9d08933d579510</a></p><p></p><p>Same for "News": <a href="https://github.com/MediaPortal/MediaPortal-2/commit/3e13557b0ad3a43baa09ebb317f4e251f1003983" target="_blank">https://github.com/MediaPortal/MediaPortal-2/commit/3e13557b0ad3a43baa09ebb317f4e251f1003983</a></p><p></p><p>This change is especially thought for all new Skins which are under development (ApolloOne + BlueVision). </p><p></p><p>[USERGROUP=38]@Designers[/USERGROUP] and [USERGROUP=39]@Developers[/USERGROUP]</p></blockquote><p></p>
[QUOTE="morpheus_xx, post: 1131078, member: 48495"] 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. [U]Where is the problem?[/U] 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. [U] How can we solve this?[/U] 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. [U]Examples[/U] Weather icon: [CODE=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>[/CODE] Where the constants are defined as: [CODE=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>[/CODE] 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": [URL]https://github.com/MediaPortal/MediaPortal-2/commit/6b13c779e604a601d32be539cf9d08933d579510[/URL] Same for "News": [URL]https://github.com/MediaPortal/MediaPortal-2/commit/3e13557b0ad3a43baa09ebb317f4e251f1003983[/URL] This change is especially thought for all new Skins which are under development (ApolloOne + BlueVision). [USERGROUP=38]@Designers[/USERGROUP] and [USERGROUP=39]@Developers[/USERGROUP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Skins and Design
Making inbuilt plugins Skin resolution aware
Contact us
RSS
Top
Bottom