CSSTUDIO-3325 Bugfix: Make labels of Byte Monitor widget visible when placed alongside a Label widget inside of a tab of a Navigation Tabs widget#3518
Conversation
… placed alongside a Label widget inside of a tab of a Navigation Tabs widget.
I don't have a perfect explanation and solution, but here's the history: Way back, profiling showed a lot of CPU activity in Javafx layout computations. Changing our widgets to Good news is that we know exactly where the widgets should be positioned. Our But many JavaFX widgets don't have an API to set the size. You can call |
|
Ah, I've been able to reproduce it now - needed the Byte Monitor not to be Interestingly the |
I think that the use of |
|
Oh dear - this has actually undone the fix for #3344... Before the PR the label widget would remain the size you set even if this cropped the text But now the label height property is getting ignored and the label is being resize to the text fontsize: It appears we need both Shall I open a new issue to discuss how we can solve this contention between issues? |
|
@rjwills28 That's unfortunate! (And, I think, unexpected!) Yes, please open an issue. It should definitely be possible to both have fixed label heights as well as visible labels in the Byte Monitor widget. |


This pull request fixes a bug that can be reproduced as follows:
The bug is: when running OPI B, the labels of the Byte Array widget are not visible when opening the tab that contains OPI A.
I don't have an explanation for this bug. Through testing, I have determined that this bug was introduced in #3354. In particular, it is the call
jfx_node.setMinSize(Control.USE_PREF_SIZE, Control.USE_PREF_SIZE)inLabelRepresentation.updateChanges()that causes the issue: the bug doesn't occur when commenting out this call.Since the goal of the pull request #3354 was to prevent the Label widget from increasing its size when the font was larger than the widget, the call to
jfx_node.setMinSize()is actually unnecessary to implement the goal: the call tojfx_node.setMaxSize()already implements this goal. Therefore, I propose to work around this bug by simply removing the call tojfx_node.setMinSize(). Do you think this is acceptable, @rjwills28? (Unfortunately, I cannot assign you as a reviewer to this pull request for some reason, @rjwills28.)