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

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

115
         getInputField().setCaretColor(config.getOptionColour(
115
         getInputField().setCaretColor(config.getOptionColour(
116
                 "ui", "inputforegroundcolour",
116
                 "ui", "inputforegroundcolour",
117
                 "ui", "foregroundcolour"));
117
                 "ui", "foregroundcolour"));
118
-        config.getOptionBool("ui", "awayindicator");
118
+        useAwayIndicator = config.getOptionBool("ui", "awayindicator");
119
 
119
 
120
         config.addChangeListener("ui", "inputforegroundcolour", this);
120
         config.addChangeListener("ui", "inputforegroundcolour", this);
121
         config.addChangeListener("ui", "inputbackgroundcolour", this);
121
         config.addChangeListener("ui", "inputbackgroundcolour", this);
131
                 getInputField().getTextField()));
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
      * Initialises the components for this frame.
135
      * Initialises the components for this frame.
154
      */
136
      */
545
     @Override
527
     @Override
546
     public void internalFrameActivated(final InternalFrameEvent event) {
528
     public void internalFrameActivated(final InternalFrameEvent event) {
547
         super.internalFrameActivated(event);
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