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:
Maxime Coste 2017-11-12 23:02:40 +08:00
parent 1f02a1f7e2
commit b298e01390

View File

@ -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)
{ {