From 5fe6ab2282259acbab8fc62f9c216ac10992fdd4 Mon Sep 17 00:00:00 2001 From: Kamil Baczkowicz Date: Mon, 22 Aug 2016 22:58:16 +0100 Subject: [PATCH] Fix for the stats title pane sizing and AOOB. --- .../baczkowicz/mqttspy/ui/controllers/MessageController.java | 2 +- .../mqttspy/ui/controllers/SubscriptionController.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/MessageController.java b/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/MessageController.java index e08f877d..3a1c6f7e 100644 --- a/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/MessageController.java +++ b/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/MessageController.java @@ -249,7 +249,7 @@ public void onFormatChange(final MessageFormatChangeEvent event) private void updateMessage(final int messageIndex) { - if (messageIndex > 0) + if (messageIndex > 0 && store.getMessages().size() > 0) { FormattedMqttMessage message = null; diff --git a/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/SubscriptionController.java b/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/SubscriptionController.java index 4bfeb086..f2e2368a 100644 --- a/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/SubscriptionController.java +++ b/mqtt-spy/src/main/java/pl/baczkowicz/mqttspy/ui/controllers/SubscriptionController.java @@ -587,7 +587,8 @@ public void changed(ObservableValue observable, Number oldValu final double newV = (double) newValue; final Double diff = oldV - newV; - final Double target = (diff < 20 && diff > 0) ? newV - 20 : newV; + // If resizing down, jump at least by 10; otherwise no target + final Double target = (diff < 10 && diff > 0) ? newV - 10 : null; logger.debug("Using target width of {}; requested {}; previously {}", target, newValue, oldValue);