input-field: use IWidget::formatString for placeholder text (#603)

This commit is contained in:
Maximilian Seidler 2024-12-24 22:38:39 +00:00 committed by GitHub
parent bf37645daa
commit 90bc9764f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -347,12 +347,11 @@ void CPasswordInputField::updatePlaceholder() {
if (displayFail) {
g_pHyprlock->addTimer(std::chrono::milliseconds(configFailTimeoutMs), failTimeoutCallback, nullptr);
placeholder.currentText = configFailText;
replaceInString(placeholder.currentText, "$FAIL", AUTHFEEDBACK);
replaceInString(placeholder.currentText, "$ATTEMPTS", std::to_string(placeholder.failedAttempts));
const auto FORMATTEDFAIL = formatString(configFailText).formatted;
placeholder.currentText = FORMATTEDFAIL;
} else {
placeholder.currentText = configPlaceholderText;
replaceInString(placeholder.currentText, "$PROMPT", AUTHFEEDBACK);
const auto FORMATTEDPLACEHOLDER = formatString(configPlaceholderText).formatted;
placeholder.currentText = FORMATTEDPLACEHOLDER;
}
placeholder.resourceID =