From 98d47146eb4fc89cd30cf17c1b67295f2dc6769a Mon Sep 17 00:00:00 2001 From: lantzelot-swe Date: Sat, 10 Apr 2021 10:47:57 +0200 Subject: [PATCH] fix: adds wait cursor when toggeling favorites --- src/main/java/se/lantz/gui/MenuManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/se/lantz/gui/MenuManager.java b/src/main/java/se/lantz/gui/MenuManager.java index 9fb2671..ff5c4cb 100644 --- a/src/main/java/se/lantz/gui/MenuManager.java +++ b/src/main/java/se/lantz/gui/MenuManager.java @@ -303,7 +303,9 @@ public class MenuManager KeyStroke keyStrokeToToggleFav = KeyStroke.getKeyStroke(KeyEvent.VK_F1, InputEvent.CTRL_DOWN_MASK); toggleFavorite1Item.setAccelerator(keyStrokeToToggleFav); toggleFavorite1Item.addActionListener(e -> { + mainWindow.setWaitCursor(true); mainWindow.getMainPanel().toggleFavorite(); + mainWindow.setWaitCursor(false); }); return toggleFavorite1Item; } @@ -314,7 +316,9 @@ public class MenuManager KeyStroke keyStrokeToToggleFav = KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_DOWN_MASK); toggleFavorite2Item.setAccelerator(keyStrokeToToggleFav); toggleFavorite2Item.addActionListener(e -> { + mainWindow.setWaitCursor(true); mainWindow.getMainPanel().toggleFavorite2(); + mainWindow.setWaitCursor(false); }); return toggleFavorite2Item; } @@ -325,7 +329,9 @@ public class MenuManager KeyStroke keyStrokeToToggleFav = KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.CTRL_DOWN_MASK); toggleFavorite3Item.setAccelerator(keyStrokeToToggleFav); toggleFavorite3Item.addActionListener(e -> { + mainWindow.setWaitCursor(true); mainWindow.getMainPanel().toggleFavorite3(); + mainWindow.setWaitCursor(false); }); return toggleFavorite3Item; } @@ -336,7 +342,9 @@ public class MenuManager KeyStroke keyStrokeToToggleFav = KeyStroke.getKeyStroke(KeyEvent.VK_F4, InputEvent.CTRL_DOWN_MASK); toggleFavorite4Item.setAccelerator(keyStrokeToToggleFav); toggleFavorite4Item.addActionListener(e -> { + mainWindow.setWaitCursor(true); mainWindow.getMainPanel().toggleFavorite4(); + mainWindow.setWaitCursor(false); }); return toggleFavorite4Item; } @@ -347,7 +355,9 @@ public class MenuManager KeyStroke keyStrokeToToggleFav = KeyStroke.getKeyStroke(KeyEvent.VK_F5, InputEvent.CTRL_DOWN_MASK); toggleFavorite5Item.setAccelerator(keyStrokeToToggleFav); toggleFavorite5Item.addActionListener(e -> { + mainWindow.setWaitCursor(true); mainWindow.getMainPanel().toggleFavorite5(); + mainWindow.setWaitCursor(false); }); return toggleFavorite5Item; }