Console: Main "Pause" button not working? fix #3854
This commit is contained in:
parent
bbe9eb6c5c
commit
ce334f0775
|
@ -6,7 +6,7 @@ import java.net.URL;
|
|||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class rusEFIVersion {
|
||||
public static final int CONSOLE_VERSION = 20220128;
|
||||
public static final int CONSOLE_VERSION = 20220201;
|
||||
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
||||
|
||||
public static long classBuildTimeMillis() {
|
||||
|
|
|
@ -220,13 +220,11 @@ public class GaugesPanel {
|
|||
}
|
||||
|
||||
private Component createPauseButton() {
|
||||
final JButton pauseButton = UiUtils.createPauseButton();
|
||||
pauseButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
IS_PAUSED = !IS_PAUSED;
|
||||
UiUtils.setPauseButtonText(pauseButton, IS_PAUSED);
|
||||
}
|
||||
String suffix = " Gauges";
|
||||
final JButton pauseButton = UiUtils.createPauseButton(suffix);
|
||||
pauseButton.addActionListener(e -> {
|
||||
IS_PAUSED = !IS_PAUSED;
|
||||
UiUtils.setPauseButtonText(pauseButton, IS_PAUSED, suffix);
|
||||
});
|
||||
return pauseButton;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,11 @@ public class UiUtils {
|
|||
}
|
||||
|
||||
public static void setPauseButtonText(JButton pauseButton, boolean isPaused) {
|
||||
pauseButton.setText(isPaused ? RESUME.getMessage() : PAUSE.getMessage());
|
||||
setPauseButtonText(pauseButton, isPaused, "");
|
||||
}
|
||||
|
||||
public static void setPauseButtonText(JButton pauseButton, boolean isPaused, String suffix) {
|
||||
pauseButton.setText((isPaused ? RESUME.getMessage() : PAUSE.getMessage()) + suffix);
|
||||
}
|
||||
|
||||
public static void centerWindow(Window w) {
|
||||
|
@ -141,7 +145,12 @@ public class UiUtils {
|
|||
|
||||
@NotNull
|
||||
public static JButton createPauseButton() {
|
||||
final JButton pauseButton = new JButton(PAUSE.getMessage());
|
||||
return createPauseButton("");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static JButton createPauseButton(String suffix) {
|
||||
final JButton pauseButton = new JButton(PAUSE.getMessage() + suffix);
|
||||
pauseButton.setMnemonic('p');
|
||||
return pauseButton;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue