Skip to content

Commit 1e81736

Browse files
committed
Limit color pairs on Raspi terminal
1 parent ce87f43 commit 1e81736

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ configure_file(
3232

3333

3434

35-
36-
3735
if (NWINDOWS_STRICT_COMPILER_OPTIONS)
3836

3937
set(CMAKE_CXX_STANDARD 20)

examples/nwindows_test/unicode_test_window.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ void unicode_test_window(NWindow::ptr parentWindow /* = nullptr */)
3030
NTextElement::ptr keyIndicator;
3131

3232
std::string oGrave = u32string_to_utf8(U"o\u0300");
33-
auto boundsColor = window->make_color_pair(0xC0C0C0, 0x4040C0);
33+
NColorPair boundsColor;
34+
if (parentWindow && parentWindow->max_color_pairs() > 8) {
35+
boundsColor = window->make_color_pair(0xC0C0C0, 0x4040C0);
36+
} else {
37+
boundsColor = window->make_color_pair(0xE00000, 0x000000);
38+
}
3439
window
3540
| title("Unicode Tests")
3641
| add_child(

0 commit comments

Comments
 (0)