Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input-field: improve dynamic width #647

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PaideiaDilemma
Copy link
Collaborator

In #582 I changed it so the placeholder text is not rendered until the dynamic width resizes and the placeholder actually fits.
That however also looks off, especially with slow animation speeds.

This PR changes it so that it will render it right away, but cut it where the input field ends.
Alba and me also thought about fading in the placeholder text, but I think that is smth for a separate PR.

CC @alba4k you wanna test again? I did not include a pad to the input field like you suggested, cause if think it looks better like that.

- 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.
@alba4k
Copy link
Contributor

alba4k commented Jan 13, 2025

will test this evening

@alba4k
Copy link
Contributor

alba4k commented Jan 13, 2025

Looks nice. Also not sure if you changed it here or previously, but the resizing animation also seems smoother (that weird going back to small and growing from there seems fixed)

I don't really like how the shadow disappears during resizing, is that a choice you made because of performance losses?

Also, is it just my eyes tricking me or did the fade animation disappear during the change of the input-field border color? pretty sure it's just changing instantly

Also, you're right, padding probably isn't needed, especially if we consider the default speed of that animation

@PaideiaDilemma
Copy link
Collaborator Author

I don't really like how the shadow disappears during resizing, is that a choice you made because of performance losses?

Yep, we need to do some low-hanging shadow optimizations (like not using the entire viewport for the shadow framebuffer) before considering enabling it again I think.

Also, is it just my eyes tricking me or did the fade animation disappear during the change of the input-field border color? pretty sure it's just changing instantly

Actually I am a bit confused about that. When i increase the animation duration, it clearly fades, but on the default config it really looks instant. However it does fade a bit still. Not really sure if it's just perception or something is slightly off...

@PaideiaDilemma
Copy link
Collaborator Author

Both things are not directly related to this pr.

@PaideiaDilemma
Copy link
Collaborator Author

For reference this is how looks with increased width animation duration.

hyprlock_dynamic_width.mp4

@alba4k
Copy link
Contributor

alba4k commented Jan 17, 2025

have you tried putting a video of the normal thing in slow motion?

https://quickshare.samsungcloud.com/qAPanzawNNFh

@PaideiaDilemma
Copy link
Collaborator Author

PaideiaDilemma commented Jan 17, 2025

good idea.
There are a few frames of a transition in your vid or am i mistaken?
the shadow thing looks unfortunate. especially when it has to resize very slightly like in your example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants