Add option to customize the flash on button mouse event #24

Closed
opened 2026-03-23 09:34:13 -07:00 by ronisbr · 2 comments
ronisbr commented 2026-03-23 09:34:13 -07:00 (Migrated from github.com)

Hi @kahliburke !

Currently, the flash decoration for the button mouse click event is fixed. My suggestion is to allow the user to easily configure it. My proposal is to add a new field that is a function with this signature:

flash_style(flash_remaining::Int)::Style

and it should provide the style for each remaining frame.

If you approve this design, I can submit the PR.

Hi @kahliburke ! Currently, the flash decoration for the button mouse click event is fixed. My suggestion is to allow the user to easily configure it. My proposal is to add a new field that is a function with this signature: ```julia flash_style(flash_remaining::Int)::Style ``` and it should provide the style for each remaining frame. If you approve this design, I can submit the PR.
kahliburke commented 2026-03-23 16:48:37 -07:00 (Migrated from github.com)

I will take a look, thank you.

I will take a look, thank you.
kahliburke commented 2026-03-23 17:36:47 -07:00 (Migrated from github.com)

@ronisbr The design looks good — flash_style(flash_remaining::Int)::Style fits naturally into the existing ButtonStyle struct. Please go ahead and submit a PR.

One small thing to consider: the flash duration is currently hardcoded to 8 frames (in handle_key! and handle_mouse!). You may want to make that configurable too (e.g. a flash_frames::Int field in ButtonStyle), since a custom style function might want a longer or shorter animation. Up to you whether to include that in the same PR or leave it for later.

This will target the upcoming 2.0 release.

@ronisbr The design looks good — `flash_style(flash_remaining::Int)::Style` fits naturally into the existing `ButtonStyle` struct. Please go ahead and submit a PR. One small thing to consider: the flash duration is currently hardcoded to 8 frames (in `handle_key!` and `handle_mouse!`). You may want to make that configurable too (e.g. a `flash_frames::Int` field in `ButtonStyle`), since a custom style function might want a longer or shorter animation. Up to you whether to include that in the same PR or leave it for later. This will target the upcoming 2.0 release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kahliburke/Tachikoma.jl#24
No description provided.