TreeView and FluenNight skin

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by Lasse.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #71349
    MetroFX
    Participant

    I noticed that the TsTreeView control when using the FluenNight skin is missing a downward facing arrow when expanding the tree. Is there any way to fix this defect. When using other skins this problem is not present. The down arrow only appears when you hover the mouse cursor. This can be checked on the “Amegademo” posted by the author.

    Attachments:
    You must be logged in to view attached files.
    #71351
    Lasse
    Participant

    This is actually an issue with all dark skins. I had the same issue with virtual tree control and I fixed it for dark skins by calling:

    Winapi.UxTheme.SetWindowTheme(Handle, PWideChar(‘DarkMode_Explorer’), nil);

    Handle is the control handle. For light skins the theme is ‘explorer’.

    Note! This works only since Windows 10 build 17763. You need to check it.

    if DefaultManager.Active and CheckWin32Version(10) and (TOSVersion.Build >= 17763) then
    begin
      if ColorIsDark(DefaultManager.GetActiveEditColor) then
        AVirtualTree.WindowTheme := 'DarkMode_Explorer'
      else
        AVirtualTree.WindowTheme := 'explorer';
    end;
    • This reply was modified 1 year ago by Lasse.
    #71357
    MetroFX
    Participant

    And can you tell where you added this code of yours to get rid of this problem?

    #71360
    Lasse
    Participant

    This depends on your code. The point is to call the Winapi.UxTheme.SetWindowTheme. You can do this in many different places.

    1. Inherit TsTreeView control and add for example WindowTheme property to set it
    2. Use interposer class TsTreeView = class(sTreeView.TsTreeView) and do the same
    3. Fix the original TsTreeView code and do the same
    4. Call it when initializing your form like

    Winapi.UxTheme.SetWindowTheme(YourTreeView.Handle, PWideChar(‘DarkMode_Explorer’), nil);

    I don’t know what is the best solution for you. If you are using TsTreeView more than 1 place, then I suggest the first. I also suggest using virtual treeview control https://github.com/JAM-Software/Virtual-TreeView

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.