Commit Graph

898 Commits

Author SHA1 Message Date
Jonathan Daugherty
586df3c83b overrideAttr: update docs 2022-02-02 21:50:40 -08:00
Jonathan Daugherty
afc0c1da0f updateAttrMap: docs update 2022-02-02 21:48:18 -08:00
Jonathan Daugherty
e06bd1d7bb modifyDefAttr: update docs 2022-02-02 21:47:06 -08:00
Jonathan Daugherty
b60479253a AttrMap: docs tweak 2022-02-02 21:46:10 -08:00
Jonathan Daugherty
7e6bd61f8c Core: fix syntax error 2022-01-31 16:41:46 -08:00
Jonathan Daugherty
4ad3ffb5a2 Core.hyperlink: use attrL rather than duplicating context attribute lookup 2022-01-31 16:29:56 -08:00
Jonathan Daugherty
c1bce6a434 Core: improve attribute API docs somewhat 2022-01-31 16:09:26 -08:00
Jonathan Daugherty
338deace08 Improve docs for scroll bar handle enabling functions 2022-01-31 09:44:59 -08:00
Jonathan Daugherty
e402db29d4 suffixLenses: fix makeLenses link 2022-01-31 09:28:04 -08:00
Jonathan Daugherty
929d7b296a overrideAttr: imrove docs 2022-01-31 09:27:10 -08:00
Jonathan Daugherty
ea36444495 FileBrowser API change: export getters for all FileBrowser fields, stop exporting Lens for entry filter
This change removes fileBrowserEntryFilterL from the public API (which
was unsafe because it could not update the appropriate internal
state when used) and replaces it with fileBrowserEntryFilterG,
a getter for the same field. Users of the lens should be using
setFileBrowserEntryFilter.
2022-01-30 20:48:51 -08:00
Jonathan Daugherty
563dc75686 File browser docs: clarification 2022-01-30 20:17:35 -08:00
Jonathan Daugherty
dd4639e770 Typo 2022-01-30 16:59:52 -08:00
Mario Lang
25a07c61e6 Use find instead of filter and listToMaybe 2022-01-28 21:00:54 +01:00
Jonathan Daugherty
590af4dce0 cached: do not cache visibility requests
This fixes a bug where a cached image can cause a containing viewport to
honor a visibility request when the cached image is re-used. This is
almost certainly never desirable because we probably only want viewports
to scroll visible regions into view the first time they are drawn. This
change makes that so, since the Result returned by 'cached' contains the
visibility requests but its cached representation has them cleared.
2022-01-21 10:19:35 -08:00
Jonathan Daugherty
a5cda3edb8 reportExtent: actually check requested visibility and update visibility requests accordingly
This fix just completes the work that I intended to do in the previous
commit.

API change note: some functions got an additional Ord constraint on the
resource name type, but that shouldn't present any issues for
applications since Ord was already required on that type for some of the
fundamental parts of the API.
2022-01-18 14:25:20 -08:00
Jonathan Daugherty
55857c76c1 Add support for requesting visible regions from EventM
This change adds a function, Brick.Main.makeVisible, which can be used
from EventM to request that a region (specified by its resource name) be
scrolled into view on the next rendering. This requires the region to be
named in the drawing using either reportExtent or clickable (which just
calls reportExtent). If the specified region is in a viewport, this will
result in the same behavior as if 'visible' was used to wrap the
specified region.
2022-01-18 12:51:54 -08:00
Jonathan Daugherty
e41ad936eb viewport: fix non-scroll direction width/height in the presence of scroll bars
Prior to this change, the size of a viewport's contents would be off by
one row or column if a scroll bar was enabled because we weren't
accounting for the extra row or column taken up by the bar. This change
makes it so that viewports that scroll only in one direction apply a
width or height constraint to their contents to account for the reduced
rendering area when a scroll bar is enabled.
2022-01-18 10:32:56 -08:00
Jonathan Daugherty
839ff8bb0d viewport: remove redundant call to cropToContext due to presence of h/vLimit 2022-01-18 10:28:52 -08:00
Jonathan Daugherty
f141562756 Brick: improve docs (w.r.t. #349) 2021-11-20 15:45:33 -08:00
Jonathan Daugherty
026d6bc0ce viewport: mention Brick.Main API (w.r.t. #349) 2021-11-20 15:38:41 -08:00
Jonathan Daugherty
da8e859156 lookupViewport: more updates (w.r.t. #349) 2021-11-20 15:07:58 -08:00
Jonathan Daugherty
d2471911bb lookupViewport: add extra notes about behavior (relevant to #349) 2021-11-20 15:04:44 -08:00
Jonathan Daugherty
539823ee78 Add mouse click reporting of scroll bar elements 2021-11-19 20:32:47 -08:00
Jonathan Daugherty
663b014110 Add withH/VScrollBarHandles, scrollbarHandleAttr, and renderer fields 2021-11-19 20:00:04 -08:00
Jonathan Daugherty
db382fc1d1 Export ScrollbarRenderer type from Brick.Widgets.Core 2021-11-19 19:21:14 -08:00
Jonathan Daugherty
60b21486e7 docstring updates 2021-11-19 19:12:52 -08:00
Jonathan Daugherty
0ba1fc5584 Whitespace 2021-11-15 21:36:10 -08:00
Jonathan Daugherty
d473298e03 Core: reorder viewport documentation entries 2021-11-12 16:47:31 -08:00
Jonathan Daugherty
e29ad5523d Core: scroll bar renderer documentation updates 2021-11-12 16:45:12 -08:00
Jonathan Daugherty
d58dea85bc Core: export horizontal scroll bar renderer 2021-11-12 16:45:04 -08:00
Jonathan Daugherty
4dd85869eb Make scroll bar functions explicitly handle zero-height/width content cases 2021-11-12 16:41:13 -08:00
Jonathan Daugherty
9ca9a39b89 Add support for vertical and horizontal scroll bars on viewports 2021-11-12 16:31:48 -08:00
Jonathan Daugherty
3cf9bd702a renderDynBorder: style cleanup 2021-11-08 08:10:12 -08:00
Jonathan Daugherty
443b314f0a Clean up a few warnings 2021-11-08 08:09:59 -08:00
Jonathan Daugherty
76b148fee4 Remove questionable comment 2021-11-08 08:06:30 -08:00
Simon Jakobi
5fbf3bc965 Remove some compat code for base < 4.8 / GHC < 7.10 2021-10-25 22:25:15 +02:00
Jonathan Daugherty
31cc25801b Themes: fix saving of background color in saveTheme (fixes #338) 2021-10-22 08:20:09 -07:00
Jonathan Daugherty
f94441abb6 Un-label some APIs as experimental 2021-09-16 15:46:08 -07:00
Jonathan Daugherty
f0ceb81ed4 listMoveToEnd: use correct destination index (fixes #337) 2021-09-16 12:54:08 -07:00
Jonathan Daugherty
e7bf49c61a Brick.Main.runWithVty (internal): fix bug where rendering state was reset by mistake
This change fixes a bug where clickable regions in the UI could be
forgotten by the rendering loop if the application called
"continueWithoutRedraw." This was because although the rendering loop
correctly skipped the redraw, it would reset the rendering state's
clickable regions. That meant that if a mouse click event came in
immediately after a call to "continueWithoutRedraw", the mouse click
would not match any extents because the resource name associated with
the click was not considered clickable. This change fixes runWithVty so
that the rendering state's clickable name list is NOT reset in the
specific case where we're going to skip a screen redraw due to a call to
continueWithoutRedraw.
2021-09-16 10:57:23 -07:00
Jan Hrcek
5f4e13b6f0 Small haddock/user guide corrections 2021-08-17 13:49:05 +02:00
Jan Hrcek
bf2710effb Various typo fixes 2021-08-17 13:46:15 +02:00
Jonathan Daugherty
beecf2ac14 Add continueWithoutRedraw 2021-08-11 18:25:31 -07:00
Mario Lang
3ba1001950 Fix typo (s/wiget/widget/) 2021-07-29 18:42:27 +02:00
Mario Lang
bd1419662e Edit: Bind more Emacs-compatible keys
M-b and M-f to navigate by word
C-b and C-f for consistency
M-d to delete word under cursor
C-t to transpose previous char with current char

This replaces the Monoid constraint on handleEditorEvent with GenericTextZipper
2021-07-20 19:20:46 +02:00
Mario Lang
fd0bc95667 Edit: Update keybinding docs 2021-07-20 01:40:43 +02:00
Mario Lang
e634306c21 Edit: Bind M-< and M-> to gotoBOF and gotoEOF 2021-07-20 01:11:43 +02:00
Jonathan Daugherty
b4423d2a5a
Merge pull request #329 from mlang/typo
Fix a weird typo cluster
2021-07-19 14:58:17 -07:00
Mario Lang
61b106db85 Fix a weird typo cluster 2021-07-19 23:56:36 +02:00
Jonathan Daugherty
bed6304cdd Core: use infix fmap 2021-06-29 08:14:58 -07:00
Jonathan Daugherty
7d0a87f102 Whitespace 2021-06-29 08:14:50 -07:00
Mario Lang
d1f2b955b4 Simplify
foo <- bar; return $ f foo = fmap f bar
(& foo) = foo
2021-06-29 11:46:08 +02:00
Jonathan Daugherty
8ca73ffa1c Fix spelling 2021-06-24 17:44:47 -07:00
Mario Lang
919d44f942 Use putCursor in renderCheckbox and renderRadio 2021-06-25 02:40:53 +02:00
Mario Lang
ca8b1bae67 Implement support for the new PositionOnly constructor
The API putCursor will request positioning but keep cursor invisible.
2021-06-25 02:22:52 +02:00
Jonathan Daugherty
b3b5c3a227 Merge branch 'master' of github.com:jtdaugherty/brick 2021-06-13 08:31:04 -07:00
Jonathan Daugherty
4a0cedfb22 Viewport: add _vpContentSize field, vpContentSize lens
This change adds a new field to the Viewport type to track the size of
the viewport content. Previously, the size of the content was not
tracked anywhere, which made it possible to compute how much of the
content was visible in relation to the total content available.
2021-06-13 08:29:29 -07:00
Jonathan Daugherty
0af90c9453 Core: add crop{Left,Right,Bottom,Top}To functions 2021-04-29 12:11:21 -07:00
Jonathan Daugherty
a1405874f4 Forms: rewrite editShowableField in terms of editShowableFieldWithValidate 2021-04-08 17:59:34 -07:00
Jonathan Daugherty
34373d4000 Forms: resolve warnings 2021-04-08 17:59:25 -07:00
Jonathan Daugherty
d4d83ea4da Forms: another haddock clarification 2021-04-08 17:52:29 -07:00
Jonathan Daugherty
2a36fce1d3 Forms: clarify need to store Form value in User Guide and haddock 2021-04-08 17:51:06 -07:00
Jonathan Daugherty
a7ad04039f Brick.Forms: documentation typo 2021-04-08 17:47:49 -07:00
Jonathan Daugherty
c2aa3e77d9 editShowableFieldWithValidate: make validate function return Bool 2021-04-08 17:33:56 -07:00
Ben Selfridge
f40edb025a Adds editShowableFieldWithValidate
This function for Brick.Forms allows the user to specify an additional function
to validate input in addition to `readMaybe`, as a slightly more flexible
version of `editShowableField`.
2021-04-07 22:06:18 -07:00
Willem Van Onsem
369d5975f1
use fmap for BorderMap 2021-03-15 21:17:11 +01:00
Hari Menon
1212b58857 Add a code comment about the updates to the rendering cache 2021-02-05 22:43:53 -05:00
Hari Menon
92c69b6776 Include clickable elements in the rendering cache.
Mouse events for `Widget`s were being received inconsistently if/when
they are cached. This appears to be because `Widget`s when rendered
update the list of clickable elements that `brick` should track for
mouse activity. However, when a `Widget` is cached, this information is
lost.

This commit updates the rendering cache to also include the clickable
elements exposed by a `Widget` and update `brick`'s tracking list
appropriately when utilizing the cache.
2021-02-05 18:18:07 -05:00
Jonathan Daugherty
e020951bc7 cached: improve documentation 2021-02-04 14:44:03 -08:00
Jonathan Daugherty
934321fa7a Table: fix length check bug that disallowed empty tables 2021-02-03 10:53:31 -08:00
Jonathan Daugherty
7171b4e7bc Table: haddock nit 2021-01-31 21:26:28 -08:00
Jonathan Daugherty
e6ffcd74ee Table: export TableException 2021-01-31 21:14:22 -08:00
Jonathan Daugherty
89da6273b2 Table: raise custom TableException type rather than calling "error" 2021-01-31 21:13:42 -08:00
Jonathan Daugherty
ec643e889a table: raise exception if rows are not of equal length 2021-01-31 21:08:25 -08:00
Jonathan Daugherty
f569773cf8 Table: generalize API for default row and column alignment 2021-01-31 21:03:07 -08:00
Jonathan Daugherty
6df3642cb5 Table: haddock fixes 2021-01-31 20:59:26 -08:00
Jonathan Daugherty
e84f140a82 Table: naming improvement 2021-01-31 20:56:35 -08:00
Jonathan Daugherty
f91c56976d Table: another slight map lookup optimization 2021-01-31 20:56:06 -08:00
Jonathan Daugherty
1c35929c43 Table: slight map lookup optimization 2021-01-31 20:54:51 -08:00
Jonathan Daugherty
dc2b18f90b Table: add support for per-row alignment 2021-01-31 20:52:59 -08:00
Jonathan Daugherty
b6ed76fde2 Table: haddock improvements 2021-01-31 20:25:05 -08:00
Jonathan Daugherty
691e430ecd Table: export setAlignment 2021-01-31 20:24:06 -08:00
Jonathan Daugherty
3203bab991 Table: internal API nit 2021-01-31 20:23:11 -08:00
Jonathan Daugherty
cd8399435e Table: add alignLeft for completeness 2021-01-31 20:22:29 -08:00
Jonathan Daugherty
f64a833a14 Table: add haddock 2021-01-31 20:18:21 -08:00
Jonathan Daugherty
089451b5b0 Merge branch 'master' into experimental/table-support 2021-01-31 19:46:07 -08:00
Jonathan Daugherty
1ccb1cbb2b table: improve policy check implementation 2021-01-31 19:40:39 -08:00
Jonathan Daugherty
2182c80ab3 table: raise exception if any contents use Greedy policy 2021-01-31 19:39:22 -08:00
Jonathan Daugherty
1607de7ef8 Table: improve border configuration API 2021-01-31 19:29:48 -08:00
Jonathan Daugherty
20ec0b6bbf Table: add API to disable column borders 2021-01-31 19:26:21 -08:00
Jonathan Daugherty
3fb27849a3 Table: add API to disable row borders 2021-01-31 19:23:14 -08:00
Jonathan Daugherty
f15ea8202c Table: add API to disable outer border 2021-01-31 19:21:18 -08:00
Jonathan Daugherty
c6a112e1a0 Table: improve API 2021-01-31 19:19:16 -08:00
Jonathan Daugherty
0d9085706c Table: add column alignment support 2021-01-31 19:04:56 -08:00
Jonathan Daugherty
477fe4d716 Add basic support for tables with fixed-size cell contents 2021-01-31 18:56:26 -08:00
Jonathan Daugherty
d032cbbe81 Merge branch 'master' of github.com:jtdaugherty/brick 2021-01-21 14:30:21 -08:00
Jonathan Daugherty
baa4a58921 List: add listMoveTo{Beginning,End} 2021-01-21 14:30:15 -08:00
Daniel Wagner
5909eec231 be careful about rewriting empty images 2021-01-07 00:28:08 -05:00
Jonathan Daugherty
249781a57b Extent: remove unused extentOffset field
This change removes the unused extentOffset field of Extent, which was
being used in some calculations but was never changing from its
initialized value of zero (and thus had no meaningful impact on any of
its uses). I'm not sure what I intended with this field when it was
originally added, but clearly this is dead code.
2021-01-03 10:27:35 -08:00