Commit Graph

1324 Commits

Author SHA1 Message Date
Ruslan Gadeev
67f747a61f
Remove redundant imports and fix typos (#275)
* remove redundant imports

* fix dodgy imports and exports

* fix LANGUAGE

* import combinator instances to SizeReq

* fix typos

* fix resizeFactor typos

* fix converter typos

* fix typos in handleSystemEvents and defaultWindowSize descriptions

* fix typo in SetOverlay description
2023-05-17 02:32:22 +02:00
Francisco Vallarino
ed81c987de
Do not generate extra click events (#267) 2023-05-15 06:10:16 +02:00
Francisco Vallarino
a36492cb73
Use parent model for Alert and Confirm modals (#268) 2023-05-09 02:37:43 +02:00
Ruslan Gadeev
fb675f9128
Fix typo in widgetDataSet description (#273) 2023-05-06 17:55:46 +02:00
Ruslan Gadeev
6cd466ea91
Draggable widget: allow to hide the original widget when dragging. (#271)
* add hide origin configuration for draggable widget

* overwrite widgetRender instead of containerRender

* replace draggableHideOrigin with draggableRenderSource
2023-05-06 17:28:47 +02:00
Ruslan Gadeev
f6960cc476
fix Semigroup instance for BoxShadowCfg (#272) 2023-05-03 15:07:29 +02:00
Ruben Astudillo
41830e909b
Better explain how the nodeKey function is related to WidgetKey (#270) 2023-05-03 14:44:59 +02:00
Ruben Astudillo
7036f7aac8
Fix flake.nix definition to work with more recent nixpkgs snapshots (#266)
* Rework flake.nix

* Add devShell environment on flake.nix

* Update flake.lock
2023-05-01 17:21:59 +02:00
Francisco Vallarino
ff2ea3b414
Fix type error in examples (#263)
* Fix type error in examples

* Attempt to run build including examples

* Force build failure

* Revert "Force build failure"

This reverts commit 9728f0b0ac.
2023-02-26 23:18:45 +01: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
e88d5d916e
Avoid weird macOS 'command encoder is already encoding to this command buffer' error when resizing window (#234)
* Avoid weird macOS 'command encoder is already encoding to this command buffer' error when resizing window

* Render resized window unconditionally when running on Linux
2023-02-24 17:53:35 +01:00
Darin Minamoto
cb7bb0ad4e
Add renderBezierTo to Renderer for rendering cubic bezier curves (#259) 2023-02-18 21:09:40 +01:00
Francisco Vallarino
ef4f10a07e
Prepare release 1.5.1.0 (#256)
* Bump version

* Update Changelog
2023-02-05 00:30:57 +01:00
Francisco Vallarino
df434983de
Minor clarification in WidgetEnv's widgetKeyMap (#255) 2023-02-04 23:28:51 +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
Ruslan Gadeev
b8d3b82b50
Fix animation widget raising onFinished event when it is no longer relevant (#252)
* fix animation bug

* update animation tests
2023-02-01 03:00:53 +01:00
Ruslan Gadeev
a9ee596be3
Improve documentation for configuration options of some widgets (#253)
* docs: fix alignMiddle description in configuration options for box

* docs: fix documentation for the confirm dialog

* docs: add description for fitEither in configuration options for image

* docs: improve documentation for combinators

* docs: improve documentation for align configuration options

* docs: complete configuration options for box

* docs: fix description for thumbVisible combinator

* docs: add caretWidth and caretMs descriptions in configuration options
2023-02-01 02:03:46 +01:00
Francisco Vallarino
06388003ac
Update build badge url (#251) 2023-01-30 03:42:40 +01:00
Ruslan Gadeev
9f8ff38a32
Improve documentation (#249)
* docs: add documentation for arguments of widget constructors

* docs: align comments

* docs: fix Haddock

* docs: move some exported functions from Constructors to Configuration section

* docs: fix documentation
2023-01-30 00:41:08 +01:00
Francisco Vallarino
6327dbbf83
Drop shadow in colorPopup by using boxShadow widget (#248)
* Add/export utility functions

* Use correct values for CCW/Solid and CW/Hole in NanoVGRenderer

* Render shadow in popup component (test commit)

* Revert "Render shadow in popup component (test commit)"

This reverts commit 3b8075bf20.

* Re-export boxShadow widget from Widgets module

* Use boxShadow widget in colorPopup
2023-01-29 20:30:32 +01:00
Ruslan Gadeev
674945cb56
export dialD_ (#246) 2023-01-29 01:53:03 +01:00
Francisco Vallarino
0364e86b06
Add color popup widget (#247)
* Add initial version of ColorPopup

* Add theme entry for colorPopup container

* Add minimal Haddock to new widget
2023-01-29 01:34:26 +01:00
Ruslan Gadeev
2c52bc891a
Modify tests for selectList and dropdown (#245) 2023-01-25 14:19:00 +01:00
Ruslan Gadeev
915b68cf6c
fix selectList documentation (#244) 2023-01-13 00:04:45 +01:00
Francisco Vallarino
f9e7679d1a
Fix 'Running the examples' section in Setup docs (#243) 2023-01-12 23:54:27 +01:00
Francisco Vallarino
c233abaf95
Fix build issues (#240)
* Do not commit .dylib files

* Use ubuntu-20.04 container version
2022-12-06 03:18:06 +01:00
Francisco Vallarino
344edc64ed
Avoid infinite resize loop in multiline label (#233)
* Avoid infinite resize loop in multiline label

* Avoid weird macOS 'command encoder is already encoding to this command buffer' error when resizing window

* Render resized window unconditionally when running on Linux
2022-12-06 02:54:27 +01:00
Francisco Vallarino
df6ae02edc
Do not pass events to selectList children when they are not visible (#230) 2022-11-21 13:53:14 +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
908de6f48e
Trigger ResizeWidgets when user defined size requests change (#229) 2022-11-17 01:27:24 +01:00
Francisco Vallarino
9a7fcdf186
Upgrade GitHub Actions commands' versions (#235) 2022-11-14 03:39:13 +01:00
Francisco Vallarino
8695391657
Add not for possible Fedora build issue (#231) 2022-11-12 12:31:31 +01:00
Ruslan Gadeev
d4270caafe
Documentation improvements (#222)
* fix typos

* fix haddock link

* fix example link

* fix typos

* fix spelling

* fix typos in tests
2022-11-08 13:24:51 +01:00
Francisco Vallarino
d1ddcc2d40
Fix rendering artifacts (#215)
* 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

* Update Changelog
2022-10-31 11:57:39 +01:00
Francisco Vallarino
ba4da4b76b
Add Useful Extensions section to README.md (#221)
* Use complete url for logo to avoid visibility issues on Hackage

* Add Useful Extensions section
2022-10-28 13:26:41 +02: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
14c87ef176
Use pkg-config for glew linking (#219)
* Use monomer.cabal with correct bounds for text-show

* Use pkg-config for glew linking

* Use correct pkg-config-dependencies field (as defined in hpack)
2022-10-27 20:08:55 +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
5b16417591
Bump text-show version to build on Stackage nightly (#217) 2022-10-22 13:16:51 +02:00
Francisco Vallarino
484fff1043
Release 1.5.0.0 version (#209)
* Update Changelog

* Bump version
2022-10-09 18:22:01 -03: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
9856bd66fe
Fix copyright in new modules (#208) 2022-10-09 22:17:56 +02:00
Gareth Smith
38391f7bfc
Add a BoxShadow component (#205)
* Add a BoxShadow component.

* Use the correct type for boxShadow config

* Allow configuring shadow direction.
2022-10-02 17:42:34 +02:00
klausweiss
619ac2d567
Loading fonts from memory (#199)
* Compiles, doesn't work

* s/FontDefPath/FontDefFile/g

* Some ffi changes

* Rename toUString

* Demo in the todo app. TO BE REVERTED

* Alloc an unsigned char* array for font

* Remove unused language extensions

* Remove unused and sort imports

* Use useAsCStringLen and malloc manually

* Use nanovg from klausweiss/nanovg-hs (TO BE REVERTED)

* Use newer klausweiss/nanovg-hs (TO BE REVERTED)

* Use nanovg 0.8.1 from hackage

* Revert "Demo in the todo app. TO BE REVERTED"

This reverts commit 06d061ae76.

* Add documentation to some functions in FFI.hs

* Unused import

* Improve appFontDef docs

* s/appFontDefMem/appFontDefMemory

* Bump nanovg-hs to 0.8.1 in monomer.nix

* Revert "s/appFontDefMem/appFontDefMemory"

This reverts commit 5403752dbc.

* Reference file-embed in appFontDefMem docs

* s/appFontDefFile/appFontDef

* Stop using record syntax for FontDef

* Revert "Stop using record syntax for FontDef"

This reverts commit 03d16ce9f7.
2022-09-11 07:28:02 -03:00
Francisco Vallarino
7b1d59d754
Add popup widget (#191)
* Import popup widget

* Add popupOffset configuration option

* Add popupDisableClose config option

* Add alignment options to popup widget

* Improve Haddocks

* Add window compensation offset directly to node; remove related code, simplify

* Improve Haddocks

* Add popup unit tests

* Generate onChange events when opened/closed status changes

* Replace fdescribe with describe

* Update Changelog

* Delegate visibility check to each widget

* Consider scroll offset when aligning to widget

* Request a non zero size to avoid having an invisible node

* Add note to Container's init and merge documentation

* Add support for an anchor widget

* Do not apply active style if widget is not in the active overlay

* Add popupAlignToOuter option

* Add separate horizontal/vertical alignToOuter options

* Make sure BtnReleased is sent to overlay in case findWidgetByPoint returns Nothing

* Block events happening at the same instant the popup is closed, to avoid widgets below it being activated accidentally

* Use cursor location when validating if popup should be closed

* Increase timestamp on each group of events for nodeHandleEvents_. Add helper

* Fix unit tests

* Add anchor alignment options

* Attempt to position popup in the opposite border when using outer, if it does not fit in the main border

* Always Attempt to position popup in the opposite border, both for inner and outer border alignment

* Compensate offset when calculating border alignment

* Fix regression in window alignment. Haddock fixes
2022-08-09 23:27:43 -03:00
Francisco Vallarino
5852155b72
Add note about pkg-config in macOS setup (#198) 2022-08-03 21:16:41 -03:00
Francisco Vallarino
d080022da5
Do not start event watcher if host OS is Linux (#194) 2022-07-20 09:48:48 -03:00
Francisco Vallarino
cb17cb553c
Catch exception when trying to write to stderr and try stdout instead (#190)
* Catch exception when trying to write to stderr and try stdout instead

* Update Changelog
2022-06-28 20:49:13 -03:00
Francisco Vallarino
f460068b4a
Do not disable screensaver unless explicitly requested; add configuration flag (#189)
* Do not disable screensaver unless explicitly requested; add configuration flag

* Update Changelog
2022-06-28 19:37:44 -03:00