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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.
https://github.com/grassator/win32-window-custom-titlebar
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
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
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.
System menu width is not correct when first click on window icon. My os is win11, build sample by vs2019 , vs2022.
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
Hi Kite,
I've just submitted a SVN update to address the system menu width issue you mentioned.
Best regards.
David