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 fade out timeout v2 #139

Closed

Conversation

PaideiaDilemma
Copy link
Collaborator

Successor to #109

The goal is to be able to show the placeholder text for a certain amount of time and then fade out the input field. That would allow to also handle the failure text better.

I felt like it was bad to add a timer within the renderer, as we have to acquire a lock for that.
That's why I added a virtual function to IWidget and implemented it for CPasswordInputField. This way we could implement it for CLabel as well and have some UI element fade together with the input field (don't know if anyone would want that).

Initiating the timer is done in onKey (to check if the password input was cleared) and in the onPasswordCheckTimer function (to add the timer when a auth failure happens).

Not ready to merge yet, would like some feedback first.

@PaideiaDilemma PaideiaDilemma force-pushed the input-fade-out-timeout-v2 branch from d839714 to 5a62232 Compare March 6, 2024 11:14
@@ -46,6 +46,7 @@ void CConfigManager::init() {
m_config.addConfigValue("general:hide_cursor", Hyprlang::INT{0});
m_config.addConfigValue("general:grace", Hyprlang::INT{0});
m_config.addConfigValue("general:no_fade_in", Hyprlang::INT{0});
m_config.addConfigValue("general:input_empty_fade_timeout", Hyprlang::INT{1000});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't this in the input-field cat?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk because i used it in CHyprlock
wanted to change that anyways

@vaxerski
Copy link
Member

vaxerski commented Mar 6, 2024

I felt like it was bad to add a timer within the renderer, as we have to acquire a lock for that.

CHyprlock::addTimer is thread-safe

@PaideiaDilemma
Copy link
Collaborator Author

Will close because probably overdone. Its simpler to just add it to CPasswordInputField::updateFade.

@PaideiaDilemma PaideiaDilemma deleted the input-fade-out-timeout-v2 branch July 7, 2024 14:35
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