Jump to content
LaunchBox Community Forums

Upgrade your custom LaunchBox theme to support Platform Icons (LaunchBox 13.2 and above)


faeran

Recommended Posts

If you have built yourself a custom LaunchBox theme and want to include support for the new Platform Icon system that was released with version 13.2, you can do the following.

Open your SidebarView.xaml file.

Add the following namespaces to the top (along with the rest of them):

xmlns:controls="clr-namespace:Unbroken.LaunchBox.Windows.Controls;assembly=Unbroken.LaunchBox.Windows"
xmlns:win="clr-namespace:Unbroken.LaunchBox.Windows;assembly=Unbroken.LaunchBox.Windows"

Below that, in the UserControl.Resources section, you will need to add the following:

<win:BindingProxy x:Key="IconVisibility"  Data="{Binding IconVisibility}"/>

Further down, inside of your TreeView.ItemTemplate you will need to add the new PlatformIcon control, which is wrapped in a Grid.

Here is an example of the entire DockPanel, but note that you will most likely only need to add the Grid portion of it in the same position as shown in this example.

                    <DockPanel LastChildFill="True" HorizontalAlignment="Stretch">
                        <TextBlock Padding="12,8,12,8" Text="{Binding Count}" TextAlignment="Right" DockPanel.Dock="Right" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.RightCountVisibility}" />
                        <Grid DockPanel.Dock="Left" Margin="12,0,0,0"  Height="24" Width="24" Visibility="{Binding Source={StaticResource IconVisibility}, Path=Data}">
                            <controls:PlatformIcon PlatformName="{Binding BackendValue}" PlatformType="{Binding FilterType}" />
                        </Grid>
                        <TextBlock Padding="12,8,12,8" Text="{Binding Value}" TextAlignment="Left" TextTrimming="CharacterEllipsis" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.ValueWithoutCountVisibility}" />
                        <TextBlock Padding="12,8,12,8" Text="{Binding ValueWithCount}" TextAlignment="Left" TextTrimming="CharacterEllipsis" Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.ValueWithCountVisibility}" />
                    </DockPanel>

 

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

  • 3 weeks later...

Any idea how to make the images in the grid anti-aliased or higher resolution? I'm trying to use higher resolution images, but they don't look very good. Adding "RenderOptions.BitmapScalingMode="HighQuality"" worked for me in beta-1 but it doesn't work in the full release. I noticed this is also a problem with the "Default Plus" theme now as well.

Edited by Gill Figno
Link to comment
Share on other sites

7 hours ago, Gill Figno said:

Any idea how to make the images in the grid anti-aliased or higher resolution? I'm trying to use higher resolution images, but they don't look very good. Adding "RenderOptions.BitmapScalingMode="HighQuality"" worked for me in beta-1 but it doesn't work in the full release. I noticed this is also a problem with the "Default Plus" theme now as well.

On the <controls:PlatformIcon> element, add the property ScalingMode

I believe you want to use the HighQuality value. So it would be:

<controls:PlatformIcon ScalingMode="HighQuality">

Here's a link that explains other options you can play around with:

https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.bitmapscalingmode?view=windowsdesktop-7.0

  • Game On 1
Link to comment
Share on other sites

6 hours ago, faeran said:

On the <controls:PlatformIcon> element, add the property ScalingMode

I believe you want to use the HighQuality value. So it would be:

<controls:PlatformIcon ScalingMode="HighQuality">

Here's a link that explains other options you can play around with:

https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.bitmapscalingmode?view=windowsdesktop-7.0

Yup, that worked. Thanks a lot!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...