rustimal 0.8.0

A minimal, GPU-rendered terminal for Windows that runs Git Bash, with animated split panes and a glass look
//! The window's own chrome: the title bar, its buttons, and what the pointer is over.

use super::*;

#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Hit {
    None,
    Title,
    Min,
    Max,
    Close,
    Edge(ResizeDirection),
}

pub fn titlebar_height(scale: f32) -> f32 {
    (34.0 * scale).round()
}

pub fn title_buttons(scale: f32, width: f32) -> [(Hit, Rect); 3] {
    let bw = (46.0 * scale).round();
    let h = titlebar_height(scale);
    [
        (Hit::Min, Rect::new(width - 3.0 * bw, 0.0, bw, h)),
        (Hit::Max, Rect::new(width - 2.0 * bw, 0.0, bw, h)),
        (Hit::Close, Rect::new(width - bw, 0.0, bw, h)),
    ]
}