mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
Merge PR #1030: TabbedPaneUI: When the mouse wheel event is not in the viewport, propagate the event to the nearest parent
This commit is contained in:
@@ -11,6 +11,9 @@ FlatLaf Change Log
|
|||||||
- TabbedPane: Added icon-only tab mode, which shows tab icons but hides tab
|
- TabbedPane: Added icon-only tab mode, which shows tab icons but hides tab
|
||||||
titles. Tab titles are used in "Show Hidden Tabs" popup menu. (set client
|
titles. Tab titles are used in "Show Hidden Tabs" popup menu. (set client
|
||||||
property `JTabbedPane.tabWidthMode` to `"iconOnly"`)
|
property `JTabbedPane.tabWidthMode` to `"iconOnly"`)
|
||||||
|
- TabbedPane: In scroll tab layout, propagate mouse wheel events to ancestors.
|
||||||
|
This allows mouse wheel scrolling if JTabbedPane is inside a JScrollPane. (PR
|
||||||
|
#1030)
|
||||||
|
|
||||||
#### Fixed bugs
|
#### Fixed bugs
|
||||||
|
|
||||||
|
|||||||
@@ -2718,8 +2718,13 @@ debug*/
|
|||||||
|
|
||||||
// because this listener receives mouse events for the whole tabbed pane,
|
// because this listener receives mouse events for the whole tabbed pane,
|
||||||
// we have to check whether the mouse is located over the viewport
|
// we have to check whether the mouse is located over the viewport
|
||||||
if( !isInViewport( e.getX(), e.getY() ) )
|
if( !isInViewport( e.getX(), e.getY() ) ) {
|
||||||
|
// if it is not in the viewport, retarget the event to a parent container
|
||||||
|
// which might support scrolling (e.g. a surrounding ScrollPane)
|
||||||
|
Container parent = tabPane.getParent();
|
||||||
|
parent.dispatchEvent( SwingUtilities.convertMouseEvent( tabPane, e, parent ) );
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lastMouseX = e.getX();
|
lastMouseX = e.getX();
|
||||||
lastMouseY = e.getY();
|
lastMouseY = e.getY();
|
||||||
|
|||||||
Reference in New Issue
Block a user