Browse Source

More work on GTK colour issues

Change-Id: I1ac419b486757be36a4fe9bafd297793c0deba2f
Reviewed-on: http://gerrit.dmdirc.com/1402
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.4
Greg Holmes 14 years ago
parent
commit
b5866027d1
1 changed files with 24 additions and 23 deletions
  1. 24
    23
      src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java

+ 24
- 23
src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java View File

@@ -141,7 +141,7 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
141 141
         setInputField(new SwingInputField(getController().getMainFrame()));
142 142
 
143 143
         getInputField().addMouseListener(this);
144
-        
144
+
145 145
         initPopupMenu();
146 146
         nickPopup = new JPopupMenu();
147 147
 
@@ -193,7 +193,8 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
193 193
     @Override
194 194
     @SuppressWarnings("unchecked")
195 195
     public WritableFrameContainer<? extends InputWindow> getContainer() {
196
-        return (WritableFrameContainer<? extends InputWindow>) super.getContainer();
196
+        return (WritableFrameContainer<? extends InputWindow>) super.
197
+                getContainer();
197 198
     }
198 199
 
199 200
     /**
@@ -214,8 +215,8 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
214 215
     public final void setInputHandler(final InputHandler newInputHandler) {
215 216
         this.inputHandler = newInputHandler;
216 217
         inputHandler.addValidationListener(inputField);
217
-        inputHandler.setTabCompleter(((WritableFrameContainer<?>) frameParent)
218
-                .getTabCompleter());
218
+        inputHandler.setTabCompleter(((WritableFrameContainer<?>) frameParent).
219
+                getTabCompleter());
219 220
     }
220 221
 
221 222
     /**
@@ -323,8 +324,8 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
323 324
             if (point != null) {
324 325
                 initPopupMenu();
325 326
                 inputFieldPopup.show(this, (int) point.getX(),
326
-                        (int) point.getY() + getTextPane().getHeight() + (int)
327
-                        PlatformDefaults.getUnitValueX("related").getValue());
327
+                        (int) point.getY() + getTextPane().getHeight() + (int) PlatformDefaults.
328
+                        getUnitValueX("related").getValue());
328 329
             }
329 330
         }
330 331
     }
@@ -366,16 +367,16 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
366 367
         final String inputFieldText = getInputField().getText();
367 368
         //Get the text that would result from the paste (inputfield
368 369
         //- selection + clipboard)
369
-        final String text = inputFieldText.substring(0, getInputField()
370
-                .getSelectionStart()) + clipboard + inputFieldText.substring(
370
+        final String text = inputFieldText.substring(0, getInputField().
371
+                getSelectionStart()) + clipboard + inputFieldText.substring(
371 372
                 getInputField().getSelectionEnd());
372 373
         final String[] clipboardLines = getSplitLine(text);
373 374
         //check theres something to paste
374 375
         if (clipboardLines.length > 1) {
375 376
             //Clear the input field
376 377
             inputField.setText("");
377
-            final Integer pasteTrigger = getContainer().getConfigManager()
378
-                    .getOptionInt("ui", "pasteProtectionLimit");
378
+            final Integer pasteTrigger = getContainer().getConfigManager().
379
+                    getOptionInt("ui", "pasteProtectionLimit");
379 380
             //check whether the number of lines is over the limit
380 381
             if (pasteTrigger != null && getContainer().getNumLines(text)
381 382
                     > pasteTrigger) {
@@ -411,28 +412,28 @@ public abstract class InputTextFrame extends TextFrame implements InputWindow,
411 412
         super.configChanged(domain, key);
412 413
 
413 414
         if ("ui".equals(domain) && getContainer().getConfigManager() != null) {
414
-            if (getInputField() != null) {
415
-                if ("inputbackgroundcolour".equals(key) || "backgroundcolour".
416
-                        equals(key)) {
417
-                    getInputField().setBackground(getContainer()
418
-                            .getConfigManager().getOptionColour(
415
+            if (getInputField() != null && !UIUtilities.isGTKUI()) {
416
+                if ("inputbackgroundcolour".equals(key)
417
+                        || "backgroundcolour".equals(key)) {
418
+                    getInputField().setBackground(getContainer().
419
+                            getConfigManager().getOptionColour(
419 420
                             "ui", "inputbackgroundcolour",
420 421
                             "ui", "backgroundcolour"));
421
-                } else if ("inputforegroundcolour".equals(key) || "foregroundcolour".
422
-                        equals(key)) {
423
-                    getInputField().setForeground(getContainer()
424
-                            .getConfigManager().getOptionColour(
422
+                } else if ("inputforegroundcolour".equals(key)
423
+                        || "foregroundcolour".equals(key)) {
424
+                    getInputField().setForeground(getContainer().
425
+                            getConfigManager().getOptionColour(
425 426
                             "ui", "inputforegroundcolour",
426 427
                             "ui", "foregroundcolour"));
427
-                    getInputField().setCaretColor(getContainer()
428
-                            .getConfigManager().getOptionColour(
428
+                    getInputField().setCaretColor(getContainer().
429
+                            getConfigManager().getOptionColour(
429 430
                             "ui", "inputforegroundcolour",
430 431
                             "ui", "foregroundcolour"));
431 432
                 }
432 433
             }
433 434
             if ("awayindicator".equals(key)) {
434
-                useAwayIndicator = getContainer().getConfigManager()
435
-                        .getOptionBool("ui", "awayindicator");
435
+                useAwayIndicator = getContainer().getConfigManager().
436
+                        getOptionBool("ui", "awayindicator");
436 437
             }
437 438
         }
438 439
     }

Loading…
Cancel
Save