From 5a9273e11bdc2d8e2aa3de155ddc27b849e81cff Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Wed, 22 Dec 2021 20:21:05 -0500 Subject: [PATCH] Add panel::forceUpdate() --- src/board.cpp | 1 + src/panel/panel.cpp | 10 ++++++++++ src/panel/panel.hpp | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/board.cpp b/src/board.cpp index 48ec0dc..5adc9b4 100644 --- a/src/board.cpp +++ b/src/board.cpp @@ -361,6 +361,7 @@ void board::start(){ i = ++i % PANELS_LENGTH; OVERLAY->_title = PANELS[i]->_title; + OVERLAY->forceUpdate(); last_panel = start; } diff --git a/src/panel/panel.cpp b/src/panel/panel.cpp index 4ca639e..3abd45a 100644 --- a/src/panel/panel.cpp +++ b/src/panel/panel.cpp @@ -5,3 +5,13 @@ // #include "panel.hpp" + +using namespace dashboard::panel; + +void panel::forceUpdate(){ + if(_texture == nullptr) + initTexture(); + + update(); + update_texture(); +} diff --git a/src/panel/panel.hpp b/src/panel/panel.hpp index fa2a345..31699c0 100644 --- a/src/panel/panel.hpp +++ b/src/panel/panel.hpp @@ -25,6 +25,8 @@ namespace dashboard::panel { virtual ~panel() = default; virtual void draw() = 0; + + void forceUpdate(); //in milliseconds size_t _time_on_screen = 0;