* 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>
Makes more sense than clearing the input buffer in the auth impl.
Also added a check for the password buffer length to reset the fail
color as soon as the password length > 0.
* input-field: fixup dynamic width
- Instead of not rendering placeholder text,
if it does not fit into the input-field width,
render it up until the input field size.
- Improve updateWidth.
* input-field: make sure dots center does not change during width anim
When numlock is enabled but numlock_color is fallback, `targetGrad`
remains nullptr. This causes Hyprlock to crash in updateColors().
This commit aligns the condition check for assigning `targetGrad` with
later usages.
BREAKING:
- Removed $PROMPT variable. Either use $PAMPROMPT or $FPRINTPROMPT.
- Removed $FPRINTMESSAGE. Use $FPRINTPROMPT instead. There is also
$FPRINTFAIL.
BREAKING:
- Removed `input-field:dots_fade_time`. Now configured via
`animation=inputFieldDots,...`
- Removed `input-field:fail_transition`. Now configured via
`animation=inputFieldColors,...`
- Removed `general:no_fade_in` and `general:no_fade_out`. Now configured
globally via `animations:enabled` or via `animation=fadeIn,...` and
`animation=fadeOut,...`
* widget: add utility functions to calculate borders and make em static
* image: use the rounding util functions
* input-field: use the rounding util functions
* shape: use the rounding util functions
* auth: add an interface for different authentication methods
* auth: pick inline feedback based on last active implementation
* config: move auth options to auth:<auth_impl>
BREAKING:
- general:pam_module -> auth:pam:module
- general:enable_fingerprint -> auth:fingerprint:enabled
- general:fingerprint_ready_message -> auth:fingerprint:ready_message
- general:fingerprint_present_message ->
auth:fingerprint:present_message
* auth: don't clear password input for fingerprint auth check
* fingerprint: checkAuthenticated when handling verfiy status
* Revert conditionally clearing the password input buffer
Makes sure the input field can show the fail text for fingerprint auth.
* auth: virtual instead of override, remove braces
* pam: join the thread
* auth: remove isAuthenticated and switch to a control flow based unlock
* auth: initialize authentication before aquiring the session lock
* renderer: add renderBorder function
* config: add CGradientValueData from Hyprland
* input-field: change outer to take gradients
Added gradient support to the following color options:
- `outer_color`
- `fail_color`
- `check_color`
- `capslock_color`
- `numlock_color`
- `bothlock_color``
* image: add gradient border
* shape: add gradient border
* shaders: adapt the new rounded smoothing factor from Hyprland
* config: introduce a custom value type for layout related options
* widgets: use CLayoutValueData for size and position options
* widgets: catch bad_any_cast and out_of_range when contructing widgets other than label
* config: rename and restrict CLayoutValueData::fromAny to fromAnyPv
This is only for casting `any` variables that represent a void * to a
CLayoutValueData*, not just any any.
* misc: remove debug prints
* misc: use Vector2D, Box and Mat3x3 from hyprutils
* nix: flake update
Fix CI fails. We need hyprutils>=0.2.3
* misc: use a function to convert Hyprlang::VEC2 to Vector2D
* misc: fixup some includes
* input-field: make dots support arbitrary chars
* input-field: add font_familiy for placeholder and text dots
* input-field: allow dots_spacing from -1.0 to 1.0
Useful when using emojis in dots_text_format
* config: add input-field dots_fade_time option
Time is in milliseconds. Anything <= 0 is immediate.
* input-field: change speedPerSecond to fadeMs
Default is 200ms, which is the same amount of time as the previous
5 speedPerSecond. Not sure using doubles is necessary, but I'm
using them to avoid precision issues.
Closes: https://github.com/hyprwm/hyprlock/issues/355
* input-field: refactor updateColors
* input-field: fix input-field:invert_numlock
* input-field: use updatePlaceholder to request the initial placeholder asset
* input-field: allow more gradual color animations
* input-field: fix caps and num indicator colors, when borderless and swap_font_color is true
* auth: implement a full pam conversation
* input-field: fixup failedAttempts and color change
Credits to @bvr-yr
* pam: set default module to hyprland
* input-field: backup previous asset
* auth: restart auth in onPasswordCheckTimer
* auth: immediately switch to waiting when input was submitted
* auth: remove redundant waitingForPamAuth
* auth: add inputRequested and reschedule submitInput
* auth: clear password buffer and handle submitInput before input is requested
* Revert "input-field: backup previous asset"
This reverts commit 89702945be6af4aa43f54688ad34a4ccba994a3e.
Without the backup we avoid rendering the prompt placeholder for one frame when the failText is not available.
Looks better this way.
* auth: fallback to su if pam_module not in /etc/pam.d
rare occasion where a path check even works on nix
* auth: rename inputSubmitted and resubmit callback
* auth: detach failText from the conversation
* fix rebase mistake
* auth: make sure prompt and failText are not reset when restarting auth
needed for labels
* auth: force update timers when the prompt changes
* auth: remove unused stuff
* input-field: new color features
* add nix HM
* add workaround for faillasset not being shown on empty imput
* comment
* change cfg option name
* remove TODO
* small fix
* one more edge check
* dedup changeColor function
* simplify more
* input-field: some fixes
* simplify; correctly check passlen(utf8) in draw return
* correctly erase utf-8 on backspace
* render on up events too
* omglul
me dumb
* revert fade speed change
* input-field: add fade out timeout
* input-field: let dots reset themselfs
Now the dots kind of fade into the placeholder text on a failure.
* Nix/HM module: add input-field:fade_timeout option