Browse Source

Fixes away state indicators being broken if away on connect (or attach)

Change-Id: I5472a2ac3024b80c5a260c8ca64d53b48b83e78b
Reviewed-on: http://gerrit.dmdirc.com/1205
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.4
Greboid 14 years ago
parent
commit
295a55a7dd
1 changed files with 5 additions and 20 deletions
  1. 5
    20
      src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java

+ 5
- 20
src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java View File

@@ -115,7 +115,7 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
115 115
         getInputField().setCaretColor(config.getOptionColour(
116 116
                 "ui", "inputforegroundcolour",
117 117
                 "ui", "foregroundcolour"));
118
-        config.getOptionBool("ui", "awayindicator");
118
+        useAwayIndicator = config.getOptionBool("ui", "awayindicator");
119 119
 
120 120
         config.addChangeListener("ui", "inputforegroundcolour", this);
121 121
         config.addChangeListener("ui", "inputbackgroundcolour", this);
@@ -131,24 +131,6 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
131 131
                 getInputField().getTextField()));
132 132
     }
133 133
 
134
-    /** {@inheritDoc} */
135
-    @Override
136
-    public void open() {
137
-        UIUtilities.invokeLater(new Runnable() {
138
-
139
-            /** {@inheritDoc} */
140
-            @Override
141
-            public void run() {
142
-                InputTextFrame.super.open();
143
-                if (useAwayIndicator && getContainer().getServer() != null) {
144
-                    awayLabel.setVisible(getContainer().getServer().isAway());
145
-                }
146
-
147
-                inputField.requestFocusInWindow();
148
-            }
149
-        });
150
-    }
151
-
152 134
     /**
153 135
      * Initialises the components for this frame.
154 136
      */
@@ -545,6 +527,9 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
545 527
     @Override
546 528
     public void internalFrameActivated(final InternalFrameEvent event) {
547 529
         super.internalFrameActivated(event);
548
-        getInputField().requestFocusInWindow();
530
+        if (useAwayIndicator && getContainer().getServer() != null) {
531
+            awayLabel.setVisible(getContainer().getServer().isAway());
532
+        }
533
+        inputField.requestFocusInWindow();
549 534
     }
550 535
 }

Loading…
Cancel
Save