mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
delay actions update
This commit is contained in:
@@ -99,11 +99,6 @@ public class ContextMenuImpl extends JPanel implements Disposable {
|
||||
}
|
||||
|
||||
private void toggleContextToolbar(final boolean show) {
|
||||
myActionToolbar.updateActionsImmediately();
|
||||
if (((Container)myActionToolbar).getComponentCount() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (myShow != show) {
|
||||
myShow = show;
|
||||
restartTimer();
|
||||
@@ -122,6 +117,12 @@ public class ContextMenuImpl extends JPanel implements Disposable {
|
||||
|
||||
if (myTimer != null && myTimer.isRunning()) myTimer.stop();
|
||||
|
||||
myActionToolbar.updateActionsImmediately();
|
||||
if (((Container)myActionToolbar).getComponentCount() == 0) {
|
||||
myShow = false;
|
||||
return;
|
||||
}
|
||||
|
||||
myTimer = UIUtil.createNamedTimer("Restart context menu now", 50, new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@@ -146,8 +147,6 @@ public class ContextMenuImpl extends JPanel implements Disposable {
|
||||
|
||||
scheduleHide();
|
||||
}
|
||||
|
||||
repaint();
|
||||
}
|
||||
else {
|
||||
if (!myVisible) {
|
||||
@@ -162,9 +161,8 @@ public class ContextMenuImpl extends JPanel implements Disposable {
|
||||
myLayeredPane.remove(ContextMenuImpl.this);
|
||||
myLayeredPane.repaint();
|
||||
}
|
||||
|
||||
repaint();
|
||||
}
|
||||
repaint();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user