* Remove the setting for a fixed cursor color. Instead, the cursor now inverts the colors of the char below it.
* This allows getting a cursor well visible both on black and white backgrouds. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39183 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -75,8 +75,6 @@ AppearancePrefView::AppearancePrefView(const char* name,
|
|||||||
const char* kColorTable[] = {
|
const char* kColorTable[] = {
|
||||||
PREF_TEXT_FORE_COLOR,
|
PREF_TEXT_FORE_COLOR,
|
||||||
PREF_TEXT_BACK_COLOR,
|
PREF_TEXT_BACK_COLOR,
|
||||||
PREF_CURSOR_FORE_COLOR,
|
|
||||||
PREF_CURSOR_BACK_COLOR,
|
|
||||||
PREF_SELECT_FORE_COLOR,
|
PREF_SELECT_FORE_COLOR,
|
||||||
PREF_SELECT_BACK_COLOR,
|
PREF_SELECT_BACK_COLOR,
|
||||||
NULL
|
NULL
|
||||||
@@ -301,8 +299,6 @@ AppearancePrefView::_ChangeColorSchema(color_schema* schema)
|
|||||||
|
|
||||||
pref->setRGB(PREF_TEXT_FORE_COLOR, schema->text_fore_color);
|
pref->setRGB(PREF_TEXT_FORE_COLOR, schema->text_fore_color);
|
||||||
pref->setRGB(PREF_TEXT_BACK_COLOR, schema->text_back_color);
|
pref->setRGB(PREF_TEXT_BACK_COLOR, schema->text_back_color);
|
||||||
pref->setRGB(PREF_CURSOR_FORE_COLOR, schema->cursor_fore_color);
|
|
||||||
pref->setRGB(PREF_CURSOR_BACK_COLOR, schema->cursor_back_color);
|
|
||||||
pref->setRGB(PREF_SELECT_FORE_COLOR, schema->select_fore_color);
|
pref->setRGB(PREF_SELECT_FORE_COLOR, schema->select_fore_color);
|
||||||
pref->setRGB(PREF_SELECT_BACK_COLOR, schema->select_back_color);
|
pref->setRGB(PREF_SELECT_BACK_COLOR, schema->select_back_color);
|
||||||
}
|
}
|
||||||
@@ -315,8 +311,6 @@ AppearancePrefView::_SetCurrentColorSchema(BMenuField* field)
|
|||||||
|
|
||||||
gCustomSchema.text_fore_color = pref->getRGB(PREF_TEXT_FORE_COLOR);
|
gCustomSchema.text_fore_color = pref->getRGB(PREF_TEXT_FORE_COLOR);
|
||||||
gCustomSchema.text_back_color = pref->getRGB(PREF_TEXT_BACK_COLOR);
|
gCustomSchema.text_back_color = pref->getRGB(PREF_TEXT_BACK_COLOR);
|
||||||
gCustomSchema.cursor_fore_color = pref->getRGB(PREF_CURSOR_FORE_COLOR);
|
|
||||||
gCustomSchema.cursor_back_color = pref->getRGB(PREF_CURSOR_BACK_COLOR);
|
|
||||||
gCustomSchema.select_fore_color = pref->getRGB(PREF_SELECT_FORE_COLOR);
|
gCustomSchema.select_fore_color = pref->getRGB(PREF_SELECT_FORE_COLOR);
|
||||||
gCustomSchema.select_back_color = pref->getRGB(PREF_SELECT_BACK_COLOR);
|
gCustomSchema.select_back_color = pref->getRGB(PREF_SELECT_BACK_COLOR);
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ static const pref_defaults kTermDefaults[] = {
|
|||||||
{ PREF_TEXT_BACK_COLOR, "255, 255, 255" },
|
{ PREF_TEXT_BACK_COLOR, "255, 255, 255" },
|
||||||
{ PREF_SELECT_FORE_COLOR, "255, 255, 255" },
|
{ PREF_SELECT_FORE_COLOR, "255, 255, 255" },
|
||||||
{ PREF_SELECT_BACK_COLOR, " 0, 0, 0" },
|
{ PREF_SELECT_BACK_COLOR, " 0, 0, 0" },
|
||||||
{ PREF_CURSOR_FORE_COLOR, "255, 255, 255" },
|
|
||||||
{ PREF_CURSOR_BACK_COLOR, " 0, 0, 0" },
|
|
||||||
|
|
||||||
{ PREF_IM_FORE_COLOR, " 0, 0, 0" },
|
{ PREF_IM_FORE_COLOR, " 0, 0, 0" },
|
||||||
{ PREF_IM_BACK_COLOR, "152, 203, 255" },
|
{ PREF_IM_BACK_COLOR, "152, 203, 255" },
|
||||||
@@ -423,8 +421,6 @@ PrefHandler::_LoadFromFile(const char* path)
|
|||||||
setString(PREF_HALF_FONT_STYLE, font_style);
|
setString(PREF_HALF_FONT_STYLE, font_style);
|
||||||
setRGB(PREF_TEXT_BACK_COLOR, prefs.bg);
|
setRGB(PREF_TEXT_BACK_COLOR, prefs.bg);
|
||||||
setRGB(PREF_TEXT_FORE_COLOR, prefs.fg);
|
setRGB(PREF_TEXT_FORE_COLOR, prefs.fg);
|
||||||
setRGB(PREF_CURSOR_BACK_COLOR, prefs.curbg);
|
|
||||||
setRGB(PREF_CURSOR_FORE_COLOR, prefs.curfg);
|
|
||||||
setRGB(PREF_SELECT_BACK_COLOR, prefs.selbg);
|
setRGB(PREF_SELECT_BACK_COLOR, prefs.selbg);
|
||||||
setRGB(PREF_SELECT_FORE_COLOR, prefs.selfg);
|
setRGB(PREF_SELECT_FORE_COLOR, prefs.selfg);
|
||||||
setString(PREF_TEXT_ENCODING, EncodingAsString(prefs.encoding));
|
setString(PREF_TEXT_ENCODING, EncodingAsString(prefs.encoding));
|
||||||
|
|||||||
@@ -103,8 +103,6 @@ const char* const PREF_TEXT_FORE_COLOR = "Text";
|
|||||||
const char* const PREF_TEXT_BACK_COLOR = "Background";
|
const char* const PREF_TEXT_BACK_COLOR = "Background";
|
||||||
const char* const PREF_SELECT_FORE_COLOR = "Selected text";
|
const char* const PREF_SELECT_FORE_COLOR = "Selected text";
|
||||||
const char* const PREF_SELECT_BACK_COLOR = "Selected background";
|
const char* const PREF_SELECT_BACK_COLOR = "Selected background";
|
||||||
const char* const PREF_CURSOR_FORE_COLOR = "Cursor text";
|
|
||||||
const char* const PREF_CURSOR_BACK_COLOR = "Cursor background";
|
|
||||||
|
|
||||||
const char* const PREF_IM_FORE_COLOR = "IM foreground color";
|
const char* const PREF_IM_FORE_COLOR = "IM foreground color";
|
||||||
const char* const PREF_IM_BACK_COLOR = "IM background color";
|
const char* const PREF_IM_BACK_COLOR = "IM background color";
|
||||||
|
|||||||
@@ -548,8 +548,6 @@ TermView::_InitObject(int32 argc, const char** argv)
|
|||||||
fVisibleTextBuffer = NULL;
|
fVisibleTextBuffer = NULL;
|
||||||
fScrollBar = NULL;
|
fScrollBar = NULL;
|
||||||
fInline = NULL;
|
fInline = NULL;
|
||||||
fCursorForeColor = kWhiteColor;
|
|
||||||
fCursorBackColor = kBlackColor;
|
|
||||||
fSelectForeColor = kWhiteColor;
|
fSelectForeColor = kWhiteColor;
|
||||||
fSelectBackColor = kBlackColor;
|
fSelectBackColor = kBlackColor;
|
||||||
fScrollOffset = 0;
|
fScrollOffset = 0;
|
||||||
@@ -849,14 +847,6 @@ TermView::SetSelectColor(rgb_color fore, rgb_color back)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TermView::SetCursorColor(rgb_color fore, rgb_color back)
|
|
||||||
{
|
|
||||||
fCursorForeColor = fore;
|
|
||||||
fCursorBackColor = back;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
TermView::Encoding() const
|
TermView::Encoding() const
|
||||||
{
|
{
|
||||||
@@ -1117,8 +1107,13 @@ TermView::_DrawLinePart(int32 x1, int32 y1, uint32 attr, char *buf,
|
|||||||
|
|
||||||
// Selection check.
|
// Selection check.
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
rgb_fore = fCursorForeColor;
|
rgb_fore.red = 255 - rgb_fore.red;
|
||||||
rgb_back = fCursorBackColor;
|
rgb_fore.green = 255 - rgb_fore.green;
|
||||||
|
rgb_fore.blue = 255 - rgb_fore.blue;
|
||||||
|
|
||||||
|
rgb_back.red = 255 - rgb_back.red;
|
||||||
|
rgb_back.green = 255 - rgb_back.green;
|
||||||
|
rgb_back.blue = 255 - rgb_back.blue;
|
||||||
} else if (mouse) {
|
} else if (mouse) {
|
||||||
rgb_fore = fSelectForeColor;
|
rgb_fore = fSelectForeColor;
|
||||||
rgb_back = fSelectBackColor;
|
rgb_back = fSelectBackColor;
|
||||||
@@ -1195,8 +1190,13 @@ TermView::_DrawCursor()
|
|||||||
if (selected)
|
if (selected)
|
||||||
SetHighColor(fSelectBackColor);
|
SetHighColor(fSelectBackColor);
|
||||||
else {
|
else {
|
||||||
SetHighColor(cursorVisible
|
rgb_color color = kTermColorTable[IS_BACKCOLOR(attr)];
|
||||||
? fCursorBackColor : kTermColorTable[IS_BACKCOLOR(attr)]);
|
if (cursorVisible) {
|
||||||
|
color.red = 255 - color.red;
|
||||||
|
color.green = 255 - color.green;
|
||||||
|
color.blue = 255 - color.blue;
|
||||||
|
}
|
||||||
|
SetHighColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
FillRect(rect);
|
FillRect(rect);
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ public:
|
|||||||
|
|
||||||
void SetTextColor(rgb_color fore, rgb_color back);
|
void SetTextColor(rgb_color fore, rgb_color back);
|
||||||
void SetSelectColor(rgb_color fore, rgb_color back);
|
void SetSelectColor(rgb_color fore, rgb_color back);
|
||||||
void SetCursorColor(rgb_color fore, rgb_color back);
|
|
||||||
|
|
||||||
int Encoding() const;
|
int Encoding() const;
|
||||||
void SetEncoding(int encoding);
|
void SetEncoding(int encoding);
|
||||||
@@ -238,8 +237,6 @@ private:
|
|||||||
InlineInput* fInline;
|
InlineInput* fInline;
|
||||||
|
|
||||||
// Color and Attribute.
|
// Color and Attribute.
|
||||||
rgb_color fCursorForeColor;
|
|
||||||
rgb_color fCursorBackColor;
|
|
||||||
rgb_color fSelectForeColor;
|
rgb_color fSelectForeColor;
|
||||||
rgb_color fSelectBackColor;
|
rgb_color fSelectBackColor;
|
||||||
|
|
||||||
|
|||||||
@@ -744,9 +744,6 @@ TermWindow::_SetTermColors(TermViewContainerView* containerView)
|
|||||||
|
|
||||||
termView->SetSelectColor(handler->getRGB(PREF_SELECT_FORE_COLOR),
|
termView->SetSelectColor(handler->getRGB(PREF_SELECT_FORE_COLOR),
|
||||||
handler->getRGB(PREF_SELECT_BACK_COLOR));
|
handler->getRGB(PREF_SELECT_BACK_COLOR));
|
||||||
|
|
||||||
termView->SetCursorColor(handler->getRGB(PREF_CURSOR_FORE_COLOR),
|
|
||||||
handler->getRGB(PREF_CURSOR_BACK_COLOR));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user