diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-17 07:09:20 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-17 07:09:20 +0300 |
commit | 4c57a05442c86b8bb79df58e0718810031956b90 (patch) | |
tree | e16314c0d65f04a007d86efc926a7a8d9b423ec5 | |
parent | 626cf01c7102b89f0ff352603f6b89f2aa9425c0 (diff) |
Cleanup
-rw-r--r-- | src/ui/inputwidget.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 32fb5ccb..39da1c3b 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -1357,13 +1357,7 @@ static void draw_InputWidget_(const iInputWidget *d) { | |||
1357 | } | 1357 | } |
1358 | iPaint p; | 1358 | iPaint p; |
1359 | init_Paint(&p); | 1359 | init_Paint(&p); |
1360 | /* `lines` is already up to date and ready for drawing. */ | 1360 | /* `lines` is already up to date and ready for drawing. */ |
1361 | /* TODO: If empty, draw the hint. */ | ||
1362 | // iString *text = visText_InputWidget_(d); | ||
1363 | // if (isWhite_(text) && !isEmpty_String(&d->hint)) { | ||
1364 | // set_String(text, &d->hint); | ||
1365 | // isHint = iTrue; | ||
1366 | // } | ||
1367 | fillRect_Paint( | 1361 | fillRect_Paint( |
1368 | &p, bounds, isFocused ? uiInputBackgroundFocused_ColorId : uiInputBackground_ColorId); | 1362 | &p, bounds, isFocused ? uiInputBackgroundFocused_ColorId : uiInputBackground_ColorId); |
1369 | drawRectThickness_Paint(&p, | 1363 | drawRectThickness_Paint(&p, |
@@ -1374,7 +1368,6 @@ static void draw_InputWidget_(const iInputWidget *d) { | |||
1374 | setClip_Paint(&p, adjusted_Rect(bounds, init_I2(d->leftPadding, 0), | 1368 | setClip_Paint(&p, adjusted_Rect(bounds, init_I2(d->leftPadding, 0), |
1375 | init_I2(-d->rightPadding, w->flags & extraPadding_WidgetFlag ? -gap_UI / 2 : 0))); | 1369 | init_I2(-d->rightPadding, w->flags & extraPadding_WidgetFlag ? -gap_UI / 2 : 0))); |
1376 | const iRect contentBounds = contentBounds_InputWidget_(d); | 1370 | const iRect contentBounds = contentBounds_InputWidget_(d); |
1377 | // const iInt2 textOrigin = textOrigin_InputWidget_(d); //, cstr_String(text)); | ||
1378 | iInt2 drawPos = topLeft_Rect(contentBounds); | 1371 | iInt2 drawPos = topLeft_Rect(contentBounds); |
1379 | const int fg = isHint ? uiAnnotation_ColorId | 1372 | const int fg = isHint ? uiAnnotation_ColorId |
1380 | : isFocused && !isEmpty_Array(&d->text) ? uiInputTextFocused_ColorId | 1373 | : isFocused && !isEmpty_Array(&d->text) ? uiInputTextFocused_ColorId |
@@ -1418,19 +1411,6 @@ static void draw_InputWidget_(const iInputWidget *d) { | |||
1418 | drawPos.y += lineHeight_Text(d->font); | 1411 | drawPos.y += lineHeight_Text(d->font); |
1419 | } | 1412 | } |
1420 | } | 1413 | } |
1421 | // if (d->buffered && !isFocused && !isHint) { | ||
1422 | // /* Most input widgets will use this, since only one is focused at a time. */ | ||
1423 | // draw_TextBuf(d->buffered, textOrigin, white_ColorId); | ||
1424 | // } | ||
1425 | // else { | ||
1426 | // draw_Text(d->font, | ||
1427 | // textOrigin, | ||
1428 | // isHint ? uiAnnotation_ColorId | ||
1429 | // : isFocused && !isEmpty_Array(&d->text) ? uiInputTextFocused_ColorId | ||
1430 | // : uiInputText_ColorId, | ||
1431 | // "%s", | ||
1432 | // cstr_String(text)); | ||
1433 | // } | ||
1434 | unsetClip_Paint(&p); | 1414 | unsetClip_Paint(&p); |
1435 | /* Cursor blinking. */ | 1415 | /* Cursor blinking. */ |
1436 | if (isFocused && d->cursorVis) { | 1416 | if (isFocused && d->cursorVis) { |
@@ -1474,7 +1454,6 @@ static void draw_InputWidget_(const iInputWidget *d) { | |||
1474 | deinit_String(&cur); | 1454 | deinit_String(&cur); |
1475 | } | 1455 | } |
1476 | } | 1456 | } |
1477 | // delete_String(text); | ||
1478 | drawChildren_Widget(w); | 1457 | drawChildren_Widget(w); |
1479 | } | 1458 | } |
1480 | 1459 | ||