aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-10 21:03:50 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:55 +0200
commit19f5d93dba74dda1fd1a9211707d98b6dd9b19ba (patch)
treeed2576cbcd54655d0b006991cc8834d2c95c64f0 /src/engine/graphics
parentc988905add09cf8baf46dc61279528f6f39f7a1a (diff)
feat: add status bar background color
Diffstat (limited to 'src/engine/graphics')
-rw-r--r--src/engine/graphics/scene.cpp8
-rw-r--r--src/engine/graphics/scene.hpp2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp
index c4a398c..6b85915 100644
--- a/src/engine/graphics/scene.cpp
+++ b/src/engine/graphics/scene.cpp
@@ -1,7 +1,9 @@
#include "scene.hpp"
#include "engine/escape.hpp"
+#include "util/color.hpp"
+#include <fmt/color.h>
#include <fmt/core.h>
#include <iostream>
#include <utility>
@@ -49,10 +51,14 @@ void Scene::write_status(const std::string_view &str) noexcept
const auto window_size = _window->size();
_cursor_controller->move_to(
- Vector2({.x = 1, .y = static_cast<Vector2::Value>(window_size.get_height())}));
+ Vector2({.x = 2, .y = static_cast<Vector2::Value>(window_size.get_height())}));
+ const auto background_color = get_background_esc_seq(STATUSBAR_COLOR);
+
+ fmt::print("{}", background_color);
fmt::print(ERASE_ENTIRE_LINE, fmt::arg("esc", ESC));
fmt::print(fmt::runtime(str.data()));
+ fmt::print(RESET_ALL_MODES, fmt::arg("esc", ESC));
_cursor_controller->move_to(previous_position);
}
diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp
index 3d05cd9..22a96a4 100644
--- a/src/engine/graphics/scene.hpp
+++ b/src/engine/graphics/scene.hpp
@@ -14,6 +14,8 @@ constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l";
constexpr fmt::string_view ERASE_ENTIRE_LINE = "{esc}[2K";
+constexpr uint32_t STATUSBAR_COLOR = 0x1A1A1AU;
+
class Scene : public IScene
{
public: