Commit graph

6 commits

Author SHA1 Message Date
Max Woolf
f7f0c9c6b0
example: Add config location hint to help new users (#771)
Some checks failed
Build / nix (push) Has been cancelled
2025-05-09 18:54:54 +02:00
Maximilian Seidler
e3bd47e177
widgets: add onclick feature (#736)
Some checks are pending
Build / nix (push) Waiting to run
* widget: add click handling and point containment methods to IWidget interface

* core: add onClick method to handle mouse click events

- renderer: move getOrCreateWidgetsFor method declaration to public section

* core: update mouse event handling to track mouse location and button clicks

* widget: add onclick command handling and point containment to CLabel

- config: add onclick special config value to label

* assets: add label configuration for keyboard layout switching

* config: add onclick configuration for label widgets

 - add CLICKABLE macro for onclick configuration
 - replace direct onclick assignment with CLICKABLE macro

* core: fix cursor shape initialization and pointer handling

 - ensure pointer is available before setting cursor shape
 - initialize cursor shape device if not already done

* core: add hover handling and cursor shape updates

 - implement onHover method to manage widget hover states
 - update cursor shape based on hover status
 - ensure all outputs are redrawn after state changes

* widgets: add hover state management and bounding box calculations

 - add setHover and isHovered methods to manage hover state
 - implement containsPoint method for hit testing
 - override getBoundingBox in CLabel for accurate positioning
 - add onHover method in CLabel to change cursor shape

* core: add hover handling in pointer motion

 - invoke onHover method with current mouse location

* widgets: add hover handling and bounding box for password input field

 - add getBoundingBox method to calculate the widget's bounding box
 - implement onHover method to update cursor shape on hover

* widgets: update hover behavior for label widget

 - modify cursor shape setting to only apply when onclickCommand is not empty

* core: optimize hover handling and rendering for lock surfaces

 - Improve hover state tracking for widgets
 - reduce unnecessary redraw calls by tracking hover changes
 - remove redundant renderAllOutputs() call

* widgets: add onclick and hover to shape and image

* core: trigger hover and onclick only for the currently focused surface

* core: handle fractionalScale in onclick and hover

* core: don't trigger onclick or hover when hide_cursor is set

* misc: remove braces

* core: run onclick commands asnychronously

---------

Co-authored-by: Memoraike <memoraike@gmail.com>
2025-05-05 15:11:24 +00:00
Maximilian Seidler
0b1f2a97ef
input-field: decouple outer color and base for hidden input random colors (#727) 2025-04-02 22:15:59 +02:00
davc0n
d9a1625315
assets: update example.conf (#709)
Includes examples from wiki with minor modifications.
Date and time labels inspired by https://github.com/catppuccin/hyprlock

Aims to improve out-of-the-box experience and basic stuff reference.
2025-03-27 08:02:32 +00:00
izmyname
a5e346783f
examples: Add default animations to the example config (#643) 2025-01-10 13:15:27 +00:00
Mihai Fufezan
c7fa5026c0
assets: add example.conf 2024-08-02 21:39:54 +03:00