From b298e01390ceafbd8b800086f26307b6f28f6634 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 12 Nov 2017 23:02:40 +0800 Subject: [PATCH] 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 --- src/ncurses_ui.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index a1e95bd6..00fe269f 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -198,10 +198,7 @@ void NCursesUI::set_face(NCursesWin* window, Face face, const Face& default_face if (m_active_pair != -1) wattroff(window, COLOR_PAIR(m_active_pair)); - if (face.fg == Color::Default) - face.fg = default_face.fg; - if (face.bg == Color::Default) - face.bg = default_face.bg; + face = merge_faces(default_face, face); if (face.fg != Color::Default or face.bg != Color::Default) {