hyprlock
hyprlock copied to clipboard
Add the ability to set the image size as a percentage
Description
Currently, only shape size can be set by a percentage and image sizes can't.
Yup already planned :)
Have you thought about allowing percentage floats? I've been playing with the new units and I found myself missing the ability to use e.g. 43.21%.
what option are you talking about?
Currently, I can only set the position using integer percentages e.g. 1%, 5%, 8% and not floating point percentages e.g. 1.2% 0.3% 20.22%.
You are right. Maybe we want to change the current implementation to just take floats instead of just integers.
Currently, I can only set the position using integer percentages e.g. 1%, 5%, 8% and not floating point percentages e.g. 1.2% 0.3% 20.22%.
@kamack38 Actually that already works :)
@kamack38 I ditched the idea with pt and instead added a sizex option. Can you maybe checkout the PR I linked?
@PaideiaDilemma Has this been solved or are you still waiting for some input in the linked PR?
I have been thinking about how to do this quite a bit and I would like to implement it a bit differently.
I didn't really like the sizex thing.
Now I am thinking of smth like this:
label { # or image
...
resize {
xy = 10%, 10%
relative_to_monitor=false
lock_aspect_ratio=0
}
}
This makes it a bit more clear that we are resizing an asset. It allows the asset to be scaled based on the original asset size or relative to the monitor size the widget is on (via relative_to_monitor). It also allows to specify the size in absolute pixels. lock_aspect_ratio would allow to set either x or y to be the axes based on which the other one is inferred by.
https://github.com/PaideiaDilemma/hyprlock/commit/6da43c0c08da3b502be6de53fd6a99d121e2af4d
This looks great! I would only change the xy to something like size or split it to heigth and width.
So turns out nesting categories in widgets currently doesn't work properly. See https://github.com/hyprwm/hyprlang/pull/82