Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
91d7001e
Commit
91d7001e
authored
Dec 14, 2020
by
Gustavo Carneiro
Committed by
Tomaz Canabrava
Dec 18, 2020
Browse files
Rename ColorEntry to QColor.
parent
3480514e
Changes
13
Hide whitespace changes
Inline
Side-by-side
src/autotests/CharacterColorTest.cpp
View file @
91d7001e
...
...
@@ -14,40 +14,40 @@
using
namespace
Konsole
;
const
Color
Entry
CharacterColorTest
::
DefaultColorTable
[
TABLE_COLORS
]
=
{
Color
Entry
(
0x00
,
0x00
,
0x00
),
// Dfore
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
// Dback
Color
Entry
(
0x00
,
0x00
,
0x00
),
// Black
Color
Entry
(
0xB2
,
0x18
,
0x18
),
// Red
Color
Entry
(
0x18
,
0xB2
,
0x18
),
// Green
Color
Entry
(
0xB2
,
0x68
,
0x18
),
// Yellow
Color
Entry
(
0x18
,
0x18
,
0xB2
),
// Blue
Color
Entry
(
0xB2
,
0x18
,
0xB2
),
// Magenta
Color
Entry
(
0x18
,
0xB2
,
0xB2
),
// Cyan
Color
Entry
(
0xB2
,
0xB2
,
0xB2
),
// White
const
Q
Color
CharacterColorTest
::
DefaultColorTable
[
TABLE_COLORS
]
=
{
Q
Color
(
0x00
,
0x00
,
0x00
),
// Dfore
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
// Dback
Q
Color
(
0x00
,
0x00
,
0x00
),
// Black
Q
Color
(
0xB2
,
0x18
,
0x18
),
// Red
Q
Color
(
0x18
,
0xB2
,
0x18
),
// Green
Q
Color
(
0xB2
,
0x68
,
0x18
),
// Yellow
Q
Color
(
0x18
,
0x18
,
0xB2
),
// Blue
Q
Color
(
0xB2
,
0x18
,
0xB2
),
// Magenta
Q
Color
(
0x18
,
0xB2
,
0xB2
),
// Cyan
Q
Color
(
0xB2
,
0xB2
,
0xB2
),
// White
// intensive versions
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Color
Entry
(
0x68
,
0x68
,
0x68
),
Color
Entry
(
0xFF
,
0x54
,
0x54
),
Color
Entry
(
0x54
,
0xFF
,
0x54
),
Color
Entry
(
0xFF
,
0xFF
,
0x54
),
Color
Entry
(
0x54
,
0x54
,
0xFF
),
Color
Entry
(
0xFF
,
0x54
,
0xFF
),
Color
Entry
(
0x54
,
0xFF
,
0xFF
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x68
,
0x68
,
0x68
),
Q
Color
(
0xFF
,
0x54
,
0x54
),
Q
Color
(
0x54
,
0xFF
,
0x54
),
Q
Color
(
0xFF
,
0xFF
,
0x54
),
Q
Color
(
0x54
,
0x54
,
0xFF
),
Q
Color
(
0xFF
,
0x54
,
0xFF
),
Q
Color
(
0x54
,
0xFF
,
0xFF
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
// Here are faint intensities, which may not be good.
// faint versions
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0x65
,
0x00
,
0x00
),
Color
Entry
(
0x00
,
0x65
,
0x00
),
Color
Entry
(
0x65
,
0x5E
,
0x00
),
Color
Entry
(
0x00
,
0x00
,
0x65
),
Color
Entry
(
0x65
,
0x00
,
0x65
),
Color
Entry
(
0x00
,
0x65
,
0x65
),
Color
Entry
(
0x65
,
0x65
,
0x65
)
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0x65
,
0x00
,
0x00
),
Q
Color
(
0x00
,
0x65
,
0x00
),
Q
Color
(
0x65
,
0x5E
,
0x00
),
Q
Color
(
0x00
,
0x00
,
0x65
),
Q
Color
(
0x65
,
0x00
,
0x65
),
Q
Color
(
0x00
,
0x65
,
0x65
),
Q
Color
(
0x65
,
0x65
,
0x65
)
};
void
CharacterColorTest
::
init
()
...
...
@@ -60,10 +60,10 @@ void CharacterColorTest::cleanup()
void
CharacterColorTest
::
testColorEntry
()
{
Color
Entry
black
=
Color
Entry
(
0x00
,
0x00
,
0x00
);
Color
Entry
white
=
Color
Entry
(
0xFF
,
0xFF
,
0xFF
);
Color
Entry
red
=
Color
Entry
(
0xB2
,
0x18
,
0x18
);
Color
Entry
green
=
Color
Entry
(
0x18
,
0xB2
,
0x18
);
Q
Color
black
=
Q
Color
(
0x00
,
0x00
,
0x00
);
Q
Color
white
=
Q
Color
(
0xFF
,
0xFF
,
0xFF
);
Q
Color
red
=
Q
Color
(
0xB2
,
0x18
,
0x18
);
Q
Color
green
=
Q
Color
(
0x18
,
0xB2
,
0x18
);
// Test operator== operator!=
QCOMPARE
(
black
==
white
,
false
);
...
...
@@ -75,13 +75,13 @@ void CharacterColorTest::testColorEntry()
QCOMPARE
(
red
!=
green
,
true
);
// Test operator=
Color
Entry
tmpColorEntry
;
Q
Color
tmpColorEntry
;
tmpColorEntry
=
red
;
QCOMPARE
(
tmpColorEntry
==
red
,
true
);
QCOMPARE
(
red
==
tmpColorEntry
,
true
);
// Test Color
Entry
()
Color
Entry
defaultColorEntry
=
Color
Entry
();
// Test
Q
Color()
Q
Color
defaultColorEntry
=
Q
Color
();
QCOMPARE
(
defaultColorEntry
!=
green
,
true
);
QCOMPARE
(
defaultColorEntry
!=
black
,
true
);
QCOMPARE
(
defaultColorEntry
.
isValid
(),
false
);
...
...
src/autotests/CharacterColorTest.h
View file @
91d7001e
...
...
@@ -35,7 +35,7 @@ private Q_SLOTS:
void
testColor256
();
private:
static
const
Color
Entry
DefaultColorTable
[];
static
const
Q
Color
DefaultColorTable
[];
};
}
...
...
src/autotests/TerminalTest.cpp
View file @
91d7001e
...
...
@@ -37,30 +37,30 @@ void TerminalTest::testScrollBarPositions()
void
TerminalTest
::
testColorTable
()
{
// These are from ColorScheme.cpp but they can be anything to test
const
Color
Entry
defaultTable
[
TABLE_COLORS
]
=
{
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0xB2
,
0x18
,
0x18
),
Color
Entry
(
0x18
,
0xB2
,
0x18
),
Color
Entry
(
0xB2
,
0x68
,
0x18
),
Color
Entry
(
0x18
,
0x18
,
0xB2
),
Color
Entry
(
0xB2
,
0x18
,
0xB2
),
Color
Entry
(
0x18
,
0xB2
,
0xB2
),
Color
Entry
(
0xB2
,
0xB2
,
0xB2
),
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Color
Entry
(
0x68
,
0x68
,
0x68
),
Color
Entry
(
0xFF
,
0x54
,
0x54
),
Color
Entry
(
0x54
,
0xFF
,
0x54
),
Color
Entry
(
0xFF
,
0xFF
,
0x54
),
Color
Entry
(
0x54
,
0x54
,
0xFF
),
Color
Entry
(
0xFF
,
0x54
,
0xFF
),
Color
Entry
(
0x54
,
0xFF
,
0xFF
),
Color
Entry
(
0x00
,
0xFF
,
0xFF
)
const
Q
Color
defaultTable
[
TABLE_COLORS
]
=
{
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0xB2
,
0x18
,
0x18
),
Q
Color
(
0x18
,
0xB2
,
0x18
),
Q
Color
(
0xB2
,
0x68
,
0x18
),
Q
Color
(
0x18
,
0x18
,
0xB2
),
Q
Color
(
0xB2
,
0x18
,
0xB2
),
Q
Color
(
0x18
,
0xB2
,
0xB2
),
Q
Color
(
0xB2
,
0xB2
,
0xB2
),
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x68
,
0x68
,
0x68
),
Q
Color
(
0xFF
,
0x54
,
0x54
),
Q
Color
(
0x54
,
0xFF
,
0x54
),
Q
Color
(
0xFF
,
0xFF
,
0x54
),
Q
Color
(
0x54
,
0x54
,
0xFF
),
Q
Color
(
0xFF
,
0x54
,
0xFF
),
Q
Color
(
0x54
,
0xFF
,
0xFF
),
Q
Color
(
0x00
,
0xFF
,
0xFF
)
};
auto
display
=
new
TerminalDisplay
(
nullptr
);
display
->
terminalColor
()
->
setColorTable
(
defaultTable
);
const
Color
Entry
*
colorTable
=
display
->
terminalColor
()
->
colorTable
();
const
Q
Color
*
colorTable
=
display
->
terminalColor
()
->
colorTable
();
for
(
int
i
=
0
;
i
<
TABLE_COLORS
;
i
++
)
{
QCOMPARE
(
colorTable
[
i
],
defaultTable
[
i
]);
}
Color
Entry
colorEntry
=
Color
Entry
(
0x00
,
0x00
,
0x00
);
Q
Color
colorEntry
=
Q
Color
(
0x00
,
0x00
,
0x00
);
QVERIFY
(
colorTable
[
1
]
!=
colorEntry
);
delete
display
;
...
...
src/characters/CharacterColor.h
View file @
91d7001e
...
...
@@ -12,13 +12,6 @@
#include <QColor>
namespace
Konsole
{
/**
* An entry in a terminal display's color palette.
*
* A color palette is an array of 16 ColorEntry instances which map
* system color indexes (from 0 to 15) into actual colors.
*/
typedef
QColor
ColorEntry
;
// Attributed Character Representations ///////////////////////////////
...
...
@@ -177,7 +170,7 @@ public:
* The @p base is only used if this color is one of the 16 system colors, otherwise
* it is ignored.
*/
QColor
color
(
const
Color
Entry
*
base
)
const
;
QColor
color
(
const
Q
Color
*
base
)
const
;
/**
* Compares two colors and returns true if they represent the same color value and
...
...
@@ -212,7 +205,7 @@ inline bool operator !=(const CharacterColor &a, const CharacterColor &b)
return
!
operator
==
(
a
,
b
);
}
inline
const
QColor
color256
(
quint8
u
,
const
Color
Entry
*
base
)
inline
const
QColor
color256
(
quint8
u
,
const
Q
Color
*
base
)
{
// 0.. 16: system colors
if
(
u
<
8
)
{
...
...
@@ -238,7 +231,7 @@ inline const QColor color256(quint8 u, const ColorEntry *base)
return
QColor
(
gray
,
gray
,
gray
);
}
inline
QColor
CharacterColor
::
color
(
const
Color
Entry
*
base
)
const
inline
QColor
CharacterColor
::
color
(
const
Q
Color
*
base
)
const
{
switch
(
_colorSpace
)
{
case
COLOR_SPACE_DEFAULT
:
...
...
src/colorscheme/ColorScheme.cpp
View file @
91d7001e
...
...
@@ -43,40 +43,40 @@ using namespace Konsole;
// The following are almost IBM standard color codes, with some slight
// gamma correction for the dim colors to compensate for bright X screens.
// It contains the 8 ansiterm/xterm colors in 2 intensities.
const
Color
Entry
ColorScheme
::
defaultTable
[
TABLE_COLORS
]
=
{
Color
Entry
(
0x00
,
0x00
,
0x00
),
// Dfore
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
// Dback
Color
Entry
(
0x00
,
0x00
,
0x00
),
// Black
Color
Entry
(
0xB2
,
0x18
,
0x18
),
// Red
Color
Entry
(
0x18
,
0xB2
,
0x18
),
// Green
Color
Entry
(
0xB2
,
0x68
,
0x18
),
// Yellow
Color
Entry
(
0x18
,
0x18
,
0xB2
),
// Blue
Color
Entry
(
0xB2
,
0x18
,
0xB2
),
// Magenta
Color
Entry
(
0x18
,
0xB2
,
0xB2
),
// Cyan
Color
Entry
(
0xB2
,
0xB2
,
0xB2
),
// White
const
Q
Color
ColorScheme
::
defaultTable
[
TABLE_COLORS
]
=
{
Q
Color
(
0x00
,
0x00
,
0x00
),
// Dfore
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
// Dback
Q
Color
(
0x00
,
0x00
,
0x00
),
// Black
Q
Color
(
0xB2
,
0x18
,
0x18
),
// Red
Q
Color
(
0x18
,
0xB2
,
0x18
),
// Green
Q
Color
(
0xB2
,
0x68
,
0x18
),
// Yellow
Q
Color
(
0x18
,
0x18
,
0xB2
),
// Blue
Q
Color
(
0xB2
,
0x18
,
0xB2
),
// Magenta
Q
Color
(
0x18
,
0xB2
,
0xB2
),
// Cyan
Q
Color
(
0xB2
,
0xB2
,
0xB2
),
// White
// intensive versions
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Color
Entry
(
0x68
,
0x68
,
0x68
),
Color
Entry
(
0xFF
,
0x54
,
0x54
),
Color
Entry
(
0x54
,
0xFF
,
0x54
),
Color
Entry
(
0xFF
,
0xFF
,
0x54
),
Color
Entry
(
0x54
,
0x54
,
0xFF
),
Color
Entry
(
0xFF
,
0x54
,
0xFF
),
Color
Entry
(
0x54
,
0xFF
,
0xFF
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x68
,
0x68
,
0x68
),
Q
Color
(
0xFF
,
0x54
,
0x54
),
Q
Color
(
0x54
,
0xFF
,
0x54
),
Q
Color
(
0xFF
,
0xFF
,
0x54
),
Q
Color
(
0x54
,
0x54
,
0xFF
),
Q
Color
(
0xFF
,
0x54
,
0xFF
),
Q
Color
(
0x54
,
0xFF
,
0xFF
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
// Here are faint intensities, which may not be good.
// faint versions
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0xFF
,
0xFF
,
0xFF
),
Color
Entry
(
0x00
,
0x00
,
0x00
),
Color
Entry
(
0x65
,
0x00
,
0x00
),
Color
Entry
(
0x00
,
0x65
,
0x00
),
Color
Entry
(
0x65
,
0x5E
,
0x00
),
Color
Entry
(
0x00
,
0x00
,
0x65
),
Color
Entry
(
0x65
,
0x00
,
0x65
),
Color
Entry
(
0x00
,
0x65
,
0x65
),
Color
Entry
(
0x65
,
0x65
,
0x65
)
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0xFF
,
0xFF
,
0xFF
),
Q
Color
(
0x00
,
0x00
,
0x00
),
Q
Color
(
0x65
,
0x00
,
0x00
),
Q
Color
(
0x00
,
0x65
,
0x00
),
Q
Color
(
0x65
,
0x5E
,
0x00
),
Q
Color
(
0x00
,
0x00
,
0x65
),
Q
Color
(
0x65
,
0x00
,
0x65
),
Q
Color
(
0x00
,
0x65
,
0x65
),
Q
Color
(
0x65
,
0x65
,
0x65
)
};
const
char
*
const
ColorScheme
::
colorNames
[
TABLE_COLORS
]
=
{
...
...
@@ -224,12 +224,12 @@ QString ColorScheme::name() const
return
_name
;
}
void
ColorScheme
::
setColorTableEntry
(
int
index
,
const
Color
Entry
&
entry
)
void
ColorScheme
::
setColorTableEntry
(
int
index
,
const
Q
Color
&
entry
)
{
Q_ASSERT
(
index
>=
0
&&
index
<
TABLE_COLORS
);
if
(
_table
==
nullptr
)
{
_table
=
new
Color
Entry
[
TABLE_COLORS
];
_table
=
new
Q
Color
[
TABLE_COLORS
];
for
(
int
i
=
0
;
i
<
TABLE_COLORS
;
i
++
)
{
_table
[
i
]
=
defaultTable
[
i
];
...
...
@@ -244,11 +244,11 @@ void ColorScheme::setColorTableEntry(int index, const ColorEntry &entry)
}
}
Color
Entry
ColorScheme
::
colorEntry
(
int
index
,
uint
randomSeed
)
const
Q
Color
ColorScheme
::
colorEntry
(
int
index
,
uint
randomSeed
)
const
{
Q_ASSERT
(
index
>=
0
&&
index
<
TABLE_COLORS
);
Color
Entry
entry
=
colorTable
()[
index
];
Q
Color
entry
=
colorTable
()[
index
];
if
(
!
_colorRandomization
||
randomSeed
==
0
||
_randomTable
==
nullptr
||
_randomTable
[
index
].
isNull
())
{
...
...
@@ -320,7 +320,7 @@ ColorEntry ColorScheme::colorEntry(int index, uint randomSeed) const
return
{
qRound
(
red
*
255
),
qRound
(
green
*
255
),
qRound
(
blue
*
255
)};
}
void
ColorScheme
::
getColorTable
(
Color
Entry
*
table
,
uint
randomSeed
)
const
void
ColorScheme
::
getColorTable
(
Q
Color
*
table
,
uint
randomSeed
)
const
{
for
(
int
i
=
0
;
i
<
TABLE_COLORS
;
i
++
)
{
table
[
i
]
=
colorEntry
(
i
,
randomSeed
);
...
...
@@ -370,7 +370,7 @@ void ColorScheme::setRandomizationRange(int index, double hue, double saturation
_randomTable
[
index
].
lightness
=
lightness
;
}
const
Color
Entry
*
ColorScheme
::
colorTable
()
const
const
Q
Color
*
ColorScheme
::
colorTable
()
const
{
if
(
_table
!=
nullptr
)
{
return
_table
;
...
...
@@ -450,7 +450,7 @@ void ColorScheme::readColorEntry(const KConfig &config, int index)
return
;
}
Color
Entry
entry
;
Q
Color
entry
;
entry
=
configGroup
.
readEntry
(
"Color"
,
QColor
());
setColorTableEntry
(
index
,
entry
);
...
...
@@ -496,7 +496,7 @@ void ColorScheme::writeColorEntry(KConfig &config, int index) const
{
KConfigGroup
configGroup
=
config
.
group
(
colorNameForIndex
(
index
));
const
Color
Entry
&
entry
=
colorTable
()[
index
];
const
Q
Color
&
entry
=
colorTable
()[
index
];
configGroup
.
writeEntry
(
"Color"
,
entry
);
...
...
src/colorscheme/ColorScheme.h
View file @
91d7001e
...
...
@@ -57,7 +57,7 @@ public:
void
write
(
KConfig
&
config
)
const
;
/** Sets a single entry within the color palette. */
void
setColorTableEntry
(
int
index
,
const
Color
Entry
&
entry
);
void
setColorTableEntry
(
int
index
,
const
Q
Color
&
entry
);
/**
* Copies the color entries which form the palette for this color scheme
...
...
@@ -68,14 +68,14 @@ public:
* @param randomSeed Color schemes may allow certain colors in their
* palette to be randomized. The seed is used to pick the random color.
*/
void
getColorTable
(
Color
Entry
*
table
,
uint
randomSeed
=
0
)
const
;
void
getColorTable
(
Q
Color
*
table
,
uint
randomSeed
=
0
)
const
;
/**
* Retrieves a single color entry from the table.
*
* See getColorTable()
*/
Color
Entry
colorEntry
(
int
index
,
uint
randomSeed
=
0
)
const
;
Q
Color
colorEntry
(
int
index
,
uint
randomSeed
=
0
)
const
;
/**
* Convenience method. Returns the
...
...
@@ -140,7 +140,7 @@ public:
/** Returns true if color randomization is enabled. */
bool
isColorRandomizationEnabled
()
const
;
static
const
Color
Entry
defaultTable
[];
// table of default color entries
static
const
Q
Color
defaultTable
[];
// table of default color entries
static
QString
colorNameForIndex
(
int
index
);
static
QString
translatedColorNameForIndex
(
int
index
);
...
...
@@ -168,7 +168,7 @@ private:
// returns the active color table. if none has been set specifically,
// this is the default color table.
const
Color
Entry
*
colorTable
()
const
;
const
Q
Color
*
colorTable
()
const
;
// reads a single color entry from a KConfig source
// and sets the palette entry at 'index' to the entry read.
...
...
@@ -186,7 +186,7 @@ private:
// pointer to custom color table, or 0 if the default color table is
// being used
Color
Entry
*
_table
;
Q
Color
*
_table
;
// pointer to randomization table, or 0 if no colors in the color
// scheme support randomization
...
...
src/colorscheme/ColorSchemeEditor.cpp
View file @
91d7001e
...
...
@@ -174,7 +174,7 @@ void ColorSchemeEditor::editColorItem(QTableWidgetItem *item)
colorSchemeRow
+=
2
*
COLOR_TABLE_ROW_LENGTH
;
}
Color
Entry
entry
(
_colors
->
colorEntry
(
colorSchemeRow
));
Q
Color
entry
(
_colors
->
colorEntry
(
colorSchemeRow
));
entry
=
color
;
_colors
->
setColorTableEntry
(
colorSchemeRow
,
entry
);
...
...
@@ -284,7 +284,7 @@ void ColorSchemeEditor::setup(const ColorScheme *scheme, bool isNewScheme)
void
ColorSchemeEditor
::
setupColorTable
(
const
ColorScheme
*
colors
)
{
Color
Entry
table
[
TABLE_COLORS
];
Q
Color
table
[
TABLE_COLORS
];
colors
->
getColorTable
(
table
);
for
(
int
row
=
0
;
row
<
COLOR_TABLE_ROW_LENGTH
;
row
++
)
{
...
...
src/decoders/HTMLDecoder.h
View file @
91d7001e
...
...
@@ -39,7 +39,7 @@ namespace Konsole
QTextStream
*
_output
;
QString
_colorSchemeName
;
QFont
_profileFont
;
Color
Entry
_colorTable
[
TABLE_COLORS
];
Q
Color
_colorTable
[
TABLE_COLORS
];
bool
_innerSpanOpen
;
RenditionFlags
_lastRendition
;
CharacterColor
_lastForeColor
;
...
...
src/terminalDisplay/TerminalColor.cpp
View file @
91d7001e
...
...
@@ -32,7 +32,7 @@ namespace Konsole
void
TerminalColor
::
applyProfile
(
const
Profile
::
Ptr
&
profile
,
ColorScheme
const
*
colorScheme
,
int
randomSeed
)
{
Color
Entry
table
[
TABLE_COLORS
];
Q
Color
table
[
TABLE_COLORS
];
colorScheme
->
getColorTable
(
table
,
randomSeed
);
setColorTable
(
table
);
setOpacity
(
colorScheme
->
opacity
());
...
...
@@ -51,7 +51,7 @@ namespace Konsole
return
m_colorTable
[
DEFAULT_FORE_COLOR
];
}
void
TerminalColor
::
setColorTable
(
const
Color
Entry
*
table
)
void
TerminalColor
::
setColorTable
(
const
Q
Color
*
table
)
{
for
(
int
index
=
0
;
index
<
TABLE_COLORS
;
index
++
)
{
m_colorTable
[
index
]
=
table
[
index
];
...
...
@@ -60,7 +60,7 @@ namespace Konsole
onColorsChanged
();
}
const
Color
Entry
*
TerminalColor
::
colorTable
()
const
const
Q
Color
*
TerminalColor
::
colorTable
()
const
{
return
m_colorTable
;
}
...
...
@@ -148,7 +148,7 @@ namespace Konsole
void
TerminalColor
::
swapFGBGColors
()
{
Color
Entry
color
=
m_colorTable
[
DEFAULT_BACK_COLOR
];
Q
Color
color
=
m_colorTable
[
DEFAULT_BACK_COLOR
];
m_colorTable
[
DEFAULT_BACK_COLOR
]
=
m_colorTable
[
DEFAULT_FORE_COLOR
];
m_colorTable
[
DEFAULT_FORE_COLOR
]
=
color
;
...
...
src/terminalDisplay/TerminalColor.h
View file @
91d7001e
...
...
@@ -34,8 +34,8 @@ namespace Konsole
QColor
backgroundColor
()
const
;
QColor
foregroundColor
()
const
;
void
setColorTable
(
const
Color
Entry
*
table
);
const
Color
Entry
*
colorTable
()
const
;
void
setColorTable
(
const
Q
Color
*
table
);
const
Q
Color
*
colorTable
()
const
;
void
setOpacity
(
qreal
opacity
);
...
...
@@ -75,7 +75,7 @@ namespace Konsole
QColor
m_cursorColor
;
QColor
m_cursorTextColor
;
Color
Entry
m_colorTable
[
TABLE_COLORS
];
Q
Color
m_colorTable
[
TABLE_COLORS
];
};
}
...
...
src/terminalDisplay/TerminalDisplay.h
View file @
91d7001e
...
...
@@ -699,7 +699,7 @@ private:
int
_imageSize
;
QVector
<
LineProperty
>
_lineProperties
;
Color
Entry
_colorTable
[
TABLE_COLORS
];
Q
Color
_colorTable
[
TABLE_COLORS
];
uint
_randomSeed
;
...
...
src/terminalDisplay/TerminalPainter.cpp
View file @
91d7001e
...
...
@@ -332,7 +332,7 @@ namespace Konsole
}
void
TerminalPainter
::
drawTextFragment
(
QPainter
&
painter
,
const
QRect
&
rect
,
const
QString
&
text
,
const
Character
*
style
,
const
Color
Entry
*
colorTable
)
const
Character
*
style
,
const
Q
Color
*
colorTable
)
{
// setup painter
const
QColor
foregroundColor
=
style
->
foregroundColor
.
color
(
colorTable
);
...
...
src/terminalDisplay/TerminalPainter.h
View file @
91d7001e
...
...
@@ -81,7 +81,7 @@ namespace Konsole
// draws a section of text, all the text in this section
// has a common color and style
void
drawTextFragment
(
QPainter
&
painter
,
const
QRect
&
rect
,
const
QString
&
text
,
const
Character
*
style
,
const
Color
Entry
*
colorTable
);
const
Character
*
style
,
const
Q
Color
*
colorTable
);
void
drawPrinterFriendlyTextFragment
(
QPainter
&
painter
,
const
QRect
&
rect
,
const
QString
&
text
,
const
Character
*
style
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment