class TermBuf::PasteNotice

Overview

A panel saying a paste is arriving, so a long one does not look like a hung application.

The driver will not draw this. The buffer belongs to the application, and something writing into it uninvited would have to undraw itself and would fight whatever else was painting. So the decoder reports and this draws: Events::Pasting opens it and Events::Paste closes it.

in TermBuf::Events::Pasting then notice.arriving event.bytes
in TermBuf::Events::Paste   then notice.finished

and #draw does nothing at all while nothing is arriving.

Defined in:

termbuf/widgets/paste_notice.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(label : String = "pasting", style : Style = Style::DEFAULT.reverse, border : Border | Nil = nil) #

[View source]

Instance Method Detail

def arriving(bytes : Int32) : Nil #

A paste has been going long enough to be worth mentioning, and has bytes so far.


[View source]
def border : Border | Nil #

Drawn around the panel, or nil for none.


[View source]
def border=(border : Border | Nil) #

Drawn around the panel, or nil for none.


[View source]
def bytes : Int32 | Nil #

Bytes collected so far, or nil when nothing is arriving.


[View source]
def draw(screen : Drawing, area : Rect) : Nil #

Draws centred within area, or nothing at all when no paste is arriving.


[View source]
def finished : Nil #

The paste is over.


[View source]
def label : String #

What it says, before the byte count.


[View source]
def label=(label : String) #

What it says, before the byte count.


[View source]
def style : Style #

What the panel is drawn in.


[View source]
def style=(style : Style) #

What the panel is drawn in.


[View source]
def text : String #

What the panel says, which is the byte count as it grows.


[View source]
def visible? : Bool #

Whether there is anything to draw.


[View source]