Procházet zdrojové kódy

Remove legacy default colour behaviour.

We now specify the default colour using display properties, not
by ascribing special value to the first colour code in a message.

Closes #741
pull/772/head
Chris Smith před 7 roky
rodič
revize
ab84f1d094
1 změnil soubory, kde provedl 3 přidání a 24 odebrání
  1. 3
    24
      src/main/java/com/dmdirc/ui/messages/Styliser.java

+ 3
- 24
src/main/java/com/dmdirc/ui/messages/Styliser.java Zobrazit soubor

146
                 position += next.length();
146
                 position += next.length();
147
 
147
 
148
                 if (position < target.length()) {
148
                 if (position < target.length()) {
149
-                    position += readControlChars(target.substring(position), state, maker,
150
-                            position == 0);
149
+                    position += readControlChars(target.substring(position), state, maker);
151
                 }
150
                 }
152
             }
151
             }
153
         }
152
         }
258
      * applies it to the specified attribute set.
257
      * applies it to the specified attribute set.
259
      *
258
      *
260
      * @return The number of characters read as control characters
259
      * @return The number of characters read as control characters
261
-     *@param string  The string to read from
260
+     * @param string  The string to read from
262
      * @param maker The attribute set that new attributes will be applied to
261
      * @param maker The attribute set that new attributes will be applied to
263
-     * @param isStart Whether this is at the start of the string or not
264
      */
262
      */
265
-    private int readControlChars(final String string,
266
-            final StyliserState state,
267
-            final StyledMessageMaker<?> maker, final boolean isStart) {
263
+    private int readControlChars(final String string, final StyliserState state, final StyledMessageMaker<?> maker) {
268
         final boolean isNegated = state.isNegated;
264
         final boolean isNegated = state.isNegated;
269
 
265
 
270
         // Bold
266
         // Bold
375
                 if (!isNegated) {
371
                 if (!isNegated) {
376
                     maker.setForeground(colourManager.getColourFromString(
372
                     maker.setForeground(colourManager.getColourFromString(
377
                             String.valueOf(foreground), Colour.WHITE));
373
                             String.valueOf(foreground), Colour.WHITE));
378
-                    if (isStart) {
379
-                        maker.setDefaultForeground(colourManager
380
-                                .getColourFromString(String.valueOf(foreground), Colour.WHITE));
381
-                    }
382
                 }
374
                 }
383
 
375
 
384
                 // Now background
376
                 // Now background
396
                     if (!isNegated) {
388
                     if (!isNegated) {
397
                         maker.setBackground(colourManager
389
                         maker.setBackground(colourManager
398
                                 .getColourFromString(String.valueOf(background), Colour.WHITE));
390
                                 .getColourFromString(String.valueOf(background), Colour.WHITE));
399
-                        if (isStart) {
400
-                            maker.setDefaultBackground(colourManager
401
-                                    .getColourFromString(String.valueOf(background), Colour.WHITE));
402
-                        }
403
                     }
391
                     }
404
                 }
392
                 }
405
             } else if (!isNegated) {
393
             } else if (!isNegated) {
416
                     maker.setForeground(
404
                     maker.setForeground(
417
                             colourManager.getColourFromString(string.substring(1, 7).toUpperCase(),
405
                             colourManager.getColourFromString(string.substring(1, 7).toUpperCase(),
418
                                     Colour.WHITE));
406
                                     Colour.WHITE));
419
-                    if (isStart) {
420
-                        maker.setDefaultForeground(
421
-                                colourManager.getColourFromString(
422
-                                        string.substring(1, 7).toUpperCase(), Colour.WHITE));
423
-                    }
424
                 }
407
                 }
425
 
408
 
426
                 count += 6;
409
                 count += 6;
435
                     if (!isNegated) {
418
                     if (!isNegated) {
436
                         maker.setBackground(colourManager.getColourFromString(
419
                         maker.setBackground(colourManager.getColourFromString(
437
                                 string.substring(count, count + 6).toUpperCase(), Colour.WHITE));
420
                                 string.substring(count, count + 6).toUpperCase(), Colour.WHITE));
438
-                        if (isStart) {
439
-                            maker.setDefaultBackground(colourManager.getColourFromString(
440
-                                    string.substring(count, count + 6).toUpperCase(), Colour.WHITE));
441
-                        }
442
                     }
421
                     }
443
 
422
 
444
                     count += 6;
423
                     count += 6;

Načítá se…
Zrušit
Uložit