diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/lookupwidget.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/ui/lookupwidget.c b/src/ui/lookupwidget.c index b68d4a23..c711d61f 100644 --- a/src/ui/lookupwidget.c +++ b/src/ui/lookupwidget.c | |||
@@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
32 | #include "history.h" | 32 | #include "history.h" |
33 | #include "inputwidget.h" | 33 | #include "inputwidget.h" |
34 | #include "listwidget.h" | 34 | #include "listwidget.h" |
35 | #include "lang.h" | ||
35 | #include "lookup.h" | 36 | #include "lookup.h" |
36 | #include "util.h" | 37 | #include "util.h" |
37 | #include "visited.h" | 38 | #include "visited.h" |
@@ -132,7 +133,7 @@ static void draw_LookupItem_(iLookupItem *d, iPaint *p, iRect rect, const iListW | |||
132 | addX_I2(pos, width_Rect(iconRect) / 2 - iconSize.x / 2), | 133 | addX_I2(pos, width_Rect(iconRect) / 2 - iconSize.x / 2), |
133 | fg, | 134 | fg, |
134 | range_String(&d->icon)); | 135 | range_String(&d->icon)); |
135 | pos.x += width_Rect(iconRect) + gap_UI; | 136 | pos.x += width_Rect(iconRect) + gap_UI * 3 / 2; |
136 | } | 137 | } |
137 | drawRange_Text(d->font, pos, fg, range_String(&d->text)); | 138 | drawRange_Text(d->font, pos, fg, range_String(&d->text)); |
138 | } | 139 | } |
@@ -378,7 +379,7 @@ static iThreadResult worker_LookupWidget_(iThread *thread) { | |||
378 | iDefineObjectConstruction(LookupWidget) | 379 | iDefineObjectConstruction(LookupWidget) |
379 | 380 | ||
380 | static void updateMetrics_LookupWidget_(iLookupWidget *d) { | 381 | static void updateMetrics_LookupWidget_(iLookupWidget *d) { |
381 | setItemHeight_ListWidget(d->list, lineHeight_Text(uiContent_FontId) * 1.25f); | 382 | setItemHeight_ListWidget(d->list, lineHeight_Text(uiContent_FontId) * 1.333f); |
382 | } | 383 | } |
383 | 384 | ||
384 | void init_LookupWidget(iLookupWidget *d) { | 385 | void init_LookupWidget(iLookupWidget *d) { |
@@ -462,17 +463,17 @@ static int cmpPtr_LookupResult_(const void *p1, const void *p2) { | |||
462 | static const char *cstr_LookupResultType(enum iLookupResultType d) { | 463 | static const char *cstr_LookupResultType(enum iLookupResultType d) { |
463 | switch (d) { | 464 | switch (d) { |
464 | case bookmark_LookupResultType: | 465 | case bookmark_LookupResultType: |
465 | return "BOOKMARKS"; | 466 | return "heading.lookup.bookmarks"; |
466 | case feedEntry_LookupResultType: | 467 | case feedEntry_LookupResultType: |
467 | return "FEEDS"; | 468 | return "heading.lookup.feeds"; |
468 | case history_LookupResultType: | 469 | case history_LookupResultType: |
469 | return "HISTORY"; | 470 | return "heading.lookup.history"; |
470 | case content_LookupResultType: | 471 | case content_LookupResultType: |
471 | return "PAGE CONTENTS"; | 472 | return "heading.lookup.pagecontent"; |
472 | case identity_LookupResultType: | 473 | case identity_LookupResultType: |
473 | return "IDENTITIES"; | 474 | return "heading.lookup.identities"; |
474 | default: | 475 | default: |
475 | return "OTHER"; | 476 | return "heading.lookup.other"; |
476 | } | 477 | } |
477 | } | 478 | } |
478 | 479 | ||
@@ -496,7 +497,7 @@ static void presentResults_LookupWidget_(iLookupWidget *d) { | |||
496 | item->listItem.isSeparator = iTrue; | 497 | item->listItem.isSeparator = iTrue; |
497 | item->fg = uiHeading_ColorId; | 498 | item->fg = uiHeading_ColorId; |
498 | item->font = uiLabel_FontId; | 499 | item->font = uiLabel_FontId; |
499 | format_String(&item->text, "%s", cstr_LookupResultType(res->type)); | 500 | format_String(&item->text, "%s", cstr_Lang(cstr_LookupResultType(res->type))); |
500 | addItem_ListWidget(d->list, item); | 501 | addItem_ListWidget(d->list, item); |
501 | iRelease(item); | 502 | iRelease(item); |
502 | lastType = res->type; | 503 | lastType = res->type; |
@@ -515,9 +516,9 @@ static void presentResults_LookupWidget_(iLookupWidget *d) { | |||
515 | item->fg = uiText_ColorId; | 516 | item->fg = uiText_ColorId; |
516 | item->font = uiContent_FontId; | 517 | item->font = uiContent_FontId; |
517 | format_String(&item->text, | 518 | format_String(&item->text, |
518 | "%s \u2014 " uiTextStrong_ColorEscape "%s on this page", | 519 | "%s \u2014 " uiTextStrong_ColorEscape "%s", |
519 | cstr_String(&res->label), | 520 | cstr_String(&res->label), |
520 | isUsed ? "Stop using" : "Use"); | 521 | cstr_Lang(isUsed ? "ident.stopuse" : "ident.use")); |
521 | format_String(&item->command, "ident.sign%s ident:%s url:%s", | 522 | format_String(&item->command, "ident.sign%s ident:%s url:%s", |
522 | isUsed ? "out arg:0" : "in", cstr_String(&res->meta), cstr_String(docUrl)); | 523 | isUsed ? "out arg:0" : "in", cstr_String(&res->meta), cstr_String(docUrl)); |
523 | addItem_ListWidget(d->list, item); | 524 | addItem_ListWidget(d->list, item); |
@@ -528,8 +529,9 @@ static void presentResults_LookupWidget_(iLookupWidget *d) { | |||
528 | item->fg = uiText_ColorId; | 529 | item->fg = uiText_ColorId; |
529 | item->font = uiContent_FontId; | 530 | item->font = uiContent_FontId; |
530 | format_String(&item->text, | 531 | format_String(&item->text, |
531 | "%s \u2014 " uiTextStrong_ColorEscape "Stop using everywhere", | 532 | "%s \u2014 " uiTextStrong_ColorEscape "%s", |
532 | cstr_String(&res->label)); | 533 | cstr_String(&res->label), |
534 | cstr_Lang("ident.stopuse.all")); | ||
533 | format_String(&item->command, "ident.signout arg:1 ident:%s", cstr_String(&res->meta)); | 535 | format_String(&item->command, "ident.signout arg:1 ident:%s", cstr_String(&res->meta)); |
534 | addItem_ListWidget(d->list, item); | 536 | addItem_ListWidget(d->list, item); |
535 | iRelease(item); | 537 | iRelease(item); |
@@ -545,7 +547,7 @@ static void presentResults_LookupWidget_(iLookupWidget *d) { | |||
545 | switch (res->type) { | 547 | switch (res->type) { |
546 | case bookmark_LookupResultType: { | 548 | case bookmark_LookupResultType: { |
547 | item->fg = uiTextStrong_ColorId; | 549 | item->fg = uiTextStrong_ColorId; |
548 | item->font = uiLabel_FontId; | 550 | item->font = uiContent_FontId; |
549 | format_String(&item->text, | 551 | format_String(&item->text, |
550 | "%s %s\u2014 %s", | 552 | "%s %s\u2014 %s", |
551 | cstr_String(&res->label), | 553 | cstr_String(&res->label), |
@@ -556,7 +558,7 @@ static void presentResults_LookupWidget_(iLookupWidget *d) { | |||
556 | } | 558 | } |
557 | case feedEntry_LookupResultType: { | 559 | case feedEntry_LookupResultType: { |
558 | item->fg = uiTextStrong_ColorId; | 560 | item->fg = uiTextStrong_ColorId; |
559 | item->font = uiLabel_FontId; | 561 | item->font = uiContent_FontId; |
560 | format_String(&item->text, | 562 | format_String(&item->text, |
561 | "%s %s\u2014 %s", | 563 | "%s %s\u2014 %s", |
562 | cstr_String(&res->label), | 564 | cstr_String(&res->label), |