mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 22:40:53 +03:00
Theme Editor:
- fixed broken (mouse-wheel) scrolling caused by the additional JPanel - fixed broken slide-in animation of "find bar"
This commit is contained in:
@@ -84,23 +84,21 @@ class FlatFindReplaceBar
|
||||
@Override
|
||||
public boolean requestFocusInWindow() {
|
||||
// invoked from CollapsibleSectionPanel
|
||||
return findField.requestFocusInWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotify() {
|
||||
super.addNotify();
|
||||
|
||||
// if showing bar, highlight matches in editor
|
||||
// (not invoking this from addNotify() because this would break the slide-in animation)
|
||||
markAll();
|
||||
|
||||
return findField.requestFocusInWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeNotify() {
|
||||
super.removeNotify();
|
||||
|
||||
// if hiding bar, clear all highlighted matches in editor
|
||||
// if hiding bar, clear all highlighted matches in editor and focus it
|
||||
SearchEngine.markAll( textArea, new SearchContext() );
|
||||
textArea.requestFocusInWindow();
|
||||
}
|
||||
|
||||
private void findNext() {
|
||||
|
||||
@@ -109,18 +109,8 @@ class FlatThemeEditorPane
|
||||
// create overlay layer
|
||||
JLayer<FlatSyntaxTextArea> overlay = new JLayer<>( textArea, new FlatThemeEditorOverlay() );
|
||||
|
||||
// create view panel that transfers focus to editor when hiding find/replace bar
|
||||
JPanel viewPanel = new JPanel( new BorderLayout() ) {
|
||||
@Override
|
||||
public boolean requestFocusInWindow() {
|
||||
// invoked from CollapsibleSectionPanel
|
||||
return textArea.requestFocusInWindow();
|
||||
}
|
||||
};
|
||||
viewPanel.add( overlay, BorderLayout.CENTER );
|
||||
|
||||
// create scroll pane
|
||||
scrollPane = new RTextScrollPane( viewPanel );
|
||||
scrollPane = new RTextScrollPane( overlay );
|
||||
scrollPane.setBorder( null );
|
||||
scrollPane.setLineNumbersEnabled( true );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user