index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff

Diffstat (limited to 'src/ui/toast.rs')

-rw-r--r-- src/ui/toast.rs 9
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/ui/toast.rs b/src/ui/toast.rs
index 4f453d5..9456d96 100644
--- a/src/ui/toast.rs
+++ b/src/ui/toast.rs
@@ -85,7 +85,14 @@
}

pub fn draw(f: &mut Frame, config: &ToastConfig, toasts: &[Toast]) {
    let visible_height = f.area().height;

    for (index, toast) in toasts.iter().enumerate() {
        let top_margin = config.margin.top + (index as u16 * 4);
        if top_margin >= visible_height - 4 {
            break;
        };

        let area = popup::popup_rect(
            f,
            &PopupConfig {
@@ -93,7 +100,7 @@
                height: 4,                                   // 4 = borders(2) + title(1) + msg(1)
                position: config.position,
                margin: Margin {
                    top: config.margin.top + (index as u16 * 4),
                    top: top_margin,
                    bottom: config.margin.bottom,
                    left: config.margin.left,
                    right: config.margin.right,