Menu

Windows 10 Title Bar

Help
udok
2021-08-13
2021-11-18
  • udok

    udok - 2021-08-13

    Hi,

    I am playing with the Themes sample in samples/Themes.

    Question: Is it possible to theme the Title Bar of the main window (Win 10)?
    The title bar is always white which does not look good with the colored themes.

    One observation: The CString class is very memory hungry.
    An empty string needs about 72 Bytes without doing anything.
    Do you have plans to rewrite it? Or could i help?

    Thanks,
    Udo

     
  • kite

    kite - 2021-10-15

    You can refer this to customize Title Bar, but you need more work to modify CFrame class to re-position menubar, toolbar. I have a successful trying without menubar and toolbar.

    It's very good if David enhance theme support using this approach.

     
  • David

    David - 2021-10-16

    Hi Kite,

    Thanks for providing the code that shows how to modify the window's title bar. This is the first example of code I've seen that does this well.

    I'll investigate it further and see if I can come up with a sample that combines this with CFrame.

    Best regards,
    David

     
  • David

    David - 2021-11-13

    I've added two samples to the framework, namely Titlebar and TitlebarFrame. Both samples feature a customized title bar.

    The Titlebar sample is a simple window with a menu. The TitlebarFrame sample is a full featured frame is a customized title bar.

    You can download the latest code snapshot from the code section.

    Best regards,
    David

     
  • kite

    kite - 2021-11-17

    Thanks for David's samples. How can I set text color (and MenuTheme) for menubar item in Titlebar sample?
    I can do this in TitlebarFrame demo, but SetMenuTheme and CustomDrawMenuBar only work on CFrame.

     
  • kite

    kite - 2021-11-17

    System menu width is not correct when first click on window icon. My os is win11, build sample by vs2019 , vs2022.

     
  • David

    David - 2021-11-18

    Hi Kite,

    The colors for the title bar in the Titlebar frame sample are set in the TitlebarColors struct defined in MiniFrame.h. You can adjust the colors by modifying those values manually, or programatically as the TitlebarFrame sample does.

    The TitlebarFrame sample has full featured custom drawing for the menubar in both full-frame mode and mini-frame mode. The Titlebar sample is much simpler, and that's what makes it useful. It just uses custom drawing to match the menubar's color to the titlebar, otherwise it would look odd.

    I'll look into the system menu width for windows 11. Just bear in mind that both the Titlebar and the TitlebarFrame samples are still under development. They'll probably need to be tweaked before they are ready for the next official release.

    Best regards,
    David

     
  • David

    David - 2021-11-18

    Hi Kite,

    I've just submitted a SVN update to address the system menu width issue you mentioned.

    Best regards.
    David

     

Log in to post a comment.