ChildWindow - TitleBarHeight

Started by N0things, 24 February 2019, 19:08:50

N0things

Hello !

I'm currently designing a GUI for a game and I was wondering if there is a way to change the ChildWindow's TitleBar's height ?

I found the property "TitleBarHeight" but changing it doesn't seem to make any difference, is that normal ? I change it using :

window->getRenderer()->setTitleBarHeight(...);

texus

Using "window->getRenderer()->setTitleBarHeight(...);" changes the title bar height for me. Can you share some example code where the title bar isn't being changed (as it probably has to do with the order in which functions are being called)?

N0things

That's my really bad, didn't update to TGUI last version. I was still using 0.8.1....

Sorry for bothering ! It works now !

N0things

However, something is still a bit surprising, setting the TitleBarHeight through :

m_window->getRenderer()->setTitleBarHeight(50);

works well ! But, if I removed the previous line and instead add the following line to my theme file "default.txt" :


ChildWindow {
    TitleBarHeight = 50;
}


It doesn't change anything. But this property is still recognized by the parser as I have no error message, just that setting is to 5, 50, 500 or whatever will not affect the TitleBarHeight at all.

Is that normal ? (just wondering)

texus

It's a bug. I did some tests and I guess you are setting a default theme (as it seems to work fine when calling setRenderer after the widget was created).
It seems like the constructor of the ChildWindow class sets its default height of the title bar after it loads the renderer of the default theme, instead of before.

I have fixed it in the version on github (http://github.com/texus/TGUI), but you will have to compile it yourself to use it.

N0things

Sure ! Thanks for the quick fix !  ;)