Color setting improvements
This commit is contained in:
parent
7e961d40c3
commit
b9fa26965a
|
@ -1,3 +1,6 @@
|
||||||
|
2015-10-23 Markus Gans <guru.mail@muenster.de>
|
||||||
|
* Color setting improvements
|
||||||
|
|
||||||
2015-10-22 Markus Gans <guru.mail@muenster.de>
|
2015-10-22 Markus Gans <guru.mail@muenster.de>
|
||||||
* Make cursor visibility more standards compliant.
|
* Make cursor visibility more standards compliant.
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ void FButton::draw()
|
||||||
if ( ! is_Active && isMonochron() )
|
if ( ! is_Active && isMonochron() )
|
||||||
space = fc::MediumShade; // ▒
|
space = fc::MediumShade; // ▒
|
||||||
|
|
||||||
if ( (isMonochron() || getMaxColor() < 16) && is_ActiveFocus )
|
if ( isMonochron() && is_ActiveFocus )
|
||||||
{
|
{
|
||||||
txt = "<" + txt + ">";
|
txt = "<" + txt + ">";
|
||||||
length = int(txt.getLength());
|
length = int(txt.getLength());
|
||||||
|
@ -291,7 +291,7 @@ void FButton::draw()
|
||||||
setCursorPos ( xpos+xmin-1+margin+i+hotkeypos
|
setCursorPos ( xpos+xmin-1+margin+i+hotkeypos
|
||||||
, ypos+ymin-1+j ); // hotkey
|
, ypos+ymin-1+j ); // hotkey
|
||||||
|
|
||||||
if ( isMonochron() && is_ActiveFocus )
|
if ( (isMonochron() || getMaxColor() < 16) && is_ActiveFocus )
|
||||||
setBold();
|
setBold();
|
||||||
|
|
||||||
for (int z=0; x < i+length && z < width; z++,x++)
|
for (int z=0; x < i+length && z < width; z++,x++)
|
||||||
|
@ -312,7 +312,7 @@ void FButton::draw()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isMonochron() && is_ActiveFocus )
|
if ( (isMonochron() || getMaxColor() < 16) && is_ActiveFocus )
|
||||||
unsetBold();
|
unsetBold();
|
||||||
|
|
||||||
for (x=i+length; x < width-1; x++)
|
for (x=i+length; x < width-1; x++)
|
||||||
|
|
|
@ -206,6 +206,7 @@ void FDialog::drawTitleBar()
|
||||||
setReverse(true);
|
setReverse(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( isNewFont() )
|
if ( isNewFont() )
|
||||||
{
|
{
|
||||||
print (fc::NF_rev_menu_button1);
|
print (fc::NF_rev_menu_button1);
|
||||||
|
@ -218,6 +219,8 @@ void FDialog::drawTitleBar()
|
||||||
print (" - ");
|
print (" - ");
|
||||||
|
|
||||||
// fill with spaces (left of the title)
|
// fill with spaces (left of the title)
|
||||||
|
if ( getMaxColor() < 16 )
|
||||||
|
setBold();
|
||||||
if ( isActiveWindow() )
|
if ( isActiveWindow() )
|
||||||
setColor (wc.titlebar_active_fg, wc.titlebar_active_bg);
|
setColor (wc.titlebar_active_fg, wc.titlebar_active_bg);
|
||||||
else
|
else
|
||||||
|
@ -236,6 +239,8 @@ void FDialog::drawTitleBar()
|
||||||
for (; x+1+int(length) < width-1; x++)
|
for (; x+1+int(length) < width-1; x++)
|
||||||
print (' ');
|
print (' ');
|
||||||
|
|
||||||
|
if ( getMaxColor() < 16 )
|
||||||
|
unsetBold();
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ FLineEdit::~FLineEdit() // destructor
|
||||||
setKDECursor(fc::UnderlineCursor);
|
setKDECursor(fc::UnderlineCursor);
|
||||||
setConsoleCursor(fc::underscore_cursor);
|
setConsoleCursor(fc::underscore_cursor);
|
||||||
if ( isUrxvtTerminal() )
|
if ( isUrxvtTerminal() )
|
||||||
setXTermCursor("rgb:ffff/ffff/ffff");
|
setXTermCursorColor("rgb:ffff/ffff/ffff");
|
||||||
}
|
}
|
||||||
if ( hasFocus() )
|
if ( hasFocus() )
|
||||||
hideCursor();
|
hideCursor();
|
||||||
|
@ -175,6 +175,10 @@ void FLineEdit::drawInputField()
|
||||||
else
|
else
|
||||||
print (fc::RightHalfBlock); // ▐
|
print (fc::RightHalfBlock); // ▐
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isActiveFocus && getMaxColor() < 16 )
|
||||||
|
setBold();
|
||||||
|
|
||||||
setColor (foregroundColor, backgroundColor);
|
setColor (foregroundColor, backgroundColor);
|
||||||
show_text = text.mid(uInt(1+offset), uInt(width-2));
|
show_text = text.mid(uInt(1+offset), uInt(width-2));
|
||||||
|
|
||||||
|
@ -193,6 +197,10 @@ void FLineEdit::drawInputField()
|
||||||
print (' ');
|
print (' ');
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isActiveFocus && getMaxColor() < 16 )
|
||||||
|
unsetBold();
|
||||||
|
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
{
|
{
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
|
@ -466,7 +474,7 @@ void FLineEdit::onKeyPress (FKeyEvent* ev)
|
||||||
setKDECursor(fc::UnderlineCursor);
|
setKDECursor(fc::UnderlineCursor);
|
||||||
setConsoleCursor(fc::underscore_cursor);
|
setConsoleCursor(fc::underscore_cursor);
|
||||||
if ( isUrxvtTerminal() )
|
if ( isUrxvtTerminal() )
|
||||||
setXTermCursor("rgb:ffff/ffff/ffff");
|
setXTermCursorColor("rgb:ffff/ffff/ffff");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -474,7 +482,7 @@ void FLineEdit::onKeyPress (FKeyEvent* ev)
|
||||||
setKDECursor(fc::BlockCursor);
|
setKDECursor(fc::BlockCursor);
|
||||||
setConsoleCursor(fc::full_block_cursor);
|
setConsoleCursor(fc::full_block_cursor);
|
||||||
if ( isUrxvtTerminal() )
|
if ( isUrxvtTerminal() )
|
||||||
setXTermCursor("rgb:0000/0000/0000");
|
setXTermCursorColor("rgb:0000/0000/0000");
|
||||||
}
|
}
|
||||||
ev->accept();
|
ev->accept();
|
||||||
break;
|
break;
|
||||||
|
@ -717,7 +725,7 @@ void FLineEdit::onHide (FHideEvent*)
|
||||||
setKDECursor(fc::UnderlineCursor);
|
setKDECursor(fc::UnderlineCursor);
|
||||||
setConsoleCursor(fc::underscore_cursor);
|
setConsoleCursor(fc::underscore_cursor);
|
||||||
if ( isUrxvtTerminal() )
|
if ( isUrxvtTerminal() )
|
||||||
setXTermCursor("rgb:ffff/ffff/ffff");
|
setXTermCursorColor("rgb:ffff/ffff/ffff");
|
||||||
}
|
}
|
||||||
if ( hasFocus() )
|
if ( hasFocus() )
|
||||||
hideCursor();
|
hideCursor();
|
||||||
|
@ -735,7 +743,7 @@ void FLineEdit::onFocusIn (FFocusEvent*)
|
||||||
setKDECursor(fc::UnderlineCursor);
|
setKDECursor(fc::UnderlineCursor);
|
||||||
setConsoleCursor(fc::underscore_cursor);
|
setConsoleCursor(fc::underscore_cursor);
|
||||||
if ( isUrxvtTerminal() )
|
if ( isUrxvtTerminal() )
|
||||||
setXTermCursor("rgb:ffff/ffff/ffff");
|
setXTermCursorColor("rgb:ffff/ffff/ffff");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -743,7 +751,7 @@ void FLineEdit::onFocusIn (FFocusEvent*)
|
||||||
setKDECursor(fc::BlockCursor);
|
setKDECursor(fc::BlockCursor);
|
||||||
setConsoleCursor(fc::full_block_cursor);
|
setConsoleCursor(fc::full_block_cursor);
|
||||||
if ( isUrxvtTerminal() )
|
if ( isUrxvtTerminal() )
|
||||||
setXTermCursor("rgb:0000/0000/0000");
|
setXTermCursorColor("rgb:0000/0000/0000");
|
||||||
}
|
}
|
||||||
if ( statusBar() )
|
if ( statusBar() )
|
||||||
{
|
{
|
||||||
|
@ -768,7 +776,7 @@ void FLineEdit::onFocusOut (FFocusEvent*)
|
||||||
setKDECursor(fc::UnderlineCursor);
|
setKDECursor(fc::UnderlineCursor);
|
||||||
setConsoleCursor(fc::underscore_cursor);
|
setConsoleCursor(fc::underscore_cursor);
|
||||||
if ( isUrxvtTerminal() )
|
if ( isUrxvtTerminal() )
|
||||||
setXTermCursor("rgb:ffff/ffff/ffff");
|
setXTermCursorColor("rgb:ffff/ffff/ffff");
|
||||||
}
|
}
|
||||||
|
|
||||||
hideCursor();
|
hideCursor();
|
||||||
|
|
|
@ -263,19 +263,26 @@ void FListBox::drawList()
|
||||||
|
|
||||||
if ( isCurrentLine )
|
if ( isCurrentLine )
|
||||||
{
|
{
|
||||||
|
if ( isFocus && getMaxColor() < 16 )
|
||||||
|
setBold();
|
||||||
if ( isLineSelected )
|
if ( isLineSelected )
|
||||||
{
|
{
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setBold();
|
setBold();
|
||||||
|
else if ( isFocus )
|
||||||
|
setColor ( wc.selected_current_element_focus_fg
|
||||||
|
, wc.selected_current_element_focus_bg );
|
||||||
else
|
else
|
||||||
setColor ( wc.selected_current_element_fg
|
setColor ( wc.selected_current_element_fg
|
||||||
, wc.selected_current_element_bg );
|
, wc.selected_current_element_bg );
|
||||||
|
setCursorPos ( xpos+xmin+1
|
||||||
|
, ypos+ymin+int(y) ); // first character
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
unsetBold();
|
unsetBold();
|
||||||
else if ( isFocus )
|
if ( isFocus )
|
||||||
{
|
{
|
||||||
setColor ( wc.current_element_focus_fg
|
setColor ( wc.current_element_focus_fg
|
||||||
, wc.current_element_focus_bg );
|
, wc.current_element_focus_bg );
|
||||||
|
@ -297,8 +304,13 @@ void FListBox::drawList()
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
}
|
}
|
||||||
else if ( isMonochron() )
|
else
|
||||||
setReverse(true);
|
{
|
||||||
|
if ( isFocus && getMaxColor() < 16 )
|
||||||
|
unsetBold();
|
||||||
|
if ( isMonochron() )
|
||||||
|
setReverse(true);
|
||||||
|
}
|
||||||
|
|
||||||
// print the entry
|
// print the entry
|
||||||
if ( isMonochron() && isCurrentLine )
|
if ( isMonochron() && isCurrentLine )
|
||||||
|
|
|
@ -204,6 +204,7 @@ void FMenuItem::processClicked()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenuItem::onAccel (FAccelEvent* ev)
|
void FMenuItem::onAccel (FAccelEvent* ev)
|
||||||
{
|
{
|
||||||
|
beep(); // activate by key
|
||||||
if ( isActivated() && ! isSelected() )
|
if ( isActivated() && ! isSelected() )
|
||||||
{
|
{
|
||||||
if ( super_menu && isMenuBar(super_menu) )
|
if ( super_menu && isMenuBar(super_menu) )
|
||||||
|
|
|
@ -129,6 +129,7 @@ void FProgressbar::drawBar()
|
||||||
}
|
}
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
|
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flush_out();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,11 +80,11 @@ void FScrollbar::init()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FScrollbar::draw()
|
void FScrollbar::draw()
|
||||||
{
|
{
|
||||||
//setUpdateVTerm(false);
|
setUpdateVTerm(false);
|
||||||
drawButtons();
|
drawButtons();
|
||||||
currentSliderPos = -1;
|
currentSliderPos = -1;
|
||||||
drawBar();
|
drawBar();
|
||||||
//setUpdateVTerm(true);
|
setUpdateVTerm(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -62,11 +62,13 @@ void FSwitch::drawCheckButton()
|
||||||
if ( hasFocus() && ! button_pressed )
|
if ( hasFocus() && ! button_pressed )
|
||||||
{
|
{
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setBold(true);
|
|
||||||
|
|
||||||
if ( isMonochron() || getMaxColor() < 16 )
|
|
||||||
{
|
{
|
||||||
wcsncpy ( on, L" <On>", 6);
|
wcsncpy ( on, L" <On>", 6);
|
||||||
|
setBold(true);
|
||||||
|
}
|
||||||
|
else if ( getMaxColor() < 16 )
|
||||||
|
{
|
||||||
|
setBold(true);
|
||||||
setColor (wc.button_active_focus_fg, wc.button_active_focus_bg);
|
setColor (wc.button_active_focus_fg, wc.button_active_focus_bg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -84,10 +86,10 @@ void FSwitch::drawCheckButton()
|
||||||
print (on);
|
print (on);
|
||||||
|
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
{
|
|
||||||
setReverse(true);
|
setReverse(true);
|
||||||
|
|
||||||
|
if ( isMonochron() || getMaxColor() < 16 )
|
||||||
setBold(false);
|
setBold(false);
|
||||||
}
|
|
||||||
|
|
||||||
setColor (wc.button_inactive_fg, wc.button_inactive_bg);
|
setColor (wc.button_inactive_fg, wc.button_inactive_bg);
|
||||||
print (off);
|
print (off);
|
||||||
|
@ -108,10 +110,13 @@ void FSwitch::drawCheckButton()
|
||||||
if ( hasFocus() && ! button_pressed )
|
if ( hasFocus() && ! button_pressed )
|
||||||
{
|
{
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setBold(true);
|
|
||||||
if ( isMonochron() || getMaxColor() < 16 )
|
|
||||||
{
|
{
|
||||||
wcsncpy ( off, L"<Off>", 6);
|
wcsncpy ( off, L"<Off>", 6);
|
||||||
|
setBold(true);
|
||||||
|
}
|
||||||
|
else if ( getMaxColor() < 16 )
|
||||||
|
{
|
||||||
|
setBold(true);
|
||||||
setColor (wc.button_active_focus_fg, wc.button_active_focus_bg);
|
setColor (wc.button_active_focus_fg, wc.button_active_focus_bg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -128,7 +133,7 @@ void FSwitch::drawCheckButton()
|
||||||
|
|
||||||
print (off);
|
print (off);
|
||||||
|
|
||||||
if ( isMonochron() )
|
if ( isMonochron() || getMaxColor() < 16 )
|
||||||
setBold(false);
|
setBold(false);
|
||||||
|
|
||||||
setCursorPos ( xpos + xmin + 5 + switch_offset_pos
|
setCursorPos ( xpos + xmin + 5 + switch_offset_pos
|
||||||
|
|
|
@ -1054,7 +1054,7 @@ void FTerm::init_termcaps()
|
||||||
tcap[t_set_a_background].string = \
|
tcap[t_set_a_background].string = \
|
||||||
const_cast<char*>("\033[4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m");
|
const_cast<char*>("\033[4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m");
|
||||||
}
|
}
|
||||||
else if ( tera_terminal && color256 )
|
else if ( tera_terminal )
|
||||||
{
|
{
|
||||||
tcap[t_set_a_foreground].string = \
|
tcap[t_set_a_foreground].string = \
|
||||||
const_cast<char*>("\033[38;5;%p1%dm");
|
const_cast<char*>("\033[38;5;%p1%dm");
|
||||||
|
@ -1497,10 +1497,10 @@ void FTerm::init()
|
||||||
setXTermMouseBackground("rgb:ffff/ffff/ffff");
|
setXTermMouseBackground("rgb:ffff/ffff/ffff");
|
||||||
setXTermMouseForeground ("rgb:0000/0000/0000");
|
setXTermMouseForeground ("rgb:0000/0000/0000");
|
||||||
if ( ! gnome_terminal )
|
if ( ! gnome_terminal )
|
||||||
setXTermCursor("rgb:ffff/ffff/ffff");
|
setXTermCursorColor("rgb:ffff/ffff/ffff");
|
||||||
if ( ! gnome_terminal && ! mintty_terminal )
|
if ( ! mintty_terminal )
|
||||||
{
|
{
|
||||||
// gnome-terminal and mintty can't reset these settings
|
// mintty can't reset these settings
|
||||||
setXTermBackground("rgb:8080/a4a4/ecec");
|
setXTermBackground("rgb:8080/a4a4/ecec");
|
||||||
setXTermForeground("rgb:0000/0000/0000");
|
setXTermForeground("rgb:0000/0000/0000");
|
||||||
setXTermHighlightBackground("rgb:b1b1/b1b1/b1b1");
|
setXTermHighlightBackground("rgb:b1b1/b1b1/b1b1");
|
||||||
|
@ -1587,15 +1587,14 @@ void FTerm::finish()
|
||||||
putstring (tcap[t_exit_attribute_mode].string);
|
putstring (tcap[t_exit_attribute_mode].string);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
if ( ! gnome_terminal )
|
|
||||||
{
|
// reset xterm color settings to default
|
||||||
setXTermCursor("rgb:b1b1/b1b1/b1b1");
|
setXTermCursorColor("rgb:b1b1/b1b1/b1b1");
|
||||||
resetXTermMouseForeground();
|
resetXTermMouseForeground();
|
||||||
resetXTermMouseBackground();
|
resetXTermMouseBackground();
|
||||||
resetXTermCursor();
|
resetXTermCursorColor();
|
||||||
resetXTermForeground();
|
resetXTermForeground();
|
||||||
resetXTermBackground();
|
resetXTermBackground();
|
||||||
}
|
|
||||||
setXTermCursorStyle(fc::steady_block);
|
setXTermCursorStyle(fc::steady_block);
|
||||||
|
|
||||||
if ( max_color >= 16 && ! kde_konsole && ! tera_terminal )
|
if ( max_color >= 16 && ! kde_konsole && ! tera_terminal )
|
||||||
|
@ -2773,7 +2772,7 @@ void FTerm::setXTermBackground (const FString& bg)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::setXTermCursor (const FString& cc)
|
void FTerm::setXTermCursorColor (const FString& cc)
|
||||||
{
|
{
|
||||||
// Set the text cursor color
|
// Set the text cursor color
|
||||||
if ( xterm || mintty_terminal || urxvt_terminal )
|
if ( xterm || mintty_terminal || urxvt_terminal )
|
||||||
|
@ -2822,7 +2821,7 @@ void FTerm::resetXTermForeground()
|
||||||
// Reset the VT100 text foreground color
|
// Reset the VT100 text foreground color
|
||||||
if ( xterm )
|
if ( xterm )
|
||||||
{
|
{
|
||||||
putstring("\033]110;\07");
|
putstring("\033]110\07");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2833,18 +2832,18 @@ void FTerm::resetXTermBackground()
|
||||||
// Reset the VT100 text background color
|
// Reset the VT100 text background color
|
||||||
if ( xterm )
|
if ( xterm )
|
||||||
{
|
{
|
||||||
putstring("\033]111;\07");
|
putstring("\033]111\07");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::resetXTermCursor()
|
void FTerm::resetXTermCursorColor()
|
||||||
{
|
{
|
||||||
// Reset the text cursor color
|
// Reset the text cursor color
|
||||||
if ( xterm )
|
if ( xterm )
|
||||||
{
|
{
|
||||||
putstring("\033]112;\07");
|
putstring("\033]112\07");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2855,7 +2854,7 @@ void FTerm::resetXTermMouseForeground()
|
||||||
// Reset the mouse foreground color
|
// Reset the mouse foreground color
|
||||||
if ( xterm )
|
if ( xterm )
|
||||||
{
|
{
|
||||||
putstring("\033]113;\07");
|
putstring("\033]113\07");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2866,7 +2865,7 @@ void FTerm::resetXTermMouseBackground()
|
||||||
// Reset the mouse background color
|
// Reset the mouse background color
|
||||||
if ( xterm )
|
if ( xterm )
|
||||||
{
|
{
|
||||||
putstring("\033]114;\07");
|
putstring("\033]114\07");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,13 +315,13 @@ class FTerm
|
||||||
static void setXTermTitle (const FString&);
|
static void setXTermTitle (const FString&);
|
||||||
static void setXTermForeground (const FString&);
|
static void setXTermForeground (const FString&);
|
||||||
static void setXTermBackground (const FString&);
|
static void setXTermBackground (const FString&);
|
||||||
static void setXTermCursor (const FString&);
|
static void setXTermCursorColor (const FString&);
|
||||||
static void setXTermMouseForeground (const FString&);
|
static void setXTermMouseForeground (const FString&);
|
||||||
static void setXTermMouseBackground (const FString&);
|
static void setXTermMouseBackground (const FString&);
|
||||||
static void setXTermHighlightBackground (const FString&);
|
static void setXTermHighlightBackground (const FString&);
|
||||||
static void resetXTermForeground();
|
static void resetXTermForeground();
|
||||||
static void resetXTermBackground();
|
static void resetXTermBackground();
|
||||||
static void resetXTermCursor();
|
static void resetXTermCursorColor();
|
||||||
static void resetXTermMouseForeground();
|
static void resetXTermMouseForeground();
|
||||||
static void resetXTermMouseBackground();
|
static void resetXTermMouseBackground();
|
||||||
static void saveColorMap();
|
static void saveColorMap();
|
||||||
|
|
|
@ -93,6 +93,7 @@ void FTextView::draw()
|
||||||
setUpdateVTerm(true);
|
setUpdateVTerm(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setCursorPos(1,1);
|
||||||
updateTerminal();
|
updateTerminal();
|
||||||
flush_out();
|
flush_out();
|
||||||
}
|
}
|
||||||
|
|
312
src/fwidget.cpp
312
src/fwidget.cpp
|
@ -188,83 +188,85 @@ void FWidget::draw()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FWidget::setColorTheme()
|
void FWidget::setColorTheme()
|
||||||
{
|
{
|
||||||
wc.term_fg = fc::Black;
|
wc.term_fg = fc::Black;
|
||||||
wc.term_bg = fc::LightBlue;
|
wc.term_bg = fc::LightBlue;
|
||||||
wc.list_fg = fc::Black;
|
wc.list_fg = fc::Black;
|
||||||
wc.list_bg = fc::White;
|
wc.list_bg = fc::White;
|
||||||
wc.selected_list_fg = fc::Cyan;
|
wc.selected_list_fg = fc::Cyan;
|
||||||
wc.selected_list_bg = fc::White;
|
wc.selected_list_bg = fc::White;
|
||||||
wc.dialog_fg = fc::Black;
|
wc.dialog_fg = fc::Black;
|
||||||
wc.dialog_emphasis_fg = fc::Blue;
|
wc.dialog_emphasis_fg = fc::Blue;
|
||||||
wc.dialog_bg = fc::White;
|
wc.dialog_bg = fc::White;
|
||||||
wc.error_box_fg = fc::White;
|
wc.error_box_fg = fc::White;
|
||||||
wc.error_box_emphasis_fg = fc::Yellow;
|
wc.error_box_emphasis_fg = fc::Yellow;
|
||||||
wc.error_box_bg = fc::LightRed;
|
wc.error_box_bg = fc::LightRed;
|
||||||
wc.shadow_fg = fc::Black;
|
wc.shadow_fg = fc::Black;
|
||||||
wc.shadow_bg = fc::LightGray; // only for transparent shadow
|
wc.shadow_bg = fc::LightGray; // only for transparent shadow
|
||||||
wc.current_element_focus_fg = fc::White;
|
wc.current_element_focus_fg = fc::White;
|
||||||
wc.current_element_focus_bg = fc::Blue;
|
wc.current_element_focus_bg = fc::Blue;
|
||||||
wc.current_element_fg = fc::LightGray;
|
wc.current_element_fg = fc::LightGray;
|
||||||
wc.current_element_bg = fc::Blue;
|
wc.current_element_bg = fc::Blue;
|
||||||
wc.current_inc_search_element_fg = fc::LightRed;
|
wc.current_inc_search_element_fg = fc::LightRed;
|
||||||
wc.selected_current_element_fg = fc::LightBlue;
|
wc.selected_current_element_focus_fg = fc::LightBlue;
|
||||||
wc.selected_current_element_bg = fc::Blue;
|
wc.selected_current_element_focus_bg = fc::Blue;
|
||||||
wc.label_fg = fc::Black;
|
wc.selected_current_element_fg = fc::Cyan;
|
||||||
wc.label_bg = fc::White;
|
wc.selected_current_element_bg = fc::Blue;
|
||||||
wc.label_inactive_fg = fc::LightGray;
|
wc.label_fg = fc::Black;
|
||||||
wc.label_inactive_bg = fc::White;
|
wc.label_bg = fc::White;
|
||||||
wc.label_hotkey_fg = fc::Red;
|
wc.label_inactive_fg = fc::LightGray;
|
||||||
wc.label_hotkey_bg = fc::White;
|
wc.label_inactive_bg = fc::White;
|
||||||
wc.label_emphasis_fg = fc::Blue;
|
wc.label_hotkey_fg = fc::Red;
|
||||||
wc.label_ellipsis_fg = fc::DarkGray;
|
wc.label_hotkey_bg = fc::White;
|
||||||
wc.inputfield_active_focus_fg = fc::White;
|
wc.label_emphasis_fg = fc::Blue;
|
||||||
wc.inputfield_active_focus_bg = fc::Cyan;
|
wc.label_ellipsis_fg = fc::DarkGray;
|
||||||
wc.inputfield_active_fg = fc::Black;
|
wc.inputfield_active_focus_fg = fc::White;
|
||||||
wc.inputfield_active_bg = fc::LightGray;
|
wc.inputfield_active_focus_bg = fc::Cyan;
|
||||||
wc.inputfield_inactive_fg = fc::DarkGray;
|
wc.inputfield_active_fg = fc::Black;
|
||||||
wc.inputfield_inactive_bg = fc::LightGray;
|
wc.inputfield_active_bg = fc::LightGray;
|
||||||
wc.toggle_button_active_focus_fg = fc::White;
|
wc.inputfield_inactive_fg = fc::DarkGray;
|
||||||
wc.toggle_button_active_focus_bg = fc::Cyan;
|
wc.inputfield_inactive_bg = fc::LightGray;
|
||||||
wc.toggle_button_active_fg = fc::Black;
|
wc.toggle_button_active_focus_fg = fc::White;
|
||||||
wc.toggle_button_active_bg = fc::White;
|
wc.toggle_button_active_focus_bg = fc::Cyan;
|
||||||
wc.toggle_button_inactive_fg = fc::LightGray;
|
wc.toggle_button_active_fg = fc::Black;
|
||||||
wc.toggle_button_inactive_bg = fc::White;
|
wc.toggle_button_active_bg = fc::White;
|
||||||
wc.button_active_focus_fg = fc::LightGray;
|
wc.toggle_button_inactive_fg = fc::LightGray;
|
||||||
wc.button_active_focus_bg = fc::Blue;
|
wc.toggle_button_inactive_bg = fc::White;
|
||||||
wc.button_active_fg = fc::LightGray;
|
wc.button_active_focus_fg = fc::LightGray;
|
||||||
wc.button_active_bg = fc::DarkGray;
|
wc.button_active_focus_bg = fc::Blue;
|
||||||
wc.button_inactive_fg = fc::DarkGray;
|
wc.button_active_fg = fc::LightGray;
|
||||||
wc.button_inactive_bg = fc::LightGray;
|
wc.button_active_bg = fc::DarkGray;
|
||||||
wc.button_hotkey_fg = fc::White;
|
wc.button_inactive_fg = fc::DarkGray;
|
||||||
wc.titlebar_active_fg = fc::White;
|
wc.button_inactive_bg = fc::LightGray;
|
||||||
wc.titlebar_active_bg = fc::Blue;
|
wc.button_hotkey_fg = fc::White;
|
||||||
wc.titlebar_inactive_fg = fc::LightGray;
|
wc.titlebar_active_fg = fc::White;
|
||||||
wc.titlebar_inactive_bg = fc::DarkGray;
|
wc.titlebar_active_bg = fc::Blue;
|
||||||
wc.titlebar_button_fg = fc::Black;
|
wc.titlebar_inactive_fg = fc::LightGray;
|
||||||
wc.titlebar_button_bg = fc::LightGray;
|
wc.titlebar_inactive_bg = fc::DarkGray;
|
||||||
wc.menu_active_focus_fg = fc::White;
|
wc.titlebar_button_fg = fc::Black;
|
||||||
wc.menu_active_focus_bg = fc::Blue;
|
wc.titlebar_button_bg = fc::LightGray;
|
||||||
wc.menu_active_fg = fc::Black;
|
wc.menu_active_focus_fg = fc::White;
|
||||||
wc.menu_active_bg = fc::White;
|
wc.menu_active_focus_bg = fc::Blue;
|
||||||
wc.menu_inactive_fg = fc::LightGray;
|
wc.menu_active_fg = fc::Black;
|
||||||
wc.menu_inactive_bg = fc::White;
|
wc.menu_active_bg = fc::White;
|
||||||
wc.menu_hotkey_fg = fc::Red;
|
wc.menu_inactive_fg = fc::LightGray;
|
||||||
wc.menu_hotkey_bg = fc::White;
|
wc.menu_inactive_bg = fc::White;
|
||||||
wc.statusbar_fg = fc::White;
|
wc.menu_hotkey_fg = fc::Red;
|
||||||
wc.statusbar_bg = fc::Blue;
|
wc.menu_hotkey_bg = fc::White;
|
||||||
wc.statusbar_hotkey_fg = fc::LightRed;
|
wc.statusbar_fg = fc::White;
|
||||||
wc.statusbar_hotkey_bg = fc::Blue;
|
wc.statusbar_bg = fc::Blue;
|
||||||
wc.statusbar_separator_fg = fc::Black;
|
wc.statusbar_hotkey_fg = fc::LightRed;
|
||||||
wc.statusbar_active_fg = fc::Blue;
|
wc.statusbar_hotkey_bg = fc::Blue;
|
||||||
wc.statusbar_active_bg = fc::White;
|
wc.statusbar_separator_fg = fc::Black;
|
||||||
wc.statusbar_active_hotkey_fg = fc::DarkGray;
|
wc.statusbar_active_fg = fc::Blue;
|
||||||
wc.statusbar_active_hotkey_bg = fc::White;
|
wc.statusbar_active_bg = fc::White;
|
||||||
wc.scrollbar_fg = fc::DarkGray;
|
wc.statusbar_active_hotkey_fg = fc::DarkGray;
|
||||||
wc.scrollbar_bg = fc::LightBlue;
|
wc.statusbar_active_hotkey_bg = fc::White;
|
||||||
wc.scrollbar_button_fg = fc::Black;
|
wc.scrollbar_fg = fc::DarkGray;
|
||||||
wc.scrollbar_button_bg = fc::LightGray;
|
wc.scrollbar_bg = fc::LightBlue;
|
||||||
wc.progressbar_fg = fc::DarkGray;
|
wc.scrollbar_button_fg = fc::Black;
|
||||||
wc.progressbar_bg = fc::LightBlue;
|
wc.scrollbar_button_bg = fc::LightGray;
|
||||||
|
wc.progressbar_fg = fc::DarkGray;
|
||||||
|
wc.progressbar_bg = fc::LightBlue;
|
||||||
|
|
||||||
if ( kde_konsole )
|
if ( kde_konsole )
|
||||||
wc.term_bg = fc::SteelBlue3;
|
wc.term_bg = fc::SteelBlue3;
|
||||||
|
@ -274,83 +276,85 @@ void FWidget::setColorTheme()
|
||||||
|
|
||||||
if ( max_color < 16 ) // for 8 color mode
|
if ( max_color < 16 ) // for 8 color mode
|
||||||
{
|
{
|
||||||
wc.term_fg = fc::Black;
|
wc.term_fg = fc::Black;
|
||||||
wc.term_bg = fc::Blue;
|
wc.term_bg = fc::Blue;
|
||||||
wc.list_fg = fc::Black;
|
wc.list_fg = fc::Black;
|
||||||
wc.list_bg = fc::LightGray;
|
wc.list_bg = fc::LightGray;
|
||||||
wc.selected_list_fg = fc::Blue;
|
wc.selected_list_fg = fc::Blue;
|
||||||
wc.selected_list_bg = fc::LightGray;
|
wc.selected_list_bg = fc::LightGray;
|
||||||
wc.dialog_fg = fc::Black;
|
wc.dialog_fg = fc::Black;
|
||||||
wc.dialog_emphasis_fg = fc::Blue;
|
wc.dialog_emphasis_fg = fc::Blue;
|
||||||
wc.dialog_bg = fc::LightGray;
|
wc.dialog_bg = fc::LightGray;
|
||||||
wc.error_box_fg = fc::Black;
|
wc.error_box_fg = fc::Black;
|
||||||
wc.error_box_emphasis_fg = fc::Red;
|
wc.error_box_emphasis_fg = fc::Red;
|
||||||
wc.error_box_bg = fc::LightGray;
|
wc.error_box_bg = fc::LightGray;
|
||||||
wc.shadow_fg = fc::Black;
|
wc.shadow_fg = fc::Black;
|
||||||
wc.shadow_bg = fc::LightGray; // only for transparent shadow
|
wc.shadow_bg = fc::LightGray; // only for transparent shadow
|
||||||
wc.current_element_focus_fg = fc::LightGray;
|
wc.current_element_focus_fg = fc::LightGray;
|
||||||
wc.current_element_focus_bg = fc::Red;
|
wc.current_element_focus_bg = fc::Red;
|
||||||
wc.current_element_fg = fc::LightGray;
|
wc.current_element_fg = fc::LightGray;
|
||||||
wc.current_element_bg = fc::Blue;
|
wc.current_element_bg = fc::Blue;
|
||||||
wc.current_inc_search_element_fg = fc::Red;
|
wc.current_inc_search_element_fg = fc::Brown;
|
||||||
wc.selected_current_element_fg = fc::Blue;
|
wc.selected_current_element_focus_fg = fc::Blue;
|
||||||
wc.selected_current_element_bg = fc::Red;
|
wc.selected_current_element_focus_bg = fc::Red;
|
||||||
wc.label_fg = fc::Black;
|
wc.selected_current_element_fg = fc::Cyan;
|
||||||
wc.label_bg = fc::LightGray;
|
wc.selected_current_element_bg = fc::Blue;
|
||||||
wc.label_inactive_fg = fc::Cyan;
|
wc.label_fg = fc::Black;
|
||||||
wc.label_inactive_bg = fc::LightGray;
|
wc.label_bg = fc::LightGray;
|
||||||
wc.label_hotkey_fg = fc::Red;
|
wc.label_inactive_fg = fc::Cyan;
|
||||||
wc.label_hotkey_bg = fc::LightGray;
|
wc.label_inactive_bg = fc::LightGray;
|
||||||
wc.label_emphasis_fg = fc::Blue;
|
wc.label_hotkey_fg = fc::Red;
|
||||||
wc.label_ellipsis_fg = fc::Black;
|
wc.label_hotkey_bg = fc::LightGray;
|
||||||
wc.inputfield_active_focus_fg = fc::LightGray;
|
wc.label_emphasis_fg = fc::Blue;
|
||||||
wc.inputfield_active_focus_bg = fc::Blue;
|
wc.label_ellipsis_fg = fc::Black;
|
||||||
wc.inputfield_active_fg = fc::Black;
|
wc.inputfield_active_focus_fg = fc::LightGray;
|
||||||
wc.inputfield_active_bg = fc::Cyan;
|
wc.inputfield_active_focus_bg = fc::Blue;
|
||||||
wc.inputfield_inactive_fg = fc::Black;
|
wc.inputfield_active_fg = fc::Black;
|
||||||
wc.inputfield_inactive_bg = fc::LightGray;
|
wc.inputfield_active_bg = fc::Cyan;
|
||||||
wc.toggle_button_active_focus_fg = fc::LightGray;
|
wc.inputfield_inactive_fg = fc::Black;
|
||||||
wc.toggle_button_active_focus_bg = fc::Red;
|
wc.inputfield_inactive_bg = fc::LightGray;
|
||||||
wc.toggle_button_active_fg = fc::Black;
|
wc.toggle_button_active_focus_fg = fc::LightGray;
|
||||||
wc.toggle_button_active_bg = fc::LightGray;
|
wc.toggle_button_active_focus_bg = fc::Red;
|
||||||
wc.toggle_button_inactive_fg = fc::Cyan;
|
wc.toggle_button_active_fg = fc::Black;
|
||||||
wc.toggle_button_inactive_bg = fc::LightGray;
|
wc.toggle_button_active_bg = fc::LightGray;
|
||||||
wc.button_active_focus_fg = fc::LightGray;
|
wc.toggle_button_inactive_fg = fc::Cyan;
|
||||||
wc.button_active_focus_bg = fc::Red;
|
wc.toggle_button_inactive_bg = fc::LightGray;
|
||||||
wc.button_active_fg = fc::LightGray;
|
wc.button_active_focus_fg = fc::LightGray;
|
||||||
wc.button_active_bg = fc::Blue;
|
wc.button_active_focus_bg = fc::Red;
|
||||||
wc.button_inactive_fg = fc::Black;
|
wc.button_active_fg = fc::LightGray;
|
||||||
wc.button_inactive_bg = fc::Blue;
|
wc.button_active_bg = fc::Blue;
|
||||||
wc.button_hotkey_fg = fc::LightGray;
|
wc.button_inactive_fg = fc::Black;
|
||||||
wc.titlebar_active_fg = fc::LightGray;
|
wc.button_inactive_bg = fc::Blue;
|
||||||
wc.titlebar_active_bg = fc::Red;
|
wc.button_hotkey_fg = fc::LightGray;
|
||||||
wc.titlebar_inactive_fg = fc::Black;
|
wc.titlebar_active_fg = fc::LightGray;
|
||||||
wc.titlebar_inactive_bg = fc::LightGray;
|
wc.titlebar_active_bg = fc::Red;
|
||||||
wc.titlebar_button_fg = fc::Black;
|
wc.titlebar_inactive_fg = fc::Black;
|
||||||
wc.titlebar_button_bg = fc::LightGray;
|
wc.titlebar_inactive_bg = fc::LightGray;
|
||||||
wc.menu_active_focus_fg = fc::LightGray;
|
wc.titlebar_button_fg = fc::Black;
|
||||||
wc.menu_active_focus_bg = fc::Blue;
|
wc.titlebar_button_bg = fc::LightGray;
|
||||||
wc.menu_active_fg = fc::Black;
|
wc.menu_active_focus_fg = fc::LightGray;
|
||||||
wc.menu_active_bg = fc::LightGray;
|
wc.menu_active_focus_bg = fc::Blue;
|
||||||
wc.menu_inactive_fg = fc::Cyan;
|
wc.menu_active_fg = fc::Black;
|
||||||
wc.menu_inactive_bg = fc::LightGray;
|
wc.menu_active_bg = fc::LightGray;
|
||||||
wc.menu_hotkey_fg = fc::Red;
|
wc.menu_inactive_fg = fc::Cyan;
|
||||||
wc.menu_hotkey_bg = fc::LightGray;
|
wc.menu_inactive_bg = fc::LightGray;
|
||||||
wc.statusbar_fg = fc::Black;
|
wc.menu_hotkey_fg = fc::Red;
|
||||||
wc.statusbar_bg = fc::LightGray;
|
wc.menu_hotkey_bg = fc::LightGray;
|
||||||
wc.statusbar_hotkey_fg = fc::Red;
|
wc.statusbar_fg = fc::Black;
|
||||||
wc.statusbar_hotkey_bg = fc::LightGray;
|
wc.statusbar_bg = fc::LightGray;
|
||||||
wc.statusbar_separator_fg = fc::Black;
|
wc.statusbar_hotkey_fg = fc::Red;
|
||||||
wc.statusbar_active_fg = fc::LightGray;
|
wc.statusbar_hotkey_bg = fc::LightGray;
|
||||||
wc.statusbar_active_bg = fc::Black;
|
wc.statusbar_separator_fg = fc::Black;
|
||||||
wc.statusbar_active_hotkey_fg = fc::Red;
|
wc.statusbar_active_fg = fc::LightGray;
|
||||||
wc.statusbar_active_hotkey_bg = fc::Black;
|
wc.statusbar_active_bg = fc::Black;
|
||||||
wc.scrollbar_fg = fc::Black;
|
wc.statusbar_active_hotkey_fg = fc::Red;
|
||||||
wc.scrollbar_bg = fc::LightGray;
|
wc.statusbar_active_hotkey_bg = fc::Black;
|
||||||
wc.scrollbar_button_fg = fc::Black;
|
wc.scrollbar_fg = fc::Black;
|
||||||
wc.scrollbar_button_bg = fc::LightGray;
|
wc.scrollbar_bg = fc::LightGray;
|
||||||
wc.progressbar_fg = fc::Blue;
|
wc.scrollbar_button_fg = fc::Black;
|
||||||
wc.progressbar_bg = fc::LightGray;
|
wc.scrollbar_button_bg = fc::LightGray;
|
||||||
|
wc.progressbar_fg = fc::Blue;
|
||||||
|
wc.progressbar_bg = fc::LightGray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,8 @@ class FWidget : public FObject, public FTerm
|
||||||
uChar current_element_fg;
|
uChar current_element_fg;
|
||||||
uChar current_element_bg;
|
uChar current_element_bg;
|
||||||
uChar current_inc_search_element_fg;
|
uChar current_inc_search_element_fg;
|
||||||
|
uChar selected_current_element_focus_fg;
|
||||||
|
uChar selected_current_element_focus_bg;
|
||||||
uChar selected_current_element_fg;
|
uChar selected_current_element_fg;
|
||||||
uChar selected_current_element_bg;
|
uChar selected_current_element_bg;
|
||||||
uChar label_fg;
|
uChar label_fg;
|
||||||
|
|
Loading…
Reference in New Issue