From 79bb296310755eb791dde7302edea214b9ecf878 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 25 Jul 2020 09:38:15 +0300 Subject: InputWidget: Adjusted padding Aligns better with labels. --- src/ui/inputwidget.c | 3 ++- src/ui/window.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ui') 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) { static void draw_InputWidget_(const iInputWidget *d) { const uint32_t time = frameTime_Window(get_Window()); - const iInt2 padding = init_I2(3 * gap_UI, gap_UI / 2); + const iInt2 padding = init_I2(gap_UI / 2, gap_UI / 2); iRect bounds = adjusted_Rect(bounds_Widget(constAs_Widget(d)), padding, neg_I2(padding)); const iBool isFocused = isFocused_Widget(constAs_Widget(d)); const iBool isHover = isHover_Widget(constAs_Widget(d)) && @@ -293,6 +293,7 @@ static void draw_InputWidget_(const iInputWidget *d) { adjusted_Rect(bounds, neg_I2(one_I2()), zero_I2()), isFocused ? orange_ColorId : isHover ? cyan_ColorId : gray50_ColorId); setClip_Paint(&p, bounds); + shrink_Rect(&bounds, init_I2(gap_UI * 2, 0)); const iInt2 emSize = advance_Text(d->font, "M"); const int textWidth = advance_Text(d->font, cstr_String(&text)).x; const int cursorX = advanceN_Text(d->font, cstr_String(&text), d->cursor).x; diff --git a/src/ui/window.c b/src/ui/window.c index e08f6d6c..8236b9e6 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -120,6 +120,7 @@ static void setupUserInterface_Window(iWindow *d) { setId_Widget(as_Widget(url), "url"); setTextCStr_InputWidget(url, "gemini://"); addChildFlags_Widget(navBar, iClob(url), expand_WidgetFlag); + addChild_Widget(navBar, iClob(new_LabelWidget("x", 0, 0, "navigate.reload"))); } addChildFlags_Widget(div, iClob(new_DocumentWidget()), expand_WidgetFlag); -- cgit v1.2.3