diff --git a/src/ProgressBar.cxx b/src/ProgressBar.cxx index 628a8e41..0d15ef3e 100644 --- a/src/ProgressBar.cxx +++ b/src/ProgressBar.cxx @@ -12,10 +12,9 @@ ProgressBar::ProgressBar(Point p, unsigned _width) noexcept :window(p, {_width, 1u}) { leaveok(window.w, true); -#ifdef ENABLE_COLORS + if (ui_options.enable_colors) window.SetBackgroundStyle(Style::PROGRESSBAR); -#endif } void diff --git a/src/StatusBar.cxx b/src/StatusBar.cxx index 9a159850..4814bdaa 100644 --- a/src/StatusBar.cxx +++ b/src/StatusBar.cxx @@ -29,10 +29,8 @@ StatusBar::StatusBar(EventLoop &event_loop, leaveok(window.w, false); keypad(window.w, true); -#ifdef ENABLE_COLORS if (ui_options.enable_colors) window.SetBackgroundStyle(Style::STATUS); -#endif } StatusBar::~StatusBar() noexcept diff --git a/src/TitleBar.cxx b/src/TitleBar.cxx index d0c05cf0..dcffbf1c 100644 --- a/src/TitleBar.cxx +++ b/src/TitleBar.cxx @@ -21,10 +21,8 @@ TitleBar::TitleBar(Point p, unsigned width) noexcept leaveok(window.w, true); keypad(window.w, true); -#ifdef ENABLE_COLORS if (ui_options.enable_colors) window.SetBackgroundStyle(Style::TITLE); -#endif } static inline int diff --git a/src/screen_init.cxx b/src/screen_init.cxx index 9014ef98..b57da07f 100644 --- a/src/screen_init.cxx +++ b/src/screen_init.cxx @@ -30,12 +30,10 @@ ScreenManager::ScreenManager(EventLoop &event_loop) noexcept keypad(main_window.w, true); -#ifdef ENABLE_COLORS if (ui_options.enable_colors) { /* set background attributes */ main_window.SetBackgroundStyle(Style::LIST); } -#endif } ScreenManager::~ScreenManager() noexcept diff --git a/src/ui/Options.hxx b/src/ui/Options.hxx index 61bfa035..3812452b 100644 --- a/src/ui/Options.hxx +++ b/src/ui/Options.hxx @@ -16,7 +16,10 @@ struct UiOptions { #ifdef ENABLE_COLORS bool enable_colors = true; +#else + static constexpr bool enable_colors = false; #endif + bool audible_bell = true; bool visible_bell; bool bell_on_wrap = true;