mirror of
https://github.com/hyprwm/hyprlock.git
synced 2026-05-08 22:08:02 +02:00
don't show eye when password is empty
This commit is contained in:
parent
b1dc5df422
commit
116789b19a
1 changed files with 8 additions and 10 deletions
|
|
@ -400,13 +400,8 @@ bool CPasswordInputField::draw(const SRenderData& data) {
|
|||
g_pRenderer->renderRect(box, fontCol, dots.rounding);
|
||||
|
||||
fontCol.a = DOTALPHA;
|
||||
|
||||
auto eyeSize = eye.asset->texture.m_vSize;
|
||||
auto eyePosition = inputFieldBox.pos() + Vector2D{inputFieldBox.w - eyeSize.x - DOTPAD, DOTPAD};
|
||||
box = {eyePosition, eyeSize};
|
||||
g_pRenderer->renderTexture(box, eye.asset->texture, fontCol.a);
|
||||
}
|
||||
} else if (password.content.length() > 0) {
|
||||
} else if (passwordLength != 0) {
|
||||
password.asset = g_pRenderer->asyncResourceGatherer->getAssetByID(password.resourceID);
|
||||
|
||||
if (password.asset) {
|
||||
|
|
@ -420,14 +415,17 @@ bool CPasswordInputField::draw(const SRenderData& data) {
|
|||
CBox box{passwordPosition, passSize};
|
||||
|
||||
g_pRenderer->renderTexture(box, password.asset->texture, fontCol.a);
|
||||
|
||||
passwordPosition = inputFieldBox.pos() + Vector2D{inputFieldBox.w - eyeSize.x - padding, padding};
|
||||
box = {passwordPosition, eyeSize};
|
||||
g_pRenderer->renderTexture(box, eye.asset->texture, fontCol.a);
|
||||
} else {
|
||||
forceReload = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (passwordLength != 0) {
|
||||
auto padding = (inputFieldBox.h - eyeSize.y) / 2.0;
|
||||
auto eyePosition = inputFieldBox.pos() + Vector2D{inputFieldBox.w - eyeSize.x - padding, (inputFieldBox.h - eyeSize.y) / 2};
|
||||
CBox box = {eyePosition, eyeSize};
|
||||
g_pRenderer->renderTexture(box, eye.asset->texture, fontCol.a);
|
||||
}
|
||||
}
|
||||
|
||||
if (passwordLength == 0 && !checkWaiting && !placeholder.resourceID.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue