Commit Graph

94 Commits

Author SHA1 Message Date
Ruben Astudillo
41830e909b
Better explain how the nodeKey function is related to WidgetKey (#270) 2023-05-03 14:44:59 +02:00
Francisco Vallarino
5b90aebae9
Improve development time application reload (#239)
* Consider SDL.TextEditingEvent as an action event

* When a frame requires rendering, make sure the next one is also rendered to avoid artifacts. It still does not render every frame

* Fix lint

* Fix typo

* Add foreign-store dependency

* Reuse window and avoid reinitializing SDL when running on ghci and code is reloaded

* Restore previous model and widget root on code changes

* Attempt to check if model's type changed (failed, since fingerprinting is not reliable)

* Add Show instances to various widgets

* Add configuration for fingerprint functions

* Merge new root with stored root, to account for code changes in new root and data in old

* Store the complete MonomerCtx type for app reload

* Use recover-rtti for model change detection

* Process WidgetResult when merging reloaded widget root

* Validate model changes in Composite

* Fix lint

* Fix unit tests

* Force hpack version in monomer.cabal

* Add appDisableModelReuse configuration option to always ignore previous model version

* Minor setup docs update

* Revert to AppConfig only being parameterized by e

* Restore recover-rtti dependency

* Revert "Revert to AppConfig only being parameterized by e"

This reverts commit 0a66513807.

* Revert to previous version without restore-rtti dependency

* Try to overcome build issue by enforcing ubuntu-20.04

* Do not commit .dylib files

* For hpack version

* Fix docs

* Fix missing imports

* Fix typo
2023-02-24 18:14:08 +01:00
Francisco Vallarino
63189b73be
Add responseIf and responseMaybe helpers (#250)
* Add responseIf and responseMaybe helpers

* Move helper functions into UserUtil, where other similar functions reside
2023-02-04 04:40:25 +01:00
Ruslan Gadeev
0bdd378063
replace antipattern article link with archived version (#254) 2023-02-04 04:19:31 +01:00
Francisco Vallarino
f9e7679d1a
Fix 'Running the examples' section in Setup docs (#243) 2023-01-12 23:54:27 +01:00
Francisco Vallarino
ff4ad25928
Upgrade stack.yaml to LTS 20 (GHC 9.2) (#236)
* Use Stackage LTS 20

* Keep copy of stack.yaml for GHC 8.10.7 version

* Update setup docs to include GHCup

* Fix case

* Remove old note about M1 incompatibility

* Use Stackage LTS 20.1
2022-11-21 01:17:30 +01:00
Francisco Vallarino
8695391657
Add not for possible Fedora build issue (#231) 2022-11-12 12:31:31 +01:00
Francisco Vallarino
c9343173c7
Update Windows installation docs to reflect comments in https://github.com/fjvallarino/monomer/issues/201 (#220) 2022-10-27 20:47:26 +02:00
Francisco Vallarino
51c87b6f6e
Add "examples" flag to optionally build examples and tutorials (#218)
* Add ignore-examples flag to avoid building examples unless required. Add a small dev-test-app executable to help testing of the library

* Rename ignore-examples to examples, make build logic clearer

* Update monomer.cabal

* Update docs
2022-10-27 18:42:44 +02:00
Francisco Vallarino
22cf451853
Add conditional helpers for lists of widgets, styles and configuration options (#185)
* Add widgetIf, widgetMaybe, and related style/config helper functions

* Update examples and tutorial

* Fix Haddocks

* Update Changelog
2022-10-09 22:38:07 +02:00
Francisco Vallarino
5852155b72
Add note about pkg-config in macOS setup (#198) 2022-08-03 21:16:41 -03:00
Francisco Vallarino
dbb603a4a7
Fall back to main thread rendering when secondary setup fails (#131)
* Attempt to recover from SDL_GL_MakeCurrent error, and fallback to rendering on the main thread

* Check if -threaded flag was used before setting up rendering thread. Add notes to appRenderingOnMainThread

* Remove reference to the error from Setup page

* Update Changelog

* Fix typo

* Fix issues with RunInRenderThread when running on single threaded mode. Improve handling of initialization, simplify Core's state variables

* Update Changelog

* Add note about threaded rendering in 'Running the examples' section. Fix typo.
2022-04-30 11:00:17 -03:00
Francisco Vallarino
d4445105c4
Button widget improvements (#123)
* Add D_ option to button without the requirement of an explicit event

* Add ignoreParentEvts to button widget

* Add new note to keystroke widget

* Add unit tests for keystroke's/button's options for ignoring child/parent events respectively

* Update Changelog
2022-04-17 16:03:51 -03:00
Francisco Vallarino
af0456ccf1
Add extra argument to mergeRequired; in most cases, it will be WidgetEnv (#122)
* Add extra argument to mergeRequired; in most cases, it will be WidgetEnv

* Update Changelog
2022-04-17 15:06:55 -03:00
Francisco Vallarino
f98c3e3900
Improve Grid and Stack docs. Link to widget's Haddocks from Tutorials (#119)
* Improve Haddocks for Grid and Stack

* Link to widget's Haddocks from tutorials

* Fix typo
2022-04-14 13:40:14 -03:00
Francisco Vallarino
0e464c5bb6
Add clarification notes about layouts and styling to tutorials (#118)
* Add improved note regarding secondary axis for hstack/vstack. Mention hgrid/vgrid

* Remark that styles belong to individual widgets and are not cascade down to its children

* Fix typo
2022-04-13 10:28:45 -03:00
Francisco Vallarino
2d47c0aa3d
Add documentation notes related to recent issues/questions (#113)
* Add section in tutorials about 'No instance for (Typeable s)' compilation error

* Add note about WidgetEnv's widgetKeyMap usage

* Update Changelog
2022-04-06 11:56:14 -03:00
Francisco Vallarino
4b32da8dff
Rename Timestamp type to Millisecond (#107)
* Rename Timestamp type to Millisecond

* Update Changelog
2022-04-02 00:19:58 -03:00
Francisco Vallarino
c1a15f6959
Make style... family of functions combine styles instead of replacing them. Add style...Set family of functions. (#104)
* Adds style...Set family of functions for replacing a Style/WidgetNode StyleState. The existing style... family of functions now merge with the previous StyleState

* Add style...Set to tutorials and improve styling section. Make several small improvements

* Improve StyleState documentation

* Improve naming of Core's utility function

* Update Changelog
2022-03-26 18:13:57 -03:00
Clindbergh
17bd6bcb11
Fix optics tutorial sample code (2) (#98)
Rename `_address` to `_workAddress` so the Prism sample code works.
2022-03-13 14:21:50 -03:00
Clindbergh
34fa63792d
Fix optics tutorial sample code (#95) 2022-03-11 14:43:34 -03:00
Francisco Vallarino
5f0bed361f
Update documentation and Changelog (#89)
* Update Changelog

* Use clearer names in Container's merge

* Add an extra note for Windows builds

* Use latest GHC 8.10.7 Stack LTS
2022-03-04 15:09:21 -03:00
Francisco Vallarino
5f551d6213
Rename utility functions for retrieving WidgetNode information (#75)
* Improve naming of utility functions that retrieve WidgetNode information

* Update Changelog

* Add deprecation notice on renamed functions
2022-02-04 11:23:58 -03:00
Gareth Smith
85e70cea17
Add a CmbChildSpacing combinator and implement it for Grid, Stack and LabeledCheckbox/LabeledRadio (#67)
* Add a CmbChildSpacing combinator and implement it for Grid, Stack and LabeledCheckbox/LabeledRadio

* Fix a bug where childSpacing was applied to both dimensions in a grid, rather than just the primary dimension.

* Document the childSpacing combinators.

* Remove redundant divs (rows/cols always equals 1)
2022-01-23 10:39:44 -03:00
Francisco Vallarino
fdfcbbdc9f
Add design decision related to choosing Lens instead of Optics (#60) 2022-01-10 20:21:29 -03:00
Francisco Vallarino
c9e81410c7
Use Stackage 18.9. Minor documentation updates. (#47)
* Update docs

* Use Stack LTS 18.19
2021-12-21 13:34:07 -03:00
Francisco Vallarino
afadfbb60a
Add SetFocusOnKey/MoveFocusFromKey to Composite (#37)
* Add SetFocusOnKey/MoveFocusFromKey to Composite. This makes setting focus from user event handlers more predictable

* Bump version. Update Changelog
2021-10-28 16:33:39 -03:00
Francisco Vallarino
6d486d056a Add note in Windows setup section regarding MinGW certificates issue 2021-10-06 20:13:22 -03:00
Francisco Vallarino
3809c6b225 Link to rendering passes section from custom widget tutorial 2021-09-24 15:29:44 -03:00
Francisco Vallarino
afc6a56ae7 Request RenderOnce in OpenGLWidget example 2021-09-24 13:53:41 -03:00
Francisco Vallarino
3f7acc98ed Improve wording on OpenGL example docs 2021-09-24 01:17:05 -03:00
Francisco Vallarino
4428b126df Add OpenGL example 2021-09-22 18:27:53 -03:00
Francisco Vallarino
3d1c9445ab Add note for M1/Rosetta build procedure (link to issue) 2021-09-13 13:13:32 -03:00
Francisco Vallarino
bb312efacb
Remove old paragraph from Ticker's readme (#23) 2021-09-02 23:48:44 -03:00
Francisco Vallarino
88e12a8d9b
Reduce memory usage by sharing wreq session among image widget instances (#22)
* Reduce memory usage by sharing wreq session among image widget instances

* Update Books example to use Session instance

* Update Changelog
2021-08-31 18:47:45 -03:00
Francisco Vallarino
ac78f73957
Improve Windows build/setup (#21)
* Remove no longer needed extra-deps entry

* Add header in fontmanager.c to avoid warning on Windows build

* Update docs to simplify Windows build instructions

* Remove unneeded imports
2021-08-30 23:49:48 -03:00
Francisco Vallarino
9b6d6a5082 Improve ticker example by grouping messages before feeding them back into the UI 2021-08-21 10:02:39 -03:00
Francisco Vallarino
3993c1ca41 Rename appDisableContinuousResize to appRenderOnMainThread 2021-08-15 22:59:35 -03:00
Francisco Vallarino
f3c5570d27 Add appDisableContinuousResize option 2021-08-15 22:12:49 -03:00
Francisco Vallarino
a4b3a3b2c7 Minor change to setup doc 2021-08-15 19:13:10 -03:00
Francisco Vallarino
523355c389 Improve design decisions document 2021-08-13 19:59:59 -03:00
Jan Hrcek
66e9a70479
Add setup instructions for Fedora (#3) 2021-08-11 11:01:18 -03:00
Francisco Vallarino
a57075dcbe Explain how to build and run examples 2021-08-10 00:53:49 -03:00
Francisco Vallarino
1eea1fdd17 Minor documentation fixes 2021-08-09 18:57:41 -03:00
Francisco Vallarino
561a0bd1b0 Improve tutorials 2021-08-09 00:26:35 -03:00
Francisco Vallarino
ae57f0aaf5 Remove Previous link in tutorials (looks confusing on GitHub) 2021-08-08 22:19:49 -03:00
Francisco Vallarino
a2a2d39bc9 Add image to README, navigation links in tutorial. Clarify docs 2021-08-08 19:12:03 -03:00
Francisco Vallarino
027012ea0a Rephrase some sections in docs 2021-08-08 11:51:30 -03:00
Francisco Vallarino
2b06503863 Improve examples README 2021-08-07 00:55:12 -03:00
Francisco Vallarino
23f0818fff More improvements to documentation 2021-08-05 01:48:59 -03:00