summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-08 10:27:48 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-08 10:27:48 +0300
commit487ad42e3e1d038e5c0d196cb3c590bb8ffe4d50 (patch)
tree2d2ed2624b6b7767112884a112ff8a4087e7cc68 /src
parentbc087ea05c4d1db19fcd3ce5c94a6795d94b3a26 (diff)
LookupWidget: Item selection tweaks
Diffstat (limited to 'src')
-rw-r--r--src/app.c1
-rw-r--r--src/ui/lookupwidget.c5
2 files changed, 3 insertions, 3 deletions
diff --git a/src/app.c b/src/app.c
index 5c857223..44ec18e6 100644
--- a/src/app.c
+++ b/src/app.c
@@ -517,6 +517,7 @@ void postCommandf_App(const char *command, ...) {
517} 517}
518 518
519iAny *findWidget_App(const char *id) { 519iAny *findWidget_App(const char *id) {
520 if (!*id) return NULL;
520 return findChild_Widget(app_.window->root, id); 521 return findChild_Widget(app_.window->root, id);
521} 522}
522 523
diff --git a/src/ui/lookupwidget.c b/src/ui/lookupwidget.c
index 676f8678..ef262b46 100644
--- a/src/ui/lookupwidget.c
+++ b/src/ui/lookupwidget.c
@@ -501,7 +501,7 @@ static void presentResults_LookupWidget_(iLookupWidget *d) {
501 case content_LookupResultType: { 501 case content_LookupResultType: {
502 item->fg = uiText_ColorId; 502 item->fg = uiText_ColorId;
503 item->font = uiContent_FontId; 503 item->font = uiContent_FontId;
504 format_String(&item->text, "%s \u2014 pe%s", url, cstr_String(&res->label)); 504 format_String(&item->text, "%s \u2014 %s", url, cstr_String(&res->label));
505 format_String(&item->command, "open url:%s", cstr_String(&res->url)); 505 format_String(&item->command, "open url:%s", cstr_String(&res->url));
506 break; 506 break;
507 } 507 }
@@ -594,14 +594,13 @@ static iBool processEvent_LookupWidget_(iLookupWidget *d, const SDL_Event *ev) {
594 } 594 }
595 if (isCommand_Widget(w, ev, "list.clicked")) { 595 if (isCommand_Widget(w, ev, "list.clicked")) {
596 iInputWidget *url = findWidget_App("url"); 596 iInputWidget *url = findWidget_App("url");
597// setTextCStr_InputWidget(findWidget_App("url"), "");
598 const iLookupItem *item = constItem_ListWidget(d->list, arg_Command(cmd)); 597 const iLookupItem *item = constItem_ListWidget(d->list, arg_Command(cmd));
599 if (item && !isEmpty_String(&item->command)) { 598 if (item && !isEmpty_String(&item->command)) {
600 setText_InputWidget(url, url_DocumentWidget(document_App())); 599 setText_InputWidget(url, url_DocumentWidget(document_App()));
601 setFocus_Widget(NULL);
602 setFlags_Widget(w, hidden_WidgetFlag, iTrue); 600 setFlags_Widget(w, hidden_WidgetFlag, iTrue);
603 setCursor_LookupWidget_(d, iInvalidPos); 601 setCursor_LookupWidget_(d, iInvalidPos);
604 postCommandString_App(&item->command); 602 postCommandString_App(&item->command);
603 postCommand_App("focus.set id:"); /* unfocus */
605 } 604 }
606 return iTrue; 605 return iTrue;
607 } 606 }