Small fixes

This commit is contained in:
Markus Gans 2019-10-06 00:36:58 +02:00
parent a279a0981a
commit 66ff1ba208
2 changed files with 11 additions and 6 deletions

View File

@ -420,8 +420,7 @@ bool FButtonGroup::isRadioButton (const FToggleButton* button) const
if ( ! button )
return false;
return bool ( std::strcmp ( button->getClassName()
, C_STR("FRadioButton") ) == 0 );
return bool( button->getClassName() == "FRadioButton" );
}
//----------------------------------------------------------------------

View File

@ -991,12 +991,13 @@ void FTerm::setPalette (FColor index, int r, int g, int b)
const auto& Ic = TCAP(fc::t_initialize_color);
const auto& Ip = TCAP(fc::t_initialize_pair);
bool state{false};
index = FOptiAttr::vga2ansi(index);
if ( Ic || Ip )
{
const char* color_str = "";
const char* color_str{};
int rr = (r * 1001) / 256
, gg = (g * 1001) / 256
@ -1007,15 +1008,20 @@ void FTerm::setPalette (FColor index, int r, int g, int b)
else if ( Ip )
color_str = tparm(Ip, index, 0, 0, 0, rr, gg, bb, 0, 0);
if ( color_str )
{
putstring (color_str);
state = true;
}
}
#if defined(__linux__)
else
{
linux->setPalette(index, r, g, b);
state = linux->setPalette(index, r, g, b);
}
#endif
if ( state )
std::fflush(stdout);
}