DevCharly commented on code in PR #3712:
URL: https://github.com/apache/netbeans/pull/3712#discussion_r849750542
##########
platform/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/BasicScrollingTabDisplayerUI.java:
##########
@@ -468,20 +468,7 @@ protected Rectangle getControlButtonsRectangle( Container
parent ) {
@Override
public Dimension getMinimumSize(JComponent c) {
- int index = displayer.getSelectionModel().getSelectedIndex();
- TabDataModel model = displayer.getModel();
- if (model.size() == 0) {
- return new Dimension(0, 0);
- }
- if( index < 0 || index >= model.size() )
- index = 0;
- Component comp = model.getTab(index).getComponent();
- if( null == comp )
- comp = displayer.getComponentConverter().getComponent(
model.getTab( index ) );
- Dimension minSize = null == comp ? new Dimension( 100, 10 ) :
comp.getMinimumSize();
- minSize.width = Math.max(minSize.width, 100);
- minSize.height = Math.max(minSize.height, 10);
- return minSize;
+ return new Dimension( 100, displayer.getSize().height);
Review Comment:
It would be better to use `displayer.getPreferredSize().height` here.
`displayer.getSize()` returns the current size, which is initially `0,0`
before first layout pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists