From 61ca97840b0a36e7d02be437517aa381c113f641 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Thu, 16 Jul 2020 21:39:05 +0200 Subject: [PATCH] Fix default char for checkbox and radiobox on Windows. This addresses: https://github.com/ArthurSonzogni/FTXUI/issues/27 --- include/ftxui/component/checkbox.hpp | 7 +++++-- include/ftxui/component/radiobox.hpp | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/ftxui/component/checkbox.hpp b/include/ftxui/component/checkbox.hpp index 1dcffea..ffcee32 100644 --- a/include/ftxui/component/checkbox.hpp +++ b/include/ftxui/component/checkbox.hpp @@ -20,10 +20,13 @@ class CheckBox : public Component { bool state = false; std::wstring label = L"label"; - // std::wstring checked = L"[X] "; - // std::wstring unchecked = L"[ ] "; +#if defined(_WIN32) + std::wstring checked = L"[X] "; + std::wstring unchecked = L"[ ] "; +#else std::wstring checked = L"▣ "; std::wstring unchecked = L"☐ "; +#endif Decorator focused_style = inverted; Decorator unfocused_style = nothing; diff --git a/include/ftxui/component/radiobox.hpp b/include/ftxui/component/radiobox.hpp index a938b1b..726f763 100644 --- a/include/ftxui/component/radiobox.hpp +++ b/include/ftxui/component/radiobox.hpp @@ -21,8 +21,13 @@ class RadioBox : public Component { int focused = 0; std::vector entries; +#if defined(_WIN32) + std::wstring checked = L"(*) "; + std::wstring unchecked = L"( ) "; +#else std::wstring checked = L"◉ "; std::wstring unchecked = L"○ "; +#endif Decorator focused_style = inverted; Decorator unfocused_style = nothing;