Add support for setting window title

This commit is contained in:
Joscha 2024-01-05 13:33:08 +01:00
parent 77b4f825c9
commit 2714deeafb
3 changed files with 18 additions and 1 deletions

View file

@ -7,6 +7,7 @@ use crate::{Pos, Size, Styled, WidthDb};
pub struct Frame {
pub(crate) widthdb: WidthDb,
pub(crate) buffer: Buffer,
pub(crate) title: Option<String>,
}
impl Frame {
@ -24,6 +25,7 @@ impl Frame {
pub fn reset(&mut self) {
self.buffer.reset();
self.title = None;
}
pub fn cursor(&self) -> Option<Pos> {
@ -42,6 +44,10 @@ impl Frame {
self.set_cursor(None);
}
pub fn set_title(&mut self, title: Option<String>) {
self.title = title;
}
pub fn widthdb(&mut self) -> &mut WidthDb {
&mut self.widthdb
}