Show placeholder text in text fields even when focused

This is fine, there's no particular benefit to hiding it when they are focused. I did find it annoying that the cursor got a bit tangled up with the placeholder text though, so I moved the text a bit to the right.
This commit is contained in:
Tamás Bálint Misius
2024-10-14 00:10:47 +02:00
parent f9ccc24177
commit c96128f241

View File

@@ -625,12 +625,9 @@ void Textbox::Draw(const Point& screenPos)
screenPos + tp + Vec2{ cursorPositionX, cursorPositionY+9 },
0xFFFFFF_rgb);
}
else
if(!text.length())
{
if(!text.length())
{
g->BlendText(screenPos + tp, placeHolder, textColour.NoAlpha().WithAlpha(170));
}
g->BlendText(screenPos + tp + Vec2{ 3, 0 }, placeHolder, textColour.NoAlpha().WithAlpha(170));
}
if(Appearance.icon)
g->draw_icon(screenPos.X+iconPosition.X, screenPos.Y+iconPosition.Y, Appearance.icon);