Better background color for all terminals with a fixed color palette
This commit is contained in:
parent
72fab50cbf
commit
c365f07298
|
@ -3,6 +3,7 @@
|
||||||
* Integration of an output filter to replace missing characters
|
* Integration of an output filter to replace missing characters
|
||||||
* Better Linux console support for UTF-8 encoding
|
* Better Linux console support for UTF-8 encoding
|
||||||
(Default is PC charset encoding)
|
(Default is PC charset encoding)
|
||||||
|
* Better background color for all terminals with a fixed color palette
|
||||||
|
|
||||||
2018-12-31 Markus Gans <guru.mail@muenster.de>
|
2018-12-31 Markus Gans <guru.mail@muenster.de>
|
||||||
* Use the override specifier
|
* Use the override specifier
|
||||||
|
|
|
@ -133,6 +133,22 @@ bool FTerm::isCursorHideable()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
bool FTerm::canChangeColorPalette()
|
||||||
|
{
|
||||||
|
if ( isCygwinTerminal()
|
||||||
|
|| isKdeTerminal()
|
||||||
|
|| isTeraTerm()
|
||||||
|
|| isMltermTerminal()
|
||||||
|
|| isNetBSDTerm()
|
||||||
|
|| isOpenBSDTerm()
|
||||||
|
|| isSunTerminal()
|
||||||
|
|| isAnsiTerminal() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return FTermcap::can_change_color_palette;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::setTermType (const char term_name[])
|
void FTerm::setTermType (const char term_name[])
|
||||||
{
|
{
|
||||||
|
@ -1487,22 +1503,6 @@ inline bool FTerm::hasNoFontSettingOption()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FTerm::canChangeColorPalette()
|
|
||||||
{
|
|
||||||
if ( isCygwinTerminal()
|
|
||||||
|| isKdeTerminal()
|
|
||||||
|| isTeraTerm()
|
|
||||||
|| isMltermTerminal()
|
|
||||||
|| isNetBSDTerm()
|
|
||||||
|| isOpenBSDTerm()
|
|
||||||
|| isSunTerminal()
|
|
||||||
|| isAnsiTerminal() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return FTermcap::can_change_color_palette;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTerm::redefineColorPalette()
|
void FTerm::redefineColorPalette()
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2018 Markus Gans *
|
* Copyright 2018-2019 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -67,7 +67,7 @@ void FTermcapQuirks::setFTermDetection (FTermDetection* td)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FTermcapQuirks::terminalFixup()
|
void FTermcapQuirks::terminalFixup()
|
||||||
{
|
{
|
||||||
auto td = term_detection;
|
auto& td = term_detection;
|
||||||
|
|
||||||
if ( td->isCygwinTerminal() )
|
if ( td->isCygwinTerminal() )
|
||||||
{
|
{
|
||||||
|
@ -114,6 +114,8 @@ void FTermcapQuirks::terminalFixup()
|
||||||
|
|
||||||
// Fixes general quirks
|
// Fixes general quirks
|
||||||
general();
|
general();
|
||||||
|
// ECMA-48 (ANSI X3.64) compatible terminal
|
||||||
|
ecma48();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
|
@ -548,11 +550,16 @@ void FTermcapQuirks::general()
|
||||||
if ( ! TCAP(fc::t_cursor_address) )
|
if ( ! TCAP(fc::t_cursor_address) )
|
||||||
TCAP(fc::t_cursor_address) = \
|
TCAP(fc::t_cursor_address) = \
|
||||||
C_STR(CSI "%i%p1%d;%p2%dH");
|
C_STR(CSI "%i%p1%d;%p2%dH");
|
||||||
|
}
|
||||||
|
|
||||||
// Test for standard ECMA-48 (ANSI X3.64) terminal
|
//----------------------------------------------------------------------
|
||||||
if ( TCAP(fc::t_exit_underline_mode)
|
void FTermcapQuirks::ecma48()
|
||||||
&& std::strncmp(TCAP(fc::t_exit_underline_mode), CSI "24m", 5) == 0 )
|
|
||||||
{
|
{
|
||||||
|
// Test for standard ECMA-48 (ANSI X3.64) terminal
|
||||||
|
if ( ! TCAP(fc::t_exit_underline_mode)
|
||||||
|
|| std::strncmp(TCAP(fc::t_exit_underline_mode), CSI "24m", 5) != 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
// Seems to be a ECMA-48 (ANSI X3.64) compatible terminal
|
// Seems to be a ECMA-48 (ANSI X3.64) compatible terminal
|
||||||
TCAP(fc::t_enter_dbl_underline_mode) = \
|
TCAP(fc::t_enter_dbl_underline_mode) = \
|
||||||
C_STR(CSI "21m"); // Exit single underline, too
|
C_STR(CSI "21m"); // Exit single underline, too
|
||||||
|
@ -584,6 +591,5 @@ void FTermcapQuirks::general()
|
||||||
TCAP(fc::t_exit_crossed_out_mode) = \
|
TCAP(fc::t_exit_crossed_out_mode) = \
|
||||||
C_STR(CSI "29m");
|
C_STR(CSI "29m");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace finalcut
|
} // namespace finalcut
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2018 Markus Gans *
|
* Copyright 2018-2019 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -457,7 +457,10 @@ char* FTermDetection::termtype_256color_quirks()
|
||||||
|
|
||||||
if ( (color_env.string5 && std::strlen(color_env.string5) > 0)
|
if ( (color_env.string5 && std::strlen(color_env.string5) > 0)
|
||||||
|| (color_env.string6 && std::strlen(color_env.string6) > 0) )
|
|| (color_env.string6 && std::strlen(color_env.string6) > 0) )
|
||||||
|
{
|
||||||
terminal_type.kde_konsole = true;
|
terminal_type.kde_konsole = true;
|
||||||
|
new_termtype = C_STR("konsole-256color");
|
||||||
|
}
|
||||||
|
|
||||||
if ( color_env.string3 && std::strlen(color_env.string3) > 0 )
|
if ( color_env.string3 && std::strlen(color_env.string3) > 0 )
|
||||||
decscusr_support = true;
|
decscusr_support = true;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2015-2018 Markus Gans *
|
* Copyright 2015-2019 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -2331,16 +2331,9 @@ void FWidget::setColorTheme()
|
||||||
// Sets the default color theme
|
// Sets the default color theme
|
||||||
|
|
||||||
if ( getMaxColor() < 16 ) // for 8 color mode
|
if ( getMaxColor() < 16 ) // for 8 color mode
|
||||||
{
|
|
||||||
wc.set8ColorTheme();
|
wc.set8ColorTheme();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
wc.set16ColorTheme();
|
wc.set16ColorTheme();
|
||||||
|
|
||||||
if ( isKdeTerminal() )
|
|
||||||
wc.term_bg = fc::SkyBlue2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace finalcut
|
} // namespace finalcut
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2018 Markus Gans *
|
* Copyright 2018-2019 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
* <http://www.gnu.org/licenses/>. *
|
* <http://www.gnu.org/licenses/>. *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include "final/fterm.h"
|
||||||
#include "final/fwidgetcolors.h"
|
#include "final/fwidgetcolors.h"
|
||||||
|
|
||||||
namespace finalcut
|
namespace finalcut
|
||||||
|
@ -206,6 +207,9 @@ void FWidgetColors::set16ColorTheme()
|
||||||
scrollbar_button_bg = fc::LightGray;
|
scrollbar_button_bg = fc::LightGray;
|
||||||
progressbar_fg = fc::DarkGray;
|
progressbar_fg = fc::DarkGray;
|
||||||
progressbar_bg = fc::LightBlue;
|
progressbar_bg = fc::LightBlue;
|
||||||
|
|
||||||
|
if ( ! FTerm::canChangeColorPalette() && FTerm::getMaxColor() > 16 )
|
||||||
|
term_bg = fc::SkyBlue2;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace finalcut
|
} // namespace finalcut
|
||||||
|
|
|
@ -224,6 +224,7 @@ class FTerm
|
||||||
static bool hasShadowCharacter();
|
static bool hasShadowCharacter();
|
||||||
static bool hasHalfBlockCharacter();
|
static bool hasHalfBlockCharacter();
|
||||||
static bool hasAlternateScreen();
|
static bool hasAlternateScreen();
|
||||||
|
static bool canChangeColorPalette();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
static void setTermType (const char[]);
|
static void setTermType (const char[]);
|
||||||
|
@ -364,7 +365,6 @@ class FTerm
|
||||||
static void init_tab_quirks();
|
static void init_tab_quirks();
|
||||||
static void init_captureFontAndTitle();
|
static void init_captureFontAndTitle();
|
||||||
static bool hasNoFontSettingOption();
|
static bool hasNoFontSettingOption();
|
||||||
static bool canChangeColorPalette();
|
|
||||||
static void redefineColorPalette();
|
static void redefineColorPalette();
|
||||||
static void restoreColorPalette();
|
static void restoreColorPalette();
|
||||||
static void setInsertCursorStyle();
|
static void setInsertCursorStyle();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* *
|
* *
|
||||||
* This file is part of the Final Cut widget toolkit *
|
* This file is part of the Final Cut widget toolkit *
|
||||||
* *
|
* *
|
||||||
* Copyright 2018 Markus Gans *
|
* Copyright 2018-2019 Markus Gans *
|
||||||
* *
|
* *
|
||||||
* The Final Cut is free software; you can redistribute it and/or *
|
* The Final Cut is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of the GNU Lesser General Public License *
|
* modify it under the terms of the GNU Lesser General Public License *
|
||||||
|
@ -85,6 +85,7 @@ class FTermcapQuirks
|
||||||
static void sunConsole();
|
static void sunConsole();
|
||||||
static void screen();
|
static void screen();
|
||||||
static void general();
|
static void general();
|
||||||
|
static void ecma48();
|
||||||
|
|
||||||
// Data Members
|
// Data Members
|
||||||
static FTermcap::tcap_map* tcap;
|
static FTermcap::tcap_map* tcap;
|
||||||
|
|
Loading…
Reference in New Issue