Remove code for per-color transparency

That per-color transparency looks like a heritage of the pesudo
transparency in the KDE3 era. It is basically not used in current code.
wilder-portage
Jekyll Wu 14 years ago
parent f5eb5ce5e9
commit 001a353a46
  1. 2
      data/color-schemes/BlackOnLightYellow.colorscheme
  2. 2
      data/color-schemes/BlackOnRandomLight.colorscheme
  3. 2
      data/color-schemes/BlackOnWhite.colorscheme
  4. 2
      data/color-schemes/BlueOnBlack.colorscheme
  5. 2
      data/color-schemes/DarkPastels.colorscheme
  6. 2
      data/color-schemes/GreenOnBlack.colorscheme
  7. 2
      data/color-schemes/RedOnBlack.colorscheme
  8. 2
      data/color-schemes/Solarized.colorscheme
  9. 2
      data/color-schemes/WhiteOnBlack.colorscheme
  10. 13
      src/Character.h
  11. 21
      src/CharacterColor.h
  12. 45
      src/ColorScheme.cpp
  13. 1
      src/ColorSchemeManager.cpp
  14. 4
      src/TerminalCharacterDecoder.cpp

@ -1,10 +1,8 @@
[Background]
Color=255,255,221
Transparent=true
[BackgroundIntense]
Color=255,255,221
Transparent=true
[Color0]
Color=0,0,0

@ -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

@ -1,10 +1,8 @@
[Background]
Color=255,255,255
Transparent=true
[BackgroundIntense]
Color=255,255,255
Transparent=true
[Color0]
Color=0,0,0

@ -1,10 +1,8 @@
[Background]
Color=0,0,0
Transparent=false
[BackgroundIntense]
Color=0,0,0
Transparent=false
[Color0]
Color=0,0,0

@ -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

@ -1,10 +1,8 @@
[Background]
Color=0,0,0
Transparent=false
[BackgroundIntense]
Color=0,0,0
Transparent=false
[Color0]
Color=0,0,0

@ -1,10 +1,8 @@
[Background]
Color=0,0,0
Transparent=false
[BackgroundIntense]
Color=0,0,0
Transparent=false
[Color0]
Color=0,0,0

@ -1,10 +1,8 @@
[Background]
Color=0,43,54
Transparent=false
[BackgroundIntense]
Color=104,104,104
Transparent=false
[Color0]
Color=203,75,22

@ -1,10 +1,8 @@
[Background]
Color=0,0,0
Transparent=true
[BackgroundIntense]
Color=0,0,0
Transparent=true
[Color0]
Color=0,0,0

@ -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

@ -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.

@ -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);
}

@ -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);

@ -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

Loading…
Cancel
Save