summaryrefslogtreecommitdiff
path: root/src/ui/inputwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-06-17 07:09:20 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-06-17 11:07:24 +0300
commit1455c26b793be67f5c47a7f7dbf06c9c263d8e2a (patch)
treec91ea97453008f341e83a7cf3126873c841304ef /src/ui/inputwidget.c
parentb4699418195cd7d6057aeef256ed2fc824f3862d (diff)
Cleanup
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r--src/ui/inputwidget.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index 9571a97e..b108ee17 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -1365,13 +1365,7 @@ static void draw_InputWidget_(const iInputWidget *d) {
1365 } 1365 }
1366 iPaint p; 1366 iPaint p;
1367 init_Paint(&p); 1367 init_Paint(&p);
1368 /* `lines` is already up to date and ready for drawing. */ 1368 /* `lines` is already up to date and ready for drawing. */
1369 /* TODO: If empty, draw the hint. */
1370// iString *text = visText_InputWidget_(d);
1371// if (isWhite_(text) && !isEmpty_String(&d->hint)) {
1372// set_String(text, &d->hint);
1373// isHint = iTrue;
1374// }
1375 fillRect_Paint( 1369 fillRect_Paint(
1376 &p, bounds, isFocused ? uiInputBackgroundFocused_ColorId : uiInputBackground_ColorId); 1370 &p, bounds, isFocused ? uiInputBackgroundFocused_ColorId : uiInputBackground_ColorId);
1377 drawRectThickness_Paint(&p, 1371 drawRectThickness_Paint(&p,
@@ -1382,7 +1376,6 @@ static void draw_InputWidget_(const iInputWidget *d) {
1382 setClip_Paint(&p, adjusted_Rect(bounds, init_I2(d->leftPadding, 0), 1376 setClip_Paint(&p, adjusted_Rect(bounds, init_I2(d->leftPadding, 0),
1383 init_I2(-d->rightPadding, w->flags & extraPadding_WidgetFlag ? -gap_UI / 2 : 0))); 1377 init_I2(-d->rightPadding, w->flags & extraPadding_WidgetFlag ? -gap_UI / 2 : 0)));
1384 const iRect contentBounds = contentBounds_InputWidget_(d); 1378 const iRect contentBounds = contentBounds_InputWidget_(d);
1385// const iInt2 textOrigin = textOrigin_InputWidget_(d); //, cstr_String(text));
1386 iInt2 drawPos = topLeft_Rect(contentBounds); 1379 iInt2 drawPos = topLeft_Rect(contentBounds);
1387 const int fg = isHint ? uiAnnotation_ColorId 1380 const int fg = isHint ? uiAnnotation_ColorId
1388 : isFocused && !isEmpty_Array(&d->text) ? uiInputTextFocused_ColorId 1381 : isFocused && !isEmpty_Array(&d->text) ? uiInputTextFocused_ColorId
@@ -1426,19 +1419,6 @@ static void draw_InputWidget_(const iInputWidget *d) {
1426 drawPos.y += lineHeight_Text(d->font); 1419 drawPos.y += lineHeight_Text(d->font);
1427 } 1420 }
1428 } 1421 }
1429// if (d->buffered && !isFocused && !isHint) {
1430// /* Most input widgets will use this, since only one is focused at a time. */
1431// draw_TextBuf(d->buffered, textOrigin, white_ColorId);
1432// }
1433// else {
1434// draw_Text(d->font,
1435// textOrigin,
1436// isHint ? uiAnnotation_ColorId
1437// : isFocused && !isEmpty_Array(&d->text) ? uiInputTextFocused_ColorId
1438// : uiInputText_ColorId,
1439// "%s",
1440// cstr_String(text));
1441// }
1442 unsetClip_Paint(&p); 1422 unsetClip_Paint(&p);
1443 /* Cursor blinking. */ 1423 /* Cursor blinking. */
1444 if (isFocused && d->cursorVis) { 1424 if (isFocused && d->cursorVis) {
@@ -1482,7 +1462,6 @@ static void draw_InputWidget_(const iInputWidget *d) {
1482 deinit_String(&cur); 1462 deinit_String(&cur);
1483 } 1463 }
1484 } 1464 }
1485// delete_String(text);
1486 drawChildren_Widget(w); 1465 drawChildren_Widget(w);
1487} 1466}
1488 1467