summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-26 13:06:33 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-26 13:06:33 +0200
commit8352bfea5bc081c4fd42aa8dc9ad31e3887af08d (patch)
treed0deae1d1e1294bffc074d24127b3cea64807de1
parentc4217cabfaf9f22854195f396c233a15967f3179 (diff)
LookupWidget: Missing strings; inconsistent fonts
Fonts used in the lookup results list used inconsistent sizes. Now they all use the "UI content" (medium) size. The result headings were not translated at all.
-rw-r--r--po/en.po24
-rw-r--r--res/lang/en.binbin15554 -> 15751 bytes
-rw-r--r--src/ui/lookupwidget.c32
3 files changed, 41 insertions, 15 deletions
diff --git a/po/en.po b/po/en.po
index 260013e0..b4385d34 100644
--- a/po/en.po
+++ b/po/en.po
@@ -639,6 +639,30 @@ msgstr "View Image"
639msgid "bookmark.title.blank" 639msgid "bookmark.title.blank"
640msgstr "Blank Page" 640msgstr "Blank Page"
641 641
642# Interpret as "Results from bookmarks..."
643msgid "heading.lookup.bookmarks"
644msgstr "BOOKMARKS"
645
646# Interpret as "Results from feeds..."
647msgid "heading.lookup.feeds"
648msgstr "FEEDS"
649
650# Interpret as "Results from history..."
651msgid "heading.lookup.history"
652msgstr "HISTORY"
653
654# Interpret as "Results from page content..."
655msgid "heading.lookup.pagecontent"
656msgstr "PAGE CONTENT"
657
658# Interpret as "Results from identitites..."
659msgid "heading.lookup.identities"
660msgstr "IDENTITIES"
661
662# Interpret as "Other results..."
663msgid "heading.lookup.other"
664msgstr "OTHER"
665
642msgid "heading.translate" 666msgid "heading.translate"
643msgstr "TRANSLATE PAGE" 667msgstr "TRANSLATE PAGE"
644 668
diff --git a/res/lang/en.bin b/res/lang/en.bin
index 719eead0..67ee046e 100644
--- a/res/lang/en.bin
+++ b/res/lang/en.bin
Binary files differ
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) {
378iDefineObjectConstruction(LookupWidget) 379iDefineObjectConstruction(LookupWidget)
379 380
380static void updateMetrics_LookupWidget_(iLookupWidget *d) { 381static 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
384void init_LookupWidget(iLookupWidget *d) { 385void init_LookupWidget(iLookupWidget *d) {
@@ -462,17 +463,17 @@ static int cmpPtr_LookupResult_(const void *p1, const void *p2) {
462static const char *cstr_LookupResultType(enum iLookupResultType d) { 463static 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),