=> 70bdd01fbb3b2a99ddb4358a5fc7c7786f2769d6
[1mdiff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c[m [1mindex c3c5fbe5..9c8fb2ee 100644[m [1m--- a/src/ui/labelwidget.c[m [1m+++ b/src/ui/labelwidget.c[m [36m@@ -126,6 +126,11 @@[m [mstatic iBool processEvent_LabelWidget_(iLabelWidget *d, const SDL_Event *ev) {[m updateKey_LabelWidget_(d);[m return iFalse;[m }[m [32m+[m[32m else if (isCommand_Widget(w, ev, "focus.gained") ||[m [32m+[m[32m isCommand_Widget(w, ev, "focus.lost")) {[m [32m+[m[32m refresh_Widget(d);[m [32m+[m[32m return iFalse;[m [32m+[m[32m }[m if (!isEmpty_String(&d->command)) {[m #if 0 && defined (iPlatformAppleMobile)[m /* Touch allows activating any button on release. */[m [36m@@ -161,10 +166,17 @@[m [mstatic iBool processEvent_LabelWidget_(iLabelWidget *d, const SDL_Event *ev) {[m switch (ev->type) {[m case SDL_KEYDOWN: {[m const int mods = ev->key.keysym.mod;[m [31m- if (d->key && ev->key.keysym.sym == d->key && checkModifiers_(mods, d->kmods)) {[m [32m+[m[32m const int sym = ev->key.keysym.sym;[m [32m+[m[32m if (d->key && sym == d->key && checkModifiers_(mods, d->kmods)) {[m trigger_LabelWidget_(d);[m return iTrue;[m }[m [32m+[m[32m if (isFocused_Widget(d) && mods == 0 &&[m [32m+[m[32m (sym == SDLK_SPACE || sym == SDLK_RETURN || sym == SDLK_KP_ENTER)) {[m [32m+[m[32m trigger_LabelWidget_(d);[m [32m+[m[32m refresh_Widget(d);[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m break;[m }[m }[m [36m@@ -179,6 +191,7 @@[m [mstatic void keyStr_LabelWidget_(const iLabelWidget *d, iString *str) {[m static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int *frame1, int *frame2) {[m const iWidget *w = constAs_Widget(d);[m const int64_t flags = flags_Widget(w);[m [32m+[m[32m const iBool isFocus = (flags & focusable_WidgetFlag && isFocused_Widget(d));[m const iBool isPress = (flags & pressed_WidgetFlag) != 0;[m const iBool isSel = (flags & selected_WidgetFlag) != 0;[m const iBool isFrameless = (flags & frameless_WidgetFlag) != 0;[m [36m@@ -212,6 +225,9 @@[m [mstatic void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int[m }[m }[m }[m [32m+[m[32m if (isFocus) {[m [32m+[m[32m *frame1 = *frame2 = uiInputFrameFocused_ColorId;[m [32m+[m[32m }[m int colorEscape = none_ColorId;[m if (startsWith_String(&d->label, "\v")) {[m colorEscape = cstr_String(&d->label)[1] - asciiBase_ColorEscape; /* TODO: can be two bytes long */[m [36m@@ -295,7 +311,11 @@[m [mstatic void draw_LabelWidget_(const iLabelWidget *d) {[m if (bg >= 0) {[m fillRect_Paint(&p, rect, isCaution && isHover ? uiMarked_ColorId : bg);[m }[m [31m- if (~flags & frameless_WidgetFlag) {[m [32m+[m[32m if (isFocused_Widget(w)) {[m [32m+[m[32m iRect frameRect = adjusted_Rect(rect, zero_I2(), init1_I2(-1));[m [32m+[m[32m drawRectThickness_Paint(&p, frameRect, gap_UI / 4, frame);[m[41m [m [32m+[m[32m }[m [32m+[m[32m else if (~flags & frameless_WidgetFlag) {[m iRect frameRect = adjusted_Rect(rect, zero_I2(), init1_I2(-1));[m if (isButton) {[m iInt2 points[] = {[m [36m@@ -312,8 +332,10 @@[m [mstatic void draw_LabelWidget_(const iLabelWidget *d) {[m }[m #endif[m drawLines_Paint(&p, points + 2, 3, frame2);[m [31m- drawLines_Paint([m [31m- &p, points, !isHover && d->flags.noTopFrame ? 2 : 3, frame);[m [32m+[m[32m drawLines_Paint(&p,[m [32m+[m[32m points,[m [32m+[m[32m isFocused_Widget(w) ? 3 : (!isHover && d->flags.noTopFrame ? 2 : 3),[m [32m+[m[32m frame);[m }[m }[m setClip_Paint(&p, rect);[m [36m@@ -473,7 +495,7 @@[m [mvoid init_LabelWidget(iLabelWidget *d, const char *label, const char *cmd) {[m d->key = 0;[m d->kmods = 0;[m init_Click(&d->click, d, !isEmpty_String(&d->command) ? SDL_BUTTON_LEFT : 0);[m [31m- setFlags_Widget(w, hover_WidgetFlag, d->click.button != 0);[m [32m+[m[32m setFlags_Widget(w, focusable_WidgetFlag | hover_WidgetFlag, d->click.button != 0);[m updateSize_LabelWidget(d);[m updateKey_LabelWidget_(d); /* could be bound to another key */[m }[m [1mdiff --git a/src/ui/lookupwidget.c b/src/ui/lookupwidget.c[m [1mindex bf190d58..85217336 100644[m [1m--- a/src/ui/lookupwidget.c[m [1m+++ b/src/ui/lookupwidget.c[m [36m@@ -747,12 +747,19 @@[m [mstatic iBool processEvent_LookupWidget_(iLookupWidget *d, const SDL_Event *ev) {[m return iTrue;[m }[m }[m [31m- if (isVisible_Widget(w) &&[m [31m- key == SDLK_DOWN && !mods && focus_Widget() == findWidget_App("url") &&[m [31m- numItems_ListWidget(d->list)) {[m [31m- setCursor_LookupWidget_(d, 1); /* item 0 is always the first heading */[m [31m- setFocus_Widget(w);[m [31m- return iTrue;[m [32m+[m[32m /* Focus switching between URL bar and lookup results. */[m [32m+[m[32m if (isVisible_Widget(w)) {[m [32m+[m[32m if (((key == SDLK_DOWN && !mods) || key == SDLK_TAB) &&[m [32m+[m[32m focus_Widget() == findWidget_App("url") &&[m [32m+[m[32m numItems_ListWidget(d->list)) {[m [32m+[m[32m setCursor_LookupWidget_(d, 1); /* item 0 is always the first heading */[m [32m+[m[32m setFocus_Widget(w);[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m else if (key == SDLK_TAB && isFocused_Widget(w)) {[m [32m+[m[32m setFocus_Widget(findWidget_App("url"));[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m }[m }[m return processEvent_Widget(w, ev);[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).