raygui
raygui copied to clipboard
`GuiTabBar()` is very limiting as a lot of its default values and behavior is hard-coded
The usage of GuiTabBar() is very limited because its implementation makes a lot of assumptions and hard-codes many default values.
Examples:
- the width of every entry is hard-coded to 160 https://github.com/raysan5/raygui/blob/e4a59f0afa6a379007a74b0c565c2787525eda36/src/raygui.h#L1738
- each entry can be clicked in order to close TabBar, this also draws additional button in top-right corner of every entry https://github.com/raysan5/raygui/blob/e4a59f0afa6a379007a74b0c565c2787525eda36/src/raygui.h#L1780-L1781
- each entry appears with hard-coded icon at the beginning https://github.com/raysan5/raygui/blob/e4a59f0afa6a379007a74b0c565c2787525eda36/src/raygui.h#L1795
@raysan5 Would it be fine, if I create a PR with more flexible version of this function (e.g. GuiTabBarEx ) ?
The usage of GuiTabBar() is very limited because its implementation makes a lot of assumptions and hard-codes many default values.
Examples:
- the width of every entry is hard-coded to 160 https://github.com/raysan5/raygui/blob/e4a59f0afa6a379007a74b0c565c2787525eda36/src/raygui.h#L1738
- each entry can be clicked in order to close TabBar, this also draws additional button in top-right corner of every entry https://github.com/raysan5/raygui/blob/e4a59f0afa6a379007a74b0c565c2787525eda36/src/raygui.h#L1780-L1781
- each entry appears with hard-coded icon at the beginning https://github.com/raysan5/raygui/blob/e4a59f0afa6a379007a74b0c565c2787525eda36/src/raygui.h#L1795
@raysan5 Would it be fine, if I create a PR with more flexible version of this function (e.g.
GuiTabBarEx) ?
Hi
Hi
@mk99987 ?
Do u know how to increase the text font size in the input field using the GuiTextBox? Please help me. Is the font size fixed in the input field?
@sleeptightAnsiC GuiTabBar() was quickly added for convenience for one of my tools and I'm aware it's not much flexible at the moment.
1.the width of every entry is hard-coded to 160
It can be added a check to allow being redefined by user, like so other advance-controls do.
- each entry can be clicked in order to close TabBar, this also draws additional button in top-right corner of every entry
- each entry appears with hard-coded icon at the beginning
Yes, added for convenience, maybe some define can be added to avoid that close button if not required, I got inspiration from Notepad++ tabs system.
@raysan5 Would it be fine, if I create a PR with more flexible version of this function (e.g. GuiTabBarEx ) ?
I prefer to minimize/avoid Gui*Ex() versions, if it can be addressed with some config-defines on GuiTabBar() directly, I prefer that approach. Afaik, most tools won't need multiple separate versions of GuiTabBar().
I prefer to minimize/avoid Gui*Ex() versions, if it can be addressed with some config-defines on GuiTabBar() directly
Makes sense.
I'm not very comfortable with global styles yet, but GuiTabBar seems to be hijacking properties from TOGGLE and BUTTON controls. I don't really see anything that could be reused for those cases I mentioned at the moment.
Note: the best "documentation" on styling is probably...
...here
https://github.com/raysan5/raygui/blob/b19a0168fa2fbb4e39aafbc38f2ea47f32872bd7/src/raygui.h#L466-L675 https://github.com/raysan5/raygui/blob/b19a0168fa2fbb4e39aafbc38f2ea47f32872bd7/src/raygui.h#L4292-L4393
@mk99987 I'll answer your question since I'm already reading this, but I will ignore any other comments not related to TabBar issue. This is not a support forum and your question is not related to this issue. Ask on Raylib's discord/reddit for general help. Please, after reading this, hide your comments as "Off-Topic" just like I did (by clicking ... next to the comment).
Do u know how to increase the text font size in the input field using the GuiTextBox? Please help me. Is the font size fixed in the input field?
I believe, this is affected by global styling values: DEFAULT TEXT_SIZE. Try using GuiSetStyle(DEFAULT, TEXT_SIZE, 100) right before you call GuiTextBox(). Maybe there is another property I could not find.