Open end-4 opened 3 months ago
I am kind of hesitant to add this, this makes sense based on the pattern I followed, but maybe we should make on_clicked
the only property and make it more generic?
I guess. Someone in discord told me about mice with 12 side buttons lol Though no one likes breaking changes...
What imo would make sense is adding a on-middle-click
and on-middle-click-release
What imo would make sense is adding a
on-middle-click
andon-middle-click-release
what https://aylur.github.io/ags-docs/config/widgets/#button
What imo would make sense is adding a
on-middle-click
andon-middle-click-release
what https://aylur.github.io/ags-docs/config/widgets/#button
ok nevermind looked over it
maybe we should make on_clicked the only property and make it more generic?
on_clicked
is already a thing currently, so I suggest the name on_mouse_button
the most convenient is probably adding this as it is I'm thinking about something like
type State = "clicked" | "released"
type Button = "primary" | "secondary" | "middle" | "back" | "forward"
Button({
onMouseButton(self, opts: { event: Gdk.Event, state: State, button: Button }) {
if (state === "clicked" && button === "primary") {
// onPrimaryClickRelease
}
}
})
but the issue with this is that it would require bloat to check for the clicked state, when usually only the clicked state is desired
so maybe on-mouse-button
and on-mouse-button-released
?
For mice with side buttons
Adds the following props to
Widget.Button
andWidget.EventBox
on-back-click
on-forward-click
on-back-click-release
on-forward-click-release
Note: There doesn't seem to be Gdk consts for values 8 and 9 so I declared consts for them. Hopefully that's alright