A minor theme issue

Posted by: kbj on 20 November 2017, 11:44 am EST

    • Post Options:
    • Link

    Posted 20 November 2017, 11:44 am EST

    Since I query the theme tree to pull colors and brushes to use on non-themed controls. I use the C1ThemeDesigner program to track down paths. It is an excellent resource.

    I cut and paste the theme path from reference window.

    Sometimes the path displayed is not the actual path to the desired setting as in:

    BaseThemeProperties\Styles[b]Clickable Styles[/b]\Hot\ForeColor

    is found at

    BaseThemeProperties\Styles[b]Clickable[/b]\Hot\ForeColor

    There are a number of these situations.

    This is, of course, a minor issue with a complex and very valuable part of the collection. I cannot imagine how much labor went into creating and implementing the themes.

    -Thanks

    Kingman

  • Posted 21 November 2017, 7:36 am EST

    Hi Kingman!

    Thank you so much for acknowledging the team’s efforts.

    However, I am not able to see the mentioned issue at my end (tried with the latest one). So, could you please share its demonstrating video or exact steps in order to replicate the behaviour?

    Regards,

    Meenakshi

  • Posted 22 November 2017, 10:35 am EST

    Here’s a short project that illustrates the path mentioned above

    This is the tree path as found in the Theme Designer

    When I copy the path and attempt to use it, it fails. I manually look through the theme tree and figure out what the path should be, and it works. It just seems that the path (highlighted above) should be the actual path to the resource. Most times the path displayed is correct, but not always.

    Imports C1.Win.C1Themes

    Public Class Form1

    'A simple 1 form, 1 button, 1 C1ThemeController project with the application theme set to some theme

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Dim themeName = C1ThemeController.ApplicationTheme

    Dim theme = C1ThemeController.GetThemeByName(themeName, False)

    'this path is not found

    Debug.Print(theme.GetBackgroundBrushStr(“BaseThemeProperties\Styles\Clickable Styles\Hot\Background”))

    'this path is found

    Debug.Print(theme.GetBackgroundBrushStr(“BaseThemeProperties\Styles\Clickable\Hot\Background”))

    'this path is not found

    Debug.Print(theme.GetColor(“BaseThemeProperties\Styles\Clickable Styles\Hot\ForeColor”, Color.Red).ToString)

    'this path is found

    Debug.Print(theme.GetColor(“BaseThemeProperties\Styles\Clickable\Hot\ForeColor”).ToString)

    End Sub

    End Class

    One other thing, about themed Treeviews. Most treeviews have a hot & hot/Selected style that is identical to the default style, so the user gets no visual feedback when hovering over a node. I have taken to using the [b]BaseThemeProperties\Styles\Clickable\Hot[/b] and [b]BaseThemeProperties\Styles\Clickable\HotPressed[/b] colors for the associated styles in the treeview. It looks much better (IMHO). One thing I would like is to have a background brush property (as in the theme), not just a color, for the custom styles.

    Thanks,

    Kingman

  • Posted 23 November 2017, 7:35 am EST

    Hi Kingman!

    Thanks for sharing the details. However, I am able to see the mentioned issue with :

    theme.GetBackgroundBrushStr(“BaseThemeProperties\Styles\Clickable Styles\Hot\Background”)

    but not with :

    theme.GetColor(“BaseThemeProperties\Styles\Clickable Styles\Hot\ForeColor”, Color.Red)

    I have created a small sample with the provided code and details. And, I am attaching it here. Kindly confirm if there is something missing, and/or you can see both the issues at your end in this sample.

    Regards,

    Meenakshi

    Prj_ThemeTree.zip

  • Posted 23 November 2017, 10:59 am EST

    The reason

    theme.GetColor(“BaseThemeProperties\Styles\Clickable Styles\Hot\ForeColor”, Color.Red

    returns a color (the Color.Red) is that when GetColor can’t find the path, it returns the default color. I supplied a default color to avoid the

    System.Exception: ‘Value [BaseThemeProperties\Styles\Clickable Styles\Hot\ForeColor] does not exist.’

    Error

    -Kingman

  • Posted 27 November 2017, 6:04 am EST

    Hi Kingman!

    I could observe the problem, and hence reported this to the developers. And, will inform you once it is fixed [Internal ID : 298564].

    Thanks and regards,

    Meenakshi

  • Posted 28 November 2017, 12:15 am EST

    Hi!

    As per the developers, you see “full display name”, but Get* methods uses “full name”. You can switch description from “full display name” to “full name” mode. Attached is the image, for more clarity.

    Regards,

    Meenakshi

  • Posted 28 November 2017, 4:59 pm EST

    Hi Meenakshi,

    That’s perfect.

    Thanks for your help!

    -Kingman

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels