Commit graph

8 commits

Author SHA1 Message Date
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
Honkazel
dc6d72158c
core: clang-tidy and comp fixes (#679)
* clang-tidy and comp fixes

* nit changes
2025-02-06 11:36:08 +00:00
Maximilian Seidler
07b5e1b4cd
core: fix background screenshot on nvidia (#656)
Fixes DMA buffer screencopy on nvidia cards. Additionally adds shm screencopy as an option
2025-01-24 14:25:37 +01:00
davc0n
de844d39ad
helpers: fix absolutePath relative with tilde (#640)
Relative path was not handled if input started with tilde.
Examples:
	~/./test
	~/weird/../test

No reason to do something like this imho, but users you never know.
2025-01-06 13:18:13 +00:00
Maximilian Seidler
d159e14e5b
config: make configStringToInt support rgb(a) with decimal values (#558) 2024-11-15 00:43:47 +00:00
Maximilian Seidler
6c3c444136
core: add border shader and border gradients (#548)
* 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
2024-11-09 16:54:44 +00:00
Maximilian Seidler
0f44f76368
misc: path handling improvements (#163)
* misc: use weakly_canonical for absolutePath

* misc: make absolutePath not optional

* misc: use currentDir as the argument to absolutePath

* config: avoid circular imports
2024-03-10 14:37:25 +00:00
Maurice Kraus
2fc23cbfc8
config: add source parsing (#28)
* config: add source parsing

* config: add nested source parsing

* config: streamlined absolutePath impl
2024-02-21 23:52:12 +00:00