A widget option to specify the maximum canvas size.

This commit is contained in:
Jakub Sobon 2018-05-07 12:42:19 +01:00
parent e249f6ffc4
commit f31887b63c
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
1 changed files with 8 additions and 1 deletions

View File

@ -31,12 +31,19 @@ type Options struct {
// canvas of any ratio. // canvas of any ratio.
Ratio image.Point Ratio image.Point
// MinimumSize allows a widget to specify the smallest required canvas size. // MinimumSize allows a widget to specify the smallest allowed canvas size.
// If the terminal size and/or splits cause the assigned canvas to be // If the terminal size and/or splits cause the assigned canvas to be
// smaller than this, the widget will be skipped. I.e. The Draw() method // smaller than this, the widget will be skipped. I.e. The Draw() method
// won't be called until a resize above the specified minimum. // won't be called until a resize above the specified minimum.
MinimumSize image.Point MinimumSize image.Point
// MaximumSize allows a widget to specify the largest allowed canvas size.
// If the terminal size and/or splits cause the assigned canvas to be larger
// than this, the widget will only receive a canvas of this size within its
// container. Setting any of the two coordinates to zero indicates
// unlimited.
MaximumSize image.Point
// WantKeyboard allows a widget to request keyboard events. // WantKeyboard allows a widget to request keyboard events.
// If false, keyboard events won't be forwarded to the widget. // If false, keyboard events won't be forwarded to the widget.
// If true, the widget receives keyboard events if its container is // If true, the widget receives keyboard events if its container is