Skip to content

Commit 1590abd

Browse files
committed
Label magic time-per-line durations
Signed-off-by: simonmicro <simon@simonmicro.de>
1 parent 6014ee9 commit 1590abd

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

include/osw_ui.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class OswUI {
5959
private:
6060
unsigned char countLines(const std::string& message) const;
6161

62+
const unsigned long notificationDurationPerLinePersistant = 300'000;
63+
const unsigned long notificationDurationPerLine = 5'000;
64+
6265
static size_t count;
6366
const size_t id{};
6467
const String message{};

src/osw_ui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void OswUI::OswUIProgress::draw() {
309309
size_t OswUI::OswUINotification::count{};
310310

311311
OswUI::OswUINotification::OswUINotification(std::string message, bool isPersistent)
312-
: id(count), message{message.c_str()}, lines(countLines(message)), endTime{millis() + (isPersistent ? 300'000 : 5'000) * lines} {
312+
: id(count), message{message.c_str()}, lines(countLines(message)), endTime{millis() + (isPersistent ? notificationDurationPerLinePersistant : notificationDurationPerLine) * lines} {
313313
++count;
314314
}
315315

0 commit comments

Comments
 (0)