summaryrefslogtreecommitdiff
path: root/src/ui/inputwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-24 12:48:34 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-24 12:48:34 +0200
commitc83d76e7e4059b208a99ec9938d1723f62fb15e3 (patch)
tree331b9d75c0b27f8638eda7a75c03a32b8e214819 /src/ui/inputwidget.c
parentb8b81eead1f3d072a09d124ebb608ea15da3f988 (diff)
Lock button is embedded in the URL field
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r--src/ui/inputwidget.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index 76053f8b..600a4462 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -605,7 +605,11 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {
605 return iTrue; 605 return iTrue;
606 } 606 }
607 if (ev->type == SDL_MOUSEMOTION && isHover_Widget(d)) { 607 if (ev->type == SDL_MOUSEMOTION && isHover_Widget(d)) {
608 setCursor_Window(get_Window(), SDL_SYSTEM_CURSOR_IBEAM); 608 const iInt2 local = localCoord_Widget(w, init_I2(ev->motion.x, ev->motion.y));
609 setCursor_Window(get_Window(),
610 local.x >= 2 * gap_UI + d->leftPadding && local.x < width_Widget(w) - d->rightPadding
611 ? SDL_SYSTEM_CURSOR_IBEAM
612 : SDL_SYSTEM_CURSOR_ARROW);
609 } 613 }
610 switch (processEvent_Click(&d->click, ev)) { 614 switch (processEvent_Click(&d->click, ev)) {
611 case none_ClickResult: 615 case none_ClickResult:
@@ -839,7 +843,7 @@ static void draw_InputWidget_(const iInputWidget *d) {
839 isFocused ? gap_UI / 4 : 1, 843 isFocused ? gap_UI / 4 : 1,
840 isFocused ? uiInputFrameFocused_ColorId 844 isFocused ? uiInputFrameFocused_ColorId
841 : isHover ? uiInputFrameHover_ColorId : uiInputFrame_ColorId); 845 : isHover ? uiInputFrameHover_ColorId : uiInputFrame_ColorId);
842 setClip_Paint(&p, bounds); 846 setClip_Paint(&p, adjusted_Rect(bounds, init_I2(d->leftPadding, 0), init_I2(-d->rightPadding, 0)));
843 const iInt2 textOrigin = textOrigin_InputWidget_(d, cstr_String(text)); 847 const iInt2 textOrigin = textOrigin_InputWidget_(d, cstr_String(text));
844 if (isFocused && !isEmpty_Range(&d->mark)) { 848 if (isFocused && !isEmpty_Range(&d->mark)) {
845 /* Draw the selected range. */ 849 /* Draw the selected range. */