summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-25 09:38:15 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-25 09:38:15 +0300
commit79bb296310755eb791dde7302edea214b9ecf878 (patch)
treecb2dcdccece74f9bd518091fa41a22de5c1a0b71 /src/ui
parent4363fb7cf3f58221cce2c6b7fcfb32b8d41febee (diff)
InputWidget: Adjusted padding
Aligns better with labels.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/inputwidget.c3
-rw-r--r--src/ui/window.c1
2 files changed, 3 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
280static void draw_InputWidget_(const iInputWidget *d) { 280static 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;
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) {
120 setId_Widget(as_Widget(url), "url"); 120 setId_Widget(as_Widget(url), "url");
121 setTextCStr_InputWidget(url, "gemini://"); 121 setTextCStr_InputWidget(url, "gemini://");
122 addChildFlags_Widget(navBar, iClob(url), expand_WidgetFlag); 122 addChildFlags_Widget(navBar, iClob(url), expand_WidgetFlag);
123 addChild_Widget(navBar, iClob(new_LabelWidget("x", 0, 0, "navigate.reload")));
123 } 124 }
124 125
125 addChildFlags_Widget(div, iClob(new_DocumentWidget()), expand_WidgetFlag); 126 addChildFlags_Widget(div, iClob(new_DocumentWidget()), expand_WidgetFlag);