v0.2.0.0
版本发布时间: 2021-09-16 23:55:15
reflex-frp/reflex-vty最新发布版本:v0.5.2.1(2024-05-25 09:59:31)
0.2.0.0
-
Module Reorganization: The following modules have been added (and are all re-exported by Reflex.Vty):
- Reflex.Vty.Widget.Box for all the box functions and datatypes
- Reflex.Vty.Widget.Input.Mouse for clicking, dragging, and scrolling
- Reflex.Vty.Widget.Split contains
splitV
,splitH
, etc - Reflex.Vty.Widget.Text contains text rendering functions like
text
anddisplay
-
Bugfixes:
- Remove text-icu dependency and switch to
wcwidth
from vty package to compute character width inData.Text.Zipper
. -
goToDisplayLinePosition
inData.Text.Zipper
correctly accounts for character width now. -
#37
Layout
should support focus changes through nested layouts (thanks @pdlla for getting this started -- see entry on Layout and Focus below). - Fix distribution of available space when it cannot be evenly distributed. Previously, all leftover space would be allocated to the first stretchable widget.
- Remove text-icu dependency and switch to
-
Breaking Changes:
- Layout and focus have been substantially refactored to fix #37 and support a wider variety of layouts and focus switching requirements.
- Added a new
HasFocus
class (the old one is nowHasFocusReader
) to produce focusable elements, and manage focus state. See the "Focus" section of the Reflex.Vty.Widget.Layout module documentation. -
Layout
no longer has any focus-tracking responsibility. See the "Layout" section of the Reflex.Vty.Widget.Layout module documentation. -
tile
no longer takes a configuration record and no longer requires that its child widget return a focus request event. Focus requests are instead handled using calls torequestFocus
in the child widget. - Calls to
fixed
andstretch
must now be replaced withtile . fixed
andtile . stretch
-
stretch
now takes a minimum size argument - Added
flex
which is equivalent tostretch 0
-
tabNavigation
no longer returns anEvent
. Instead it callsrequestFocus
directly with the appropriateRefocus_Shift
value. - Added
axis
(inHasLayout
), a lower-level primitive which is used to implementrow
andcol
. - Added
region
(inHasLayout
), which is used to claim screen real estate and used to implementtile
andgrout
- Added
grout
, a container element that is not itself focusable (though its children can be)
- Added a new
- Removed
VtyWidget
and replaced it with a number of separate classes and monad transformers- Replace
HasDisplaySize
withHasDisplayRegion
which carries around a region instead of just a width and height.displayWidth
anddisplayHeight
are now functions implemented in terms ofaskRegion
instead of class methods. - Add a
DisplayRegion
monad transformer - Rename
ImageWriter
toHasImageWriter
- Introduce an
ImageWriter
monad transformer - Rename
HasFocus
toHasFocusReader
- Introduce a
FocusReader
monad transformer - Replace
HasVtyInput
withHasInput
- Introduce an
Input
monad transformer - Introduce
HasTheme
reader class to allow setting Vty attributes of all built-in widgets - Introduce
ThemeReader
monad transformer
- Replace
- Remove
DynRegion
andcurrentRegion
. UseDynamic t Region
andcurrent
instead. This also changes the type ofpane
's argument. -
CheckboxConfig
now has a field taking anEvent
to set the value of the checkbox. -
checkbox
now accepts keyboard input (spacebar to check and uncheck) and is displayed in bold when focused. -
HasInput
(formerlyHasVtyInput
) now has a methodlocalInput
for filtering the input a child widget may receive -
HasImageWriter
now has a methodmapImages
for transforming the images emitted by a child widget -
boxTitle
now takes aBehavior t Text
as its title, instead of a plainText
-
fill
now takes aBehavior t Char
instead of aChar
- The following functions are no longer specialized to
VtyWidget
:-
pane
: Now requiresHasInput t m, HasImageWriter t m, HasDisplayRegion t m, HasFocusReader t m
-
drag
: Now requiresHasInput
-
mouseDown
: Now requiresHasInput
-
mouseUp
: Now requiresHasInput
-
mouseScroll
: Now requiresHasInput
-
key
: Now requiresHasInput
-
keys
: Now requiresHasInput
-
keyCombo
: Now requiresHasInput
-
keyCombos
: Now requiresHasInput
-
splitV
: Now requiresHasDisplayRegion t m, HasInput t m, HasImageWriter t m, HasFocusReader t m
-
splitH
: Now requiresHasDisplayRegion t m, HasInput t m, HasImageWriter t m, HasFocusReader t m
-
splitVDrag
: Now requiresHasDisplayRegion t m, HasInput t m, HasImageWriter t m, HasFocusReader t m
-
fill
: Now requiresHasImageWriter
andHasDisplayRegion
-
boxTitle
: Now requiresHasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasFocusReader t m, HasTheme t m
-
box
: Now requiresHasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasFocusReader t m, HasTheme t m
-
boxStatic
: Now requiresHasDisplayRegion t m, HasImageWriter t m, HasInput t m, HasFocusReader t m, HasTheme t m
-
richText
: Now requiresHasImageWriter
, andHasDisplayRegion
-
scrollableText
: Now requiresHasInput
,HasImageWriter
,HasTheme
, andHasDisplayRegion
-
blank
: Now requiresMonad
-
button
: Now requiresHasFocusReader
,HasInput
,HasImageWriter
,HasTheme
, andHasDisplayRegion
-
textButton
: Now requiresHasFocusReader
,HasInput
,HasImageWriter
,HasTheme
, andHasDisplayRegion
-
textButtonStatic
: Now requiresHasFocusReader
,HasInput
,HasImageWriter
,HasTheme
, andHasDisplayRegion
-
link
: Now requiresHasInput
,HasImageWriter
,HasTheme
, andHasDisplayRegion
-
checkbox
: Now requiresHasFocusReader
,HasInput
,HasImageWriter
, andHasDisplayRegion
-
- TextZipper interface changes
-
_displayLines_offsetMap
type changed toOffsetMapWithAlignment
-
_displayLines_cursorY
replaced with_displayLines_cursorPos
which include X position - some exposed methods intended for internal use only have been removed
-
textInput
: Now requiresHasFocusReader
,HasInput
,HasImageWriter
,HasTheme
, andHasDisplayRegion
-
multilineTextInput
: Now requiresHasFocusReader
,HasInput
,HasImageWriter
,HasTheme
, andHasDisplayRegion
-
textInputTile
: Now requiresHasFocusReader
,HasInput
,HasLayout
,HasTheme
, andHasFocus
-
- Layout and focus have been substantially refactored to fix #37 and support a wider variety of layouts and focus switching requirements.
-
Misc:
- (#40 Add alignment support to TextZipper)[https://github.com/reflex-frp/reflex-vty/pull/40]
- Add alignment (left/center/right) support to TextZipper
- Add basic unit tests for newly created alignment methods in TextZipper
- Add default instances for
HasInput
,HasFocus
, andHasImageWriter
- Export
withinImage
and addimagesInRegion
to crop images to a region - Add
anyChildFocused
, which provides information about whether subwidgets are focused - Add
filterKeys
, which is the same aslocalInput
but only cares about keyboard events - Add
hoistRunLayout
to apply a transformation to the context of aLayout
action and run that action - Add various
MFunctor
instances - Add a CPU usage indicator to the example executable
- (#40 Add alignment support to TextZipper)[https://github.com/reflex-frp/reflex-vty/pull/40]