This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Toolbar overflow - if toolbar is too wide to fit to the screen, show additional buttons in some sort of drop down menu.
Created attachment 122576 [details] new api and usage Please review the new api. The patch also contains usage of the new api from various toolbars in the IDE such as the main, the editor and the output window toolbars.
Great job. The new toolbar looks very well in Output Window. I'll definitely use it also in Search Results window. Thank you. JH01: Only small question, would it be possible to eliminate the need of calling maybeAddOverflow() from client code? Maybe the logic could be moved to validate() method. Seems to work fine, but I'm not sure this is correct and effective solution. private void maybeAddOverflow() { validate(); repaint(); } @Override public void validate() { computeVisibleButtons(); if (visibleButtons == -1) { handleOverflowRemoval(); } else { handleOverflowAddittion(); } super.validate(); }
SA01: The overflow toolbar should listen to its own ContainerEvents and show/hide the overflow button as needed. Checking overflow in validate() might work as well though. SA02: getPreferredSize() should be made final. SA03: The origin of popup menus is usually the bottom left corner of the invoking button, not the current mouse cursor location. SA04: Would be nice to have 'down arrow' icon when the toolbar has vertical layout. SA05: JavaDoc is missing @since tag. SA06: apichanges.xml must be updated as well.
Created attachment 122636 [details] patch This patch handles JH01, SA01-SA03 and SA05-SA06. Method maybeAddOverflow() is now private. The problem, Jardo was facing, was happening when all the components were removed from the toolbar. So overriding removeAll() seems to fix the issue. Jardo, could you verify please? > SA04: Would be nice to have 'down arrow' icon when the toolbar has vertical > layout. Petr any thoughts on this? Thank you
Created attachment 122648 [details] final patch Seems like solution from comment 2 is a better start than the one from comment 4. This is the final patch.
Created attachment 122682 [details] Mockup of toolbar with double-arrow overflow symbol Attaching a mockup of how the double-arrow might look like. Actually it would be preferable if the missing part of toolbar appeared immediately on roll over over the doublearrow, not only after click (cf. IntelliJ). Going to attach icon files..
Created attachment 122683 [details] horizontal double-arrow
Created attachment 122684 [details] vertical double-arrow
CC-ing several people that might be interested in overflow toolbars..
Created attachment 122706 [details] patch for review This patch also handles both overflow arrows, horizontal and vertical. Thank you Peter. Please comment as I would like to integrate on Tuesday. Thank you.
Created attachment 122772 [details] RBScreenshot RB1: The button is rectangular when the other buttons are smaller than the default. RB2: There is a strange white border around the panel. (Using GTK3)
Created attachment 122783 [details] patch for RB1, RB2 Ralph thank you for your comments. > RB1: The button is rectangular when the other buttons are smaller than the > default. I think that the overflow button should be rectangular in order to take as less space as possible. Fixed it. > RB2: There is a strange white border around the panel. (Using GTK3) This patch removes the border from the toolbar. I do not know if this is better approach. Peter what do you think about this?
Created attachment 122791 [details] better toolbar borders I agree with RB2; attaching a mockup of IMHO more satisfactorily looking borders (note also the now removed vertical white line on the right of the right vertical toolbar, plus reduced darkgray vertical line on left border of the window contents, etc.) BTW, is there an option to display the overflow on hover over the doublearrow (the Idea way) ?
(In reply to comment #13) > Created attachment 122791 [details] > better toolbar borders > > I agree with RB2; attaching a mockup of IMHO more satisfactorily looking > borders (note also the now removed vertical white line on the right of the > right vertical toolbar, plus reduced darkgray vertical line on left border of > the window contents, etc.) ok I will create a line border of some kind then. > > BTW, is there an option to display the overflow on hover over the doublearrow > (the Idea way) ? not currently but it could be added. Great idea. Thank you Peter
Created attachment 122805 [details] final patch This is the final patch. A light gray, 1px line border is added to the overflow toolbar and on hover mouse event triggers the display of the overflow toolbar. If there are no more comments I am going to integrate tomorrow. Thank you.
Thank you for all your comments. Added minor code to have the overflow toolbar not steal the focus. Integrated in core-main: http://hg.netbeans.org/core-main/rev/007c384cf15d
I had to revert the integration in core-main#007c384cf15d as it breaks the signature tests somehow (seems to be incompatible with signatures of release72). I can work on trying to find what is wrong, but still (even a bit too late) I'd like to add a suggestion: Y01 Why the patch introduces ToolbarWithOverflow superclass? Can't we just put the implementation inside of Toolbar or make ToolbarWithOverflow package private and delegate to it?
Reopening after the revert. Before integration try: $ ant -f openide.loaders/build.xml clean netbeans sigtest-check
Integrated into 'main-golden', will be available in build *201208080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/007c384cf15d User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Issue #216175 - Toolbar overflow
Sorry for that. The problem was that the getPreferredSize() method was final. Fixed: http://hg.netbeans.org/core-main/rev/571f9fce2408
Integrated into 'main-golden', will be available in build *201208090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/571f9fce2408 User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Issue #216175 - Toolbar overflow