mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 06:50:56 +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
|
@Override
|
||||||
public boolean requestFocusInWindow() {
|
public boolean requestFocusInWindow() {
|
||||||
// invoked from CollapsibleSectionPanel
|
// invoked from CollapsibleSectionPanel
|
||||||
return findField.requestFocusInWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addNotify() {
|
|
||||||
super.addNotify();
|
|
||||||
|
|
||||||
// if showing bar, highlight matches in editor
|
// if showing bar, highlight matches in editor
|
||||||
|
// (not invoking this from addNotify() because this would break the slide-in animation)
|
||||||
markAll();
|
markAll();
|
||||||
|
|
||||||
|
return findField.requestFocusInWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeNotify() {
|
public void removeNotify() {
|
||||||
super.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() );
|
SearchEngine.markAll( textArea, new SearchContext() );
|
||||||
|
textArea.requestFocusInWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findNext() {
|
private void findNext() {
|
||||||
|
|||||||
@@ -109,18 +109,8 @@ class FlatThemeEditorPane
|
|||||||
// create overlay layer
|
// create overlay layer
|
||||||
JLayer<FlatSyntaxTextArea> overlay = new JLayer<>( textArea, new FlatThemeEditorOverlay() );
|
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
|
// create scroll pane
|
||||||
scrollPane = new RTextScrollPane( viewPanel );
|
scrollPane = new RTextScrollPane( overlay );
|
||||||
scrollPane.setBorder( null );
|
scrollPane.setBorder( null );
|
||||||
scrollPane.setLineNumbersEnabled( true );
|
scrollPane.setLineNumbersEnabled( true );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user