btzy / circuit-sandbox

GNU General Public License v3.0
3 stars 1 forks source link

Notification display system #42

Closed btzy closed 6 years ago

btzy commented 6 years ago

Notification display system

Display notification messages at the bottom-left of the play area. They have a translucent black background, and do not capture mouse events (i.e. mouse events pass through the notification display and are received by the play area).

There are two types of notifications:

  1. Those that disappear automatically after 5 seconds
  2. Those that are removed explicitly

Messages should be displayable in colour, just like the button bar description.

The notification display should support having multiple messages on display at the same time, and perhaps have simple animation like fade-out when the message needs to disappear.

(Type 1) Those that disappear automatically after 5 seconds include:

(Type 2) Those that are removed explicitly include:

Notification mode

We might want certain notifications to be only displayed in beginner mode. Two possible designs:

Type 2 notifications with RAII

It is useful for callers to use RAII to manage Type 2 notifications. Callers should construct a notification object to display the notification and destruct it to remove the notification. In this way, callers can never forget to remove a notification.

btzy commented 6 years ago

Notification display implemented in e2403327c76532f9338c1dd15010c66408592fea.

Beginner mode can only be enabled via a hotkey ('B'). There is currently no visible UI to toggle beginner mode (#46).