ChildWindow - TitleBarHeight

  • 5 Replies
  • 234 Views
ChildWindow - TitleBarHeight
« on: 24 February 2019, 19:08:50 »
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 :

Code: [Select]
window->getRenderer()->setTitleBarHeight(...);

*

texus

  • *****
  • 1413
    • View Profile
    • Texus's Blog
Re: ChildWindow - TitleBarHeight
« Reply #1 on: 24 February 2019, 19:26:37 »
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)?

Re: ChildWindow - TitleBarHeight
« Reply #2 on: 25 February 2019, 06:00:05 »
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 !

Re: ChildWindow - TitleBarHeight
« Reply #3 on: 25 February 2019, 06:56:17 »
However, something is still a bit surprising, setting the TitleBarHeight through :

Code: [Select]
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" :

Code: [Select]
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

  • *****
  • 1413
    • View Profile
    • Texus's Blog
Re: ChildWindow - TitleBarHeight
« Reply #4 on: 25 February 2019, 08:16:12 »
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.

Re: ChildWindow - TitleBarHeight
« Reply #5 on: 25 February 2019, 08:29:07 »
Sure ! Thanks for the quick fix !  ;)