diff --git a/data/color-schemes/BlackOnLightYellow.colorscheme b/data/color-schemes/BlackOnLightYellow.colorscheme index 29419e2a..338fa335 100644 --- a/data/color-schemes/BlackOnLightYellow.colorscheme +++ b/data/color-schemes/BlackOnLightYellow.colorscheme @@ -1,10 +1,8 @@ [Background] Color=255,255,221 -Transparent=true [BackgroundIntense] Color=255,255,221 -Transparent=true [Color0] Color=0,0,0 diff --git a/data/color-schemes/BlackOnRandomLight.colorscheme b/data/color-schemes/BlackOnRandomLight.colorscheme index d00b1dcf..8184e29c 100644 --- a/data/color-schemes/BlackOnRandomLight.colorscheme +++ b/data/color-schemes/BlackOnRandomLight.colorscheme @@ -1,11 +1,9 @@ [Background] Color=247,247,214 -Transparent=true MaxRandomHue=340 [BackgroundIntense] Color=255,255,221 -Transparent=true [Color0] Color=0,0,0 diff --git a/data/color-schemes/BlackOnWhite.colorscheme b/data/color-schemes/BlackOnWhite.colorscheme index f6ea6c41..be9ba2f1 100644 --- a/data/color-schemes/BlackOnWhite.colorscheme +++ b/data/color-schemes/BlackOnWhite.colorscheme @@ -1,10 +1,8 @@ [Background] Color=255,255,255 -Transparent=true [BackgroundIntense] Color=255,255,255 -Transparent=true [Color0] Color=0,0,0 diff --git a/data/color-schemes/BlueOnBlack.colorscheme b/data/color-schemes/BlueOnBlack.colorscheme index e24ee8c8..f72da32d 100644 --- a/data/color-schemes/BlueOnBlack.colorscheme +++ b/data/color-schemes/BlueOnBlack.colorscheme @@ -1,10 +1,8 @@ [Background] Color=0,0,0 -Transparent=false [BackgroundIntense] Color=0,0,0 -Transparent=false [Color0] Color=0,0,0 diff --git a/data/color-schemes/DarkPastels.colorscheme b/data/color-schemes/DarkPastels.colorscheme index 83c200ee..110f72bc 100644 --- a/data/color-schemes/DarkPastels.colorscheme +++ b/data/color-schemes/DarkPastels.colorscheme @@ -1,11 +1,9 @@ [Background] Color=44,44,44 -Transparent=false [BackgroundIntense] Bold=true Color=44,44,44 -Transparent=false [Color0] Color=63,63,63 diff --git a/data/color-schemes/GreenOnBlack.colorscheme b/data/color-schemes/GreenOnBlack.colorscheme index 2e97917b..df0f3b30 100644 --- a/data/color-schemes/GreenOnBlack.colorscheme +++ b/data/color-schemes/GreenOnBlack.colorscheme @@ -1,10 +1,8 @@ [Background] Color=0,0,0 -Transparent=false [BackgroundIntense] Color=0,0,0 -Transparent=false [Color0] Color=0,0,0 diff --git a/data/color-schemes/RedOnBlack.colorscheme b/data/color-schemes/RedOnBlack.colorscheme index bc197956..207f892d 100644 --- a/data/color-schemes/RedOnBlack.colorscheme +++ b/data/color-schemes/RedOnBlack.colorscheme @@ -1,10 +1,8 @@ [Background] Color=0,0,0 -Transparent=false [BackgroundIntense] Color=0,0,0 -Transparent=false [Color0] Color=0,0,0 diff --git a/data/color-schemes/Solarized.colorscheme b/data/color-schemes/Solarized.colorscheme index e66762e1..0a379cf0 100644 --- a/data/color-schemes/Solarized.colorscheme +++ b/data/color-schemes/Solarized.colorscheme @@ -1,10 +1,8 @@ [Background] Color=0,43,54 -Transparent=false [BackgroundIntense] Color=104,104,104 -Transparent=false [Color0] Color=203,75,22 diff --git a/data/color-schemes/WhiteOnBlack.colorscheme b/data/color-schemes/WhiteOnBlack.colorscheme index 2053b9f1..7307c5d4 100644 --- a/data/color-schemes/WhiteOnBlack.colorscheme +++ b/data/color-schemes/WhiteOnBlack.colorscheme @@ -1,10 +1,8 @@ [Background] Color=0,0,0 -Transparent=true [BackgroundIntense] Color=0,0,0 -Transparent=true [Color0] Color=0,0,0 diff --git a/src/Character.h b/src/Character.h index a9606fb1..27ab0f0d 100644 --- a/src/Character.h +++ b/src/Character.h @@ -122,11 +122,6 @@ public: */ bool isRealCharacter; - /** - * Returns true if this character has a transparent background when - * it is drawn with the specified @p palette. - */ - bool isTransparent(const ColorEntry* palette) const; /** * Returns true if this character should always be drawn in bold when * it is drawn with the specified @p palette, independent of whether @@ -175,14 +170,6 @@ inline bool operator != (const Character& a, const Character& b) return !operator==(a, b); } -inline bool Character::isTransparent(const ColorEntry* base) const -{ - return ((backgroundColor._colorSpace == COLOR_SPACE_DEFAULT) && - base[backgroundColor._u + 0 + (backgroundColor._v ? BASE_COLORS : 0)].transparent) - || ((backgroundColor._colorSpace == COLOR_SPACE_SYSTEM) && - base[backgroundColor._u + 2 + (backgroundColor._v ? BASE_COLORS : 0)].transparent); -} - inline bool Character::equalsFormat(const Character& other) const { return diff --git a/src/CharacterColor.h b/src/CharacterColor.h index 27878f33..032620cc 100644 --- a/src/CharacterColor.h +++ b/src/CharacterColor.h @@ -39,10 +39,6 @@ namespace Konsole * * Each entry can be set as bold, in which case any text * drawn using the color should be drawn in bold. - * - * Each entry can also be transparent, in which case the terminal - * display should avoid drawing the background for any characters - * using the entry as a background. */ class ColorEntry { @@ -64,35 +60,28 @@ public: * Constructs a new color palette entry. * * @param c The color value for this entry. - * @param tr Specifies that the color should be transparent when used as a background color. * @param weight Specifies the font weight to use when drawing text with this color. */ - ColorEntry(QColor c, bool tr, FontWeight weight = UseCurrentFormat) - : color(c), transparent(tr), fontWeight(weight) {} + ColorEntry(QColor c, FontWeight weight = UseCurrentFormat) + : color(c), fontWeight(weight) {} /** * Constructs a new color palette entry with an undefined color, and - * with the transparent and bold flags set to false. + * with the bold flags set to false. */ - ColorEntry() : transparent(false), fontWeight(UseCurrentFormat) {} + ColorEntry() : fontWeight(UseCurrentFormat) {} /** - * Sets the color, transparency and boldness of this color to those of @p rhs. + * Sets the color and boldness of this color to those of @p rhs. */ void operator=(const ColorEntry& rhs) { color = rhs.color; - transparent = rhs.transparent; fontWeight = rhs.fontWeight; } /** The color value of this entry for display. */ QColor color; - /** - * If true character backgrounds using this color should be transparent. - * This is not applicable when the color is used to render text. - */ - bool transparent; /** * Specifies the font weight to use when drawing text with this color. * This is not applicable when the color is used to draw a character's background. diff --git a/src/ColorScheme.cpp b/src/ColorScheme.cpp index 1acb4d46..493b1230 100644 --- a/src/ColorScheme.cpp +++ b/src/ColorScheme.cpp @@ -44,27 +44,27 @@ using namespace Konsole; // It contains the 8 ansiterm/xterm colors in 2 intensities. const ColorEntry ColorScheme::defaultTable[TABLE_COLORS] = { - ColorEntry(QColor(0x00, 0x00, 0x00), 0), // Dfore - ColorEntry(QColor(0xFF, 0xFF, 0xFF), 1), // Dback - ColorEntry(QColor(0x00, 0x00, 0x00), 0), // Black - ColorEntry(QColor(0xB2, 0x18, 0x18), 0), // Red - ColorEntry(QColor(0x18, 0xB2, 0x18), 0), // Green - ColorEntry(QColor(0xB2, 0x68, 0x18), 0), // Yellow - ColorEntry(QColor(0x18, 0x18, 0xB2), 0), // Blue - ColorEntry(QColor(0xB2, 0x18, 0xB2), 0), // Magenta - ColorEntry(QColor(0x18, 0xB2, 0xB2), 0), // Cyan - ColorEntry(QColor(0xB2, 0xB2, 0xB2), 0), // White + ColorEntry(QColor(0x00, 0x00, 0x00)), // Dfore + ColorEntry(QColor(0xFF, 0xFF, 0xFF)), // Dback + ColorEntry(QColor(0x00, 0x00, 0x00)), // Black + ColorEntry(QColor(0xB2, 0x18, 0x18)), // Red + ColorEntry(QColor(0x18, 0xB2, 0x18)), // Green + ColorEntry(QColor(0xB2, 0x68, 0x18)), // Yellow + ColorEntry(QColor(0x18, 0x18, 0xB2)), // Blue + ColorEntry(QColor(0xB2, 0x18, 0xB2)), // Magenta + ColorEntry(QColor(0x18, 0xB2, 0xB2)), // Cyan + ColorEntry(QColor(0xB2, 0xB2, 0xB2)), // White // intensive versions - ColorEntry(QColor(0x00, 0x00, 0x00), 0), - ColorEntry(QColor(0xFF, 0xFF, 0xFF), 1), - ColorEntry(QColor(0x68, 0x68, 0x68), 0), - ColorEntry(QColor(0xFF, 0x54, 0x54), 0), - ColorEntry(QColor(0x54, 0xFF, 0x54), 0), - ColorEntry(QColor(0xFF, 0xFF, 0x54), 0), - ColorEntry(QColor(0x54, 0x54, 0xFF), 0), - ColorEntry(QColor(0xFF, 0x54, 0xFF), 0), - ColorEntry(QColor(0x54, 0xFF, 0xFF), 0), - ColorEntry(QColor(0xFF, 0xFF, 0xFF), 0) + ColorEntry(QColor(0x00, 0x00, 0x00)), + ColorEntry(QColor(0xFF, 0xFF, 0xFF)), + ColorEntry(QColor(0x68, 0x68, 0x68)), + ColorEntry(QColor(0xFF, 0x54, 0x54)), + ColorEntry(QColor(0x54, 0xFF, 0x54)), + ColorEntry(QColor(0xFF, 0xFF, 0x54)), + ColorEntry(QColor(0x54, 0x54, 0xFF)), + ColorEntry(QColor(0xFF, 0x54, 0xFF)), + ColorEntry(QColor(0x54, 0xFF, 0xFF)), + ColorEntry(QColor(0xFF, 0xFF, 0xFF)) }; const char* const ColorScheme::colorNames[TABLE_COLORS] = { @@ -310,7 +310,6 @@ void ColorScheme::readColorEntry(const KConfig& config , int index) ColorEntry entry; entry.color = configGroup.readEntry("Color", QColor()); - entry.transparent = configGroup.readEntry("Transparent", false); // Deprecated key from KDE 4.0 which set 'Bold' to true to force // a color to be bold or false to use the current format @@ -351,7 +350,9 @@ void ColorScheme::writeColorEntry(KConfig& config , int index) const const ColorEntry& entry = colorTable()[index]; configGroup.writeEntry("Color", entry.color); - configGroup.writeEntry("Transparent", (bool)entry.transparent); + if ( configGroup.hasKey("Transparent") ) { + configGroup.deleteEntry("Transparent"); + } if (entry.fontWeight != ColorEntry::UseCurrentFormat) { configGroup.writeEntry("Bold", entry.fontWeight == ColorEntry::Bold); } diff --git a/src/ColorSchemeManager.cpp b/src/ColorSchemeManager.cpp index acc0be58..6463380d 100644 --- a/src/ColorSchemeManager.cpp +++ b/src/ColorSchemeManager.cpp @@ -133,7 +133,6 @@ bool KDE3ColorSchemeReader::readColorLine(const QString& line, ColorScheme* sche ColorEntry entry; entry.color = QColor(red, green, blue); - entry.transparent = (transparent != 0); entry.fontWeight = (bold != 0) ? ColorEntry::Bold : ColorEntry::UseCurrentFormat; scheme->setColorTableEntry(index, entry); diff --git a/src/TerminalCharacterDecoder.cpp b/src/TerminalCharacterDecoder.cpp index bec612d1..550ce29b 100644 --- a/src/TerminalCharacterDecoder.cpp +++ b/src/TerminalCharacterDecoder.cpp @@ -210,9 +210,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP if (_colorTable) { style.append(QString("color:%1;").arg(_lastForeColor.color(_colorTable).name())); - if (!characters[i].isTransparent(_colorTable)) { - style.append(QString("background-color:%1;").arg(_lastBackColor.color(_colorTable).name())); - } + style.append(QString("background-color:%1;").arg(_lastBackColor.color(_colorTable).name())); } //open the span with the current style