Commit Graph

404 Commits

Author SHA1 Message Date
Jan Hrček
3bd2235c0c Fix some hlint warnings 2022-09-24 12:56:11 +02:00
Jonathan Daugherty
a117ff7790 Whitespace 2022-09-21 13:50:39 -07:00
Jonathan Daugherty
5ebe98eac6 brick-theme-demo: nit 2022-09-21 13:48:18 -07:00
Jonathan Daugherty
5fe19ab046 brick-fill-demo: improve UI 2022-09-21 13:46:40 -07:00
Jonathan Daugherty
9af37e9404 CustomKeybindingDemo: comment edit 2022-08-22 12:55:05 -07:00
Jonathan Daugherty
e74623c323 keyDispatcher: fail with collision info if collisions are detected
This fixes a critical problem in KeyDispatcher where it would previously
silently ignore all but one handler for a specified key if the key
configuration resulted in the same key being mapped to multiple handlers
(either by event or by statically specified key).
2022-08-18 18:49:43 -07:00
Jonathan Daugherty
9cc2d5eafb reverseKeyMappings -> keyEventMappings 2022-08-18 18:22:50 -07:00
Jonathan Daugherty
4c8fc07178 CustomKeybindingDemo: add extra details about keybinding collision checking 2022-08-18 16:21:43 -07:00
Jonathan Daugherty
4e6b90d928 KeyConfig: add reverseKeyMappings to allow applications to check for colliding bindings
This change also adjusts KeyConfig's internals so that collisions are
preserved since they may not actually be bad.
2022-08-18 14:59:00 -07:00
Jonathan Daugherty
f6727b114d CustomKeybindingDemo: better state field name 2022-08-08 14:21:19 -07:00
Jonathan Daugherty
8763de2df9 CustomKeybindingDemo: nit 2022-08-08 14:20:39 -07:00
Jonathan Daugherty
f4b06804da CustomKeybindingDemo: nit 2022-08-08 14:19:50 -07:00
Jonathan Daugherty
776f631f23 CustomKeybindingDemo: UI nit 2022-08-08 14:15:09 -07:00
Jonathan Daugherty
b5b1f9329e Keybindings.Pretty: add keybindingHelpBaseAttr, eventNameAttr, eventDescriptionAttr, and keybindingAttr and show off in demo program 2022-08-08 14:08:47 -07:00
Jonathan Daugherty
45a6d57717 CustomKeybindingDemo: add helpful tip 2022-08-04 19:23:34 -07:00
Jonathan Daugherty
3817b456e8 CustomKeybindingDemo: layout improvements 2022-08-04 19:21:38 -07:00
Jonathan Daugherty
b8735a16bc CustomKeybindingDemo: UI nit 2022-08-04 19:21:30 -07:00
Jonathan Daugherty
8f2716ab2a CustomKeybindingDemo: comment 2022-08-04 19:16:44 -07:00
Jonathan Daugherty
b0fbd7f638 CustomKeybindingDemo: improve comments 2022-08-04 19:16:15 -07:00
Jonathan Daugherty
1ba4c0974d Comment nit 2022-08-04 19:13:13 -07:00
Jonathan Daugherty
ad91a0b727 CustomKeybindingDemo: add a working example INI file to load 2022-08-04 19:10:31 -07:00
Jonathan Daugherty
d10e6cd374 CustomKeybindingDemo: demonstrate loading custom bindings 2022-08-04 19:07:47 -07:00
Jonathan Daugherty
6f1b62ae53 AttrName: remove IsString instance
This change is motivated by the API wart that results from the
overloading of both "<>" and string literals that resulted in code like
this:

  a :: AttrName
  a = "blah" <> "things"

While this worked to create an AttrName with two segments, it is far too
easy to read this as two strings concatenated. The overloading hides
what is really going on with the segments of the attribute name. The way
to write the above example after this change is:

  a :: AttrName
  a = attrName "blah" <> attrName "things"
2022-08-04 18:44:57 -07:00
Jonathan Daugherty
bf58926132 Whitespace 2022-08-03 08:19:43 -07:00
Jonathan Daugherty
6c0fb8da24 CustomKeybindingDemo: nit 2022-08-02 20:13:22 -07:00
Jonathan Daugherty
4225f813a2 CustomKeybindingDemo: add another fixed key handler 2022-08-02 20:13:01 -07:00
Jonathan Daugherty
a768c6600d CustomKeybindingDemo: nit 2022-08-02 20:10:33 -07:00
Jonathan Daugherty
6bc22b87d7 Binding: ignore modifier order and duplication 2022-08-02 20:09:13 -07:00
Jonathan Daugherty
b3cb7a54b4 CustomKeybindingDemo: edit 2022-08-02 19:52:14 -07:00
Jonathan Daugherty
f6ec9233ab CustomKeybindingDemo: comment 2022-08-02 19:51:05 -07:00
Jonathan Daugherty
dc783e4126 CustomKeybindingDemo: comment 2022-08-02 19:50:13 -07:00
Jonathan Daugherty
d7f8e4daf4 CustomKeybindingDemo: add an example of a hard-coded key event handler 2022-08-02 19:48:47 -07:00
Jonathan Daugherty
286c88b137 CustomKeybindingDemo: comment 2022-08-02 19:44:44 -07:00
Jonathan Daugherty
5996440eb3 CustomKeybindingDemo: comment 2022-08-02 19:44:05 -07:00
Jonathan Daugherty
1807e6d8d9 CustomKeybindingDemo: comments 2022-08-02 19:42:57 -07:00
Jonathan Daugherty
ccad8abb27 keybindingHelpWidget: do not require input to come with a section heading 2022-08-02 19:40:23 -07:00
Jonathan Daugherty
fec4c11477 Add initial custom keybinding demo program 2022-08-02 19:24:35 -07:00
Jonathan Daugherty
dee90efa8c Remove withLens and withFirst in lieu of a Zoom instance for EventM
This change makes it possible to use the "zoom" function from
microlens-mtl to zoom in on a state field in EventM. This change adds a
re-export of "zoom" to Brick.Types for convenience.
2022-07-26 19:49:29 -07:00
Jonathan Daugherty
bf2f6be870 Move Padding type from Brick.Types to Brick.Widgets.Core 2022-07-22 16:07:00 -07:00
Jonathan Daugherty
b0273b0109 MouseDemo: move Vty handle operations into appStartEvent 2022-07-21 14:22:11 -07:00
Jonathan Daugherty
2838263c22 MouseDemo: whitespace 2022-07-21 14:18:49 -07:00
Jonathan Daugherty
875c305ad4 handleEventLensed -> withLens (generalize API), add nestEventM 2022-07-17 16:50:54 -07:00
Jonathan Daugherty
f2f8013d63 Types: re-export state monad functions as part of API 2022-07-16 23:17:45 -07:00
Jonathan Daugherty
a5b3240758 Hide state type variable in ViewportScroll to avoid unnecessary API change 2022-07-16 23:13:37 -07:00
Jonathan Daugherty
4ea1f65d86 Update demo programs for changes to EventM 2022-07-16 23:10:03 -07:00
Jonathan Daugherty
8eb41ca8c3 handleEditorEvent: handle mouse click events to place the cursor (adds Eq constraint to handleEditorEvent) 2022-07-09 08:30:42 -07:00
Jonathan Daugherty
65645be3d2 Edit: handle BrickEvents, not Events
This is a breaking API change that changes handleEditorEvent to take
BrickEvents instead of Events. This paves the way for handling Brick's
mouse events in the editor.
2022-07-09 08:23:32 -07:00
Jonathan Daugherty
322bd7d0bb Update README and README demo program to match 2022-06-19 21:52:45 -07:00
Jonathan Daugherty
b97300faf7 LayerDemo: add missing CPP pragma 2022-05-23 13:51:24 -07:00
Jonathan Daugherty
2bc6db1973 LayerDemo: fix for older GHCs 2022-05-23 13:44:00 -07:00