Small fixes
This commit is contained in:
parent
a279a0981a
commit
66ff1ba208
|
@ -420,8 +420,7 @@ bool FButtonGroup::isRadioButton (const FToggleButton* button) const
|
||||||
if ( ! button )
|
if ( ! button )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return bool ( std::strcmp ( button->getClassName()
|
return bool( button->getClassName() == "FRadioButton" );
|
||||||
, C_STR("FRadioButton") ) == 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -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& Ic = TCAP(fc::t_initialize_color);
|
||||||
const auto& Ip = TCAP(fc::t_initialize_pair);
|
const auto& Ip = TCAP(fc::t_initialize_pair);
|
||||||
|
bool state{false};
|
||||||
|
|
||||||
index = FOptiAttr::vga2ansi(index);
|
index = FOptiAttr::vga2ansi(index);
|
||||||
|
|
||||||
if ( Ic || Ip )
|
if ( Ic || Ip )
|
||||||
{
|
{
|
||||||
const char* color_str = "";
|
const char* color_str{};
|
||||||
|
|
||||||
int rr = (r * 1001) / 256
|
int rr = (r * 1001) / 256
|
||||||
, gg = (g * 1001) / 256
|
, gg = (g * 1001) / 256
|
||||||
|
@ -1007,15 +1008,20 @@ void FTerm::setPalette (FColor index, int r, int g, int b)
|
||||||
else if ( Ip )
|
else if ( Ip )
|
||||||
color_str = tparm(Ip, index, 0, 0, 0, rr, gg, bb, 0, 0);
|
color_str = tparm(Ip, index, 0, 0, 0, rr, gg, bb, 0, 0);
|
||||||
|
|
||||||
|
if ( color_str )
|
||||||
|
{
|
||||||
putstring (color_str);
|
putstring (color_str);
|
||||||
|
state = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
linux->setPalette(index, r, g, b);
|
state = linux->setPalette(index, r, g, b);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ( state )
|
||||||
std::fflush(stdout);
|
std::fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue