From 5fe8ccd478f88ccacb406ecd8490a75db90ce939 Mon Sep 17 00:00:00 2001 From: Denny Date: Thu, 30 Mar 2017 19:52:35 -0400 Subject: [PATCH] Resolves #234 - change the order of assigning an icon and alias text to the audio panel in an attempt to prevent the audio channel panel from wrapping to the next line when the text is too long to display. --- src/audio/AudioChannelPanel.java | 18 +++++++++--------- src/audio/AudioChannelsPanel.java | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/audio/AudioChannelPanel.java b/src/audio/AudioChannelPanel.java index 2181d093..93bf084c 100644 --- a/src/audio/AudioChannelPanel.java +++ b/src/audio/AudioChannelPanel.java @@ -90,7 +90,8 @@ public class AudioChannelPanel extends JPanel private void init() { - setLayout(new MigLayout("align center center, insets 0 0 0 0", "[][][align right]0[grow,fill]", "")); + setLayout(new MigLayout("align center center, insets 0 0 0 0", + "[][][align right]0[grow,fill]", "")); setBackground(mBackgroundColor); mMutedLabel.setFont(mFont); @@ -159,30 +160,29 @@ public class AudioChannelPanel extends JPanel * does not occur on the Swing event thread -- wrap any calls to this * method with an event thread call. */ - private void updateLabel(JLabel valueLabel, String value, JLabel aliasLabel, Alias alias) + private void updateLabel(JLabel textLabel, String value, JLabel iconLabel, Alias alias) { if(value != null) { if(alias != null) { - valueLabel.setText(alias.getName()); - aliasLabel.setIcon(mIconManager.getIcon(alias.getIconName(), 18)); + iconLabel.setIcon(mIconManager.getIcon(alias.getIconName(), 18)); + textLabel.setText(alias.getName()); } else { - valueLabel.setText(value); - aliasLabel.setIcon(null); + iconLabel.setIcon(null); + textLabel.setText(value); } } else { - valueLabel.setText("-----"); - aliasLabel.setIcon(null); + iconLabel.setIcon(null); + textLabel.setText("-----"); } } - /** * Processes audio metadata to update this panel's display values */ diff --git a/src/audio/AudioChannelsPanel.java b/src/audio/AudioChannelsPanel.java index b2d94fb6..ac47c020 100644 --- a/src/audio/AudioChannelsPanel.java +++ b/src/audio/AudioChannelsPanel.java @@ -33,7 +33,6 @@ public class AudioChannelsPanel extends JPanel public AudioChannelsPanel(IconManager iconManager, SettingsManager settingsManager, IAudioController controller) { -// setLayout(new MigLayout("insets 0 0 0 0", "[][grow,fill][][grow,fill]", "[grow,fill]")); setLayout(new MigLayout("insets 0 0 0 0", "[][sg,grow,fill][][sg,grow,fill]", "[grow,fill]")); setBackground(Color.BLACK);