NCurses: use the general face merging function to handle default face
Merge attributes as well, and reuse an existing function instead of reimplementing the same logic again. Closes #1684
This commit is contained in:
parent
1f02a1f7e2
commit
b298e01390
|
@ -198,10 +198,7 @@ void NCursesUI::set_face(NCursesWin* window, Face face, const Face& default_face
|
||||||
if (m_active_pair != -1)
|
if (m_active_pair != -1)
|
||||||
wattroff(window, COLOR_PAIR(m_active_pair));
|
wattroff(window, COLOR_PAIR(m_active_pair));
|
||||||
|
|
||||||
if (face.fg == Color::Default)
|
face = merge_faces(default_face, face);
|
||||||
face.fg = default_face.fg;
|
|
||||||
if (face.bg == Color::Default)
|
|
||||||
face.bg = default_face.bg;
|
|
||||||
|
|
||||||
if (face.fg != Color::Default or face.bg != Color::Default)
|
if (face.fg != Color::Default or face.bg != Color::Default)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user