mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-08 07:08:39 +01:00
- preventing writing a notification window that completerd his life cycle.
This commit is contained in:
parent
ff8813a5aa
commit
4dc58c1a3c
@ -39,12 +39,18 @@
|
|||||||
(defun notify-window-p (thing)
|
(defun notify-window-p (thing)
|
||||||
(typep thing 'notify-window))
|
(typep thing 'notify-window))
|
||||||
|
|
||||||
|
(defun notification-terminated-p (notification-window)
|
||||||
|
(< (life notification-window) 0.0))
|
||||||
|
|
||||||
|
(defun notification-alive-p (notification-window)
|
||||||
|
(not (notification-terminated-p notification-window)))
|
||||||
|
|
||||||
(defmethod refresh-config :after ((object notify-window))
|
(defmethod refresh-config :after ((object notify-window))
|
||||||
(refresh-config-colors object swconf:+key-notify-window+))
|
(refresh-config-colors object swconf:+key-notify-window+))
|
||||||
|
|
||||||
(defmethod calculate ((object notify-window) dt)
|
(defmethod calculate ((object notify-window) dt)
|
||||||
(with-accessors ((life life)) object
|
(with-accessors ((life life)) object
|
||||||
(when (< life 0.0)
|
(when (notification-terminated-p object)
|
||||||
(let ((remove-win-event (make-instance 'program-events:remove-notify-user-event
|
(let ((remove-win-event (make-instance 'program-events:remove-notify-user-event
|
||||||
:payload object)))
|
:payload object)))
|
||||||
(win-close object)
|
(win-close object)
|
||||||
@ -58,7 +64,8 @@
|
|||||||
|
|
||||||
(defmethod draw-pending ((object notify-window))
|
(defmethod draw-pending ((object notify-window))
|
||||||
(with-accessors ((pending pending)) object
|
(with-accessors ((pending pending)) object
|
||||||
(when (> pending 0)
|
(when (and (> pending 0)
|
||||||
|
(notification-alive-p object))
|
||||||
(print-text object
|
(print-text object
|
||||||
(format nil (n_ "~a pending"
|
(format nil (n_ "~a pending"
|
||||||
"~a pending"
|
"~a pending"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user