# HG changeset patch # User David Demelier # Date 1580213122 -3600 # Node ID 1aec066bcdae6c96db249cb602cfeccfbdd2eab5 # Parent 53b217afe122fd856a46e428747aae197ce7352a core: allow quick message with MESSAGE_QUICK diff -r 53b217afe122 -r 1aec066bcdae src/core/message.c --- a/src/core/message.c Mon Jan 27 14:13:49 2020 +0100 +++ b/src/core/message.c Tue Jan 28 13:05:22 2020 +0100 @@ -131,7 +131,7 @@ assert(msg); msg->elapsed = 0; - msg->state = MESSAGE_OPENING; + msg->state = msg->flags & MESSAGE_QUICK ? MESSAGE_SHOWING : MESSAGE_OPENING; msg->height[0] = texture_height(msg->frame); msg->height[1] = 0; @@ -157,7 +157,7 @@ msg->index++; break; case KEY_ENTER: - msg->state = MESSAGE_HIDING; + msg->state = msg->flags & MESSAGE_QUICK ? MESSAGE_HIDING : MESSAGE_NONE; msg->elapsed = 0; break; default: @@ -189,7 +189,7 @@ case MESSAGE_SHOWING: /* Do automatically switch state if requested by the user. */ if (msg->flags & MESSAGE_AUTOMATIC && msg->elapsed >= MESSAGE_TIMEOUT) { - msg->state = MESSAGE_HIDING; + msg->state = msg->flags & MESSAGE_QUICK ? MESSAGE_NONE : MESSAGE_HIDING; msg->elapsed = 0; } diff -r 53b217afe122 -r 1aec066bcdae src/core/message.h --- a/src/core/message.h Mon Jan 27 14:13:49 2020 +0100 +++ b/src/core/message.h Tue Jan 28 13:05:22 2020 +0100 @@ -75,7 +75,8 @@ */ enum message_flags { MESSAGE_AUTOMATIC = (1 << 0), /*!< Will automatically change state by itself. */ - MESSAGE_QUESTION = (1 << 1) /*!< The message is a question. */ + MESSAGE_QUESTION = (1 << 1), /*!< The message is a question. */ + MESSAGE_QUICK = (1 << 2), /*!< Avoid animations. */ }; /**