diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-25 09:38:15 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-25 09:38:15 +0300 |
commit | 79bb296310755eb791dde7302edea214b9ecf878 (patch) | |
tree | cb2dcdccece74f9bd518091fa41a22de5c1a0b71 /src/ui/inputwidget.c | |
parent | 4363fb7cf3f58221cce2c6b7fcfb32b8d41febee (diff) |
InputWidget: Adjusted padding
Aligns better with labels.
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r-- | src/ui/inputwidget.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index e23e5acc..3b60fc45 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -279,7 +279,7 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) { | |||
279 | 279 | ||
280 | static void draw_InputWidget_(const iInputWidget *d) { | 280 | static void draw_InputWidget_(const iInputWidget *d) { |
281 | const uint32_t time = frameTime_Window(get_Window()); | 281 | const uint32_t time = frameTime_Window(get_Window()); |
282 | const iInt2 padding = init_I2(3 * gap_UI, gap_UI / 2); | 282 | const iInt2 padding = init_I2(gap_UI / 2, gap_UI / 2); |
283 | iRect bounds = adjusted_Rect(bounds_Widget(constAs_Widget(d)), padding, neg_I2(padding)); | 283 | iRect bounds = adjusted_Rect(bounds_Widget(constAs_Widget(d)), padding, neg_I2(padding)); |
284 | const iBool isFocused = isFocused_Widget(constAs_Widget(d)); | 284 | const iBool isFocused = isFocused_Widget(constAs_Widget(d)); |
285 | const iBool isHover = isHover_Widget(constAs_Widget(d)) && | 285 | const iBool isHover = isHover_Widget(constAs_Widget(d)) && |
@@ -293,6 +293,7 @@ static void draw_InputWidget_(const iInputWidget *d) { | |||
293 | adjusted_Rect(bounds, neg_I2(one_I2()), zero_I2()), | 293 | adjusted_Rect(bounds, neg_I2(one_I2()), zero_I2()), |
294 | isFocused ? orange_ColorId : isHover ? cyan_ColorId : gray50_ColorId); | 294 | isFocused ? orange_ColorId : isHover ? cyan_ColorId : gray50_ColorId); |
295 | setClip_Paint(&p, bounds); | 295 | setClip_Paint(&p, bounds); |
296 | shrink_Rect(&bounds, init_I2(gap_UI * 2, 0)); | ||
296 | const iInt2 emSize = advance_Text(d->font, "M"); | 297 | const iInt2 emSize = advance_Text(d->font, "M"); |
297 | const int textWidth = advance_Text(d->font, cstr_String(&text)).x; | 298 | const int textWidth = advance_Text(d->font, cstr_String(&text)).x; |
298 | const int cursorX = advanceN_Text(d->font, cstr_String(&text), d->cursor).x; | 299 | const int cursorX = advanceN_Text(d->font, cstr_String(&text), d->cursor).x; |