about summary refs log tree commit diff stats
path: root/button.lua
Commit message (Collapse)AuthorAgeFilesLines
* bugfix :(Kartik K. Agaram2023-12-181-1/+1
|
* make button backgrounds optionalKartik K. Agaram2023-12-181-1/+3
|
* streamline button.luaKartik K. Agaram2023-12-161-7/+1
|
* use color alpha in button backgroundsKartik K. Agaram2023-10-161-1/+1
|
* clearer API for drawing a buttonKartik K. Agaram2023-10-161-1/+1
| | | | | | Make it more obvious that the color passed in is just for the background. The icon will do the rest. r/g/b keys are more consistent with App.color().
* bugfix: propagate mouse press if any button wouldKartik K. Agaram2022-08-241-4/+6
| | | | | Before this commit I was propagating press events only if _all_ buttons would.
* pass all button params to the iconKartik K. Agaram2022-08-231-1/+1
|
* allow buttons to nest as wellKartik K. Agaram2022-08-231-2/+11
|
* flip return value of button handlersKartik K. Agaram2022-08-231-4/+3
| | | | | | This is compatible with Javascript, and it also seems like a better default; when people forget to think about return values in click handlers, they should be consumed.
* stop putting button state in a globalKartik K. Agaram2022-08-231-6/+10
| | | | | | | | | | | | | | | | Symptom: a test (test_click_to_create_drawing) started randomly failing after I inserted a `return` 2 commits ago. Cause: my tests call edit.draw, but button handlers only get cleared in app.draw. So my tests weren't clearing button handlers, and every call to edit.draw was accumulating states. Still unclear why those were going to different state objects after the `return`, but anyway. I'm not going to understand every last thing that happens when things go wrong, just guarantee they can't go wrong. And the way to do that is to decentralize button handlers to each state that receives them. The State object in buttons.lua doesn't have to be Editor_state. It just has to be some table that provides a Schelling Point for shared state.
* improve explanation for buttonsKartik K. Agaram2022-08-231-1/+4
|
* allow buttons to interrupt eventsKartik K. Agaram2022-08-231-1/+1
| | | | Most button onpress1 handlers will want to return true.
* indentKartik K. Agaram2022-08-231-1/+3
|
* highlight another globalKartik K. Agaram2022-05-171-3/+3
|
* .Kartik K. Agaram2022-05-171-2/+4
|
* fix a typoKartik K. Agaram2022-05-121-1/+1
|
* intermingle freehand line drawings with textKartik K. Agaram2022-05-111-0/+18