From 202e2a95e8f93d520377a03d0bc2c0c44cce95ab Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 20 May 2021 14:31:09 +0300 Subject: Identity creation user experience Revised the New Identity dialog to hide the additional fields by default. Added a new option to select where the new identity will be active (current domain/page/nowhere). When the new identity is automatically activated, reload the URL used for activation. --- res/lang/fi.bin | Bin 20995 -> 21048 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 00039ebd..da1eeeb7 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ -- cgit v1.2.3 From 548034e167bd94d21ef9bcc2e6d2d8cbfaeb3d06 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 20 May 2021 21:26:39 +0300 Subject: DocumentWidget: Updated error page localization Added a new language string and blockquote styling for displaying the server's error message. IssueID #280 --- po/en.po | 3 +++ res/lang/de.bin | Bin 20358 -> 20410 bytes res/lang/en.bin | Bin 19106 -> 19158 bytes res/lang/es.bin | Bin 21074 -> 21126 bytes res/lang/fi.bin | Bin 21048 -> 21100 bytes res/lang/fr.bin | Bin 21564 -> 21616 bytes res/lang/ia.bin | Bin 21265 -> 21317 bytes res/lang/ie.bin | Bin 20436 -> 20488 bytes res/lang/pl.bin | Bin 22069 -> 22121 bytes res/lang/ru.bin | Bin 32147 -> 32199 bytes res/lang/sr.bin | Bin 30726 -> 30778 bytes res/lang/tok.bin | Bin 19470 -> 19522 bytes res/lang/zh_Hans.bin | Bin 18229 -> 18281 bytes res/lang/zh_Hant.bin | Bin 18303 -> 18355 bytes src/ui/documentwidget.c | 4 +++- 15 files changed, 6 insertions(+), 1 deletion(-) (limited to 'res/lang/fi.bin') diff --git a/po/en.po b/po/en.po index a89221d0..ef236ba8 100644 --- a/po/en.po +++ b/po/en.po @@ -597,6 +597,9 @@ msgstr "Unsubscribe" msgid "error.unsupported.suggestsave" msgstr "You can save it as a file to your Downloads folder: press %s or select \"%s\" from the menu." +msgid "error.server.msg" +msgstr "Server responded with the message:" + msgid "heading.pageinfo" msgstr "PAGE INFORMATION" diff --git a/res/lang/de.bin b/res/lang/de.bin index 4c2c53ea..e6b0de88 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index d6dfc691..dfc4039c 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index 4a9b3cb5..e8543648 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index da1eeeb7..478c20ff 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index 80ca94cf..dbad1af7 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index 51be909b..3c72164f 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 1a2223c8..b5bbe210 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 52ff43ae..ea38c272 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 4c015ac3..73db27d2 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 4f06505d..1333959d 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index f15c88fa..b3d94d03 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index f4b7ef15..9a470421 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index 154d991d..27f84c64 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 9b29c14f..452e5508 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1058,7 +1058,9 @@ static void showErrorPage_DocumentWidget_(iDocumentWidget *d, enum iGmStatusCode cstr_String(meta)); break; default: - appendFormat_String(src, "\n\nServer returned error: %s", cstr_String(meta)); + if (!isEmpty_String(meta)) { + appendFormat_String(src, "\n\n${error.server.msg}\n> %s", cstr_String(meta)); + } break; } } -- cgit v1.2.3 From 911a56b56c4f9ec5d0c4f1fd15189102bc97fcdb Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 21 May 2021 08:30:39 +0300 Subject: Added identity exporting Exporting an identity will display it in a new tab in PEM encoded format, where it can be saved or copied. IssueID #236 --- po/en.po | 4 +-- res/lang/de.bin | Bin 20410 -> 20430 bytes res/lang/en.bin | Bin 19158 -> 19153 bytes res/lang/es.bin | Bin 21126 -> 21146 bytes res/lang/fi.bin | Bin 21100 -> 21120 bytes res/lang/fr.bin | Bin 21616 -> 21636 bytes res/lang/ia.bin | Bin 21317 -> 21337 bytes res/lang/ie.bin | Bin 20488 -> 20508 bytes res/lang/pl.bin | Bin 22121 -> 22141 bytes res/lang/ru.bin | Bin 32199 -> 32219 bytes res/lang/sr.bin | Bin 30778 -> 30798 bytes res/lang/tok.bin | Bin 19522 -> 19542 bytes res/lang/zh_Hans.bin | Bin 18281 -> 18301 bytes res/lang/zh_Hant.bin | Bin 18355 -> 18375 bytes src/defs.h | 1 + src/gmcerts.c | 6 +++- src/gmutil.c | 3 ++ src/history.c | 5 +-- src/ui/documentwidget.c | 81 ++++++++++++++++++++++++++++++------------------ src/ui/documentwidget.h | 1 + src/ui/root.c | 5 +-- src/ui/sidebarwidget.c | 32 ++++++++++++++----- 22 files changed, 92 insertions(+), 46 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/po/en.po b/po/en.po index ef236ba8..440d074f 100644 --- a/po/en.po +++ b/po/en.po @@ -542,8 +542,8 @@ msgstr "Stop Using on This Page" msgid "ident.stopuse.all" msgstr "Stop Using Everywhere" -msgid "ident.showuse" -msgstr "Show Usage" +msgid "ident.export" +msgstr "Export" msgid "heading.ident.use" msgstr "IDENTITY USAGE" diff --git a/res/lang/de.bin b/res/lang/de.bin index e6b0de88..59bde344 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index dfc4039c..a8093411 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index e8543648..c582efdc 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 478c20ff..1e155087 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index dbad1af7..1a88c420 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index 3c72164f..c5800ec2 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index b5bbe210..0b4d5414 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index ea38c272..48f16b05 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 73db27d2..48a9c7d8 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 1333959d..111528b5 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index b3d94d03..d06b4356 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index 9a470421..27c269f6 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index 27f84c64..e78942bf 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/defs.h b/src/defs.h index 71719f7a..650f7e65 100644 --- a/src/defs.h +++ b/src/defs.h @@ -56,6 +56,7 @@ enum iFileVersion { #define whiteStar_Icon "\u2606" #define person_Icon "\U0001f464" #define download_Icon "\u2ba7" +#define export_Icon "\U0001f4e4" #define hourglass_Icon "\u231b" #define timer_Icon "\u23f2" #define home_Icon "\U0001f3e0" diff --git a/src/gmcerts.c b/src/gmcerts.c index bf0f3924..8577cf2b 100644 --- a/src/gmcerts.c +++ b/src/gmcerts.c @@ -201,7 +201,11 @@ void clearUse_GmIdentity(iGmIdentity *d) { } const iString *name_GmIdentity(const iGmIdentity *d) { - return collect_String(subject_TlsCertificate(d->cert)); + iString *name = collect_String(subject_TlsCertificate(d->cert)); + if (startsWith_String(name, "CN = ")) { + remove_Block(&name->chars, 0, 5); + } + return name; } iDefineTypeConstruction(GmIdentity) diff --git a/src/gmutil.c b/src/gmutil.c index 718a0a9a..2c9ba4eb 100644 --- a/src/gmutil.c +++ b/src/gmutil.c @@ -475,6 +475,9 @@ const char *mediaType_Path(const iString *path) { endsWithCase_String(path, ".hpp")) { return "text/plain"; } + else if (endsWithCase_String(path, ".pem")) { + return "application/x-pem-file"; + } else if (endsWithCase_String(path, ".zip")) { return "application/zip"; } diff --git a/src/history.c b/src/history.c index 9f4e415b..ed8e6725 100644 --- a/src/history.c +++ b/src/history.c @@ -243,7 +243,7 @@ void add_History(iHistory *d, const iString *url ){ iBool goBack_History(iHistory *d) { lock_Mutex(d->mtx); - if (d->recentPos < size_Array(&d->recent) - 1) { + if (!isEmpty_Array(&d->recent) && d->recentPos < size_Array(&d->recent) - 1) { d->recentPos++; postCommandf_Root(get_Root(), "open history:1 scroll:%f url:%s", @@ -279,7 +279,8 @@ iBool atLatest_History(const iHistory *d) { iBool atOldest_History(const iHistory *d) { iBool isOldest; - iGuardMutex(d->mtx, isOldest = (d->recentPos == size_Array(&d->recent) - 1)); + iGuardMutex(d->mtx, isOldest = (isEmpty_Array(&d->recent) || + d->recentPos == size_Array(&d->recent) - 1)); return isOldest; } diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 452e5508..337e2a03 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -976,7 +976,7 @@ iBool isPinned_DocumentWidget_(const iDocumentWidget *d) { static void showOrHidePinningIndicator_DocumentWidget_(iDocumentWidget *d) { iWidget *w = as_Widget(d); - showCollapsed_Widget(findChild_Widget(root_Widget(as_Widget(d)), "document.pinned"), + showCollapsed_Widget(findChild_Widget(root_Widget(w), "document.pinned"), isPinned_DocumentWidget_(d)); } @@ -1214,7 +1214,9 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse setRange_String(&d->sourceMime, param); } else if (startsWith_Rangecc(param, "text/") || - equal_Rangecc(param, "application/json")) { + equal_Rangecc(param, "application/json") || + equal_Rangecc(param, "application/x-pem-file") || + equal_Rangecc(param, "application/pem-certificate-chain")) { docFormat = plainText_GmDocumentFormat; setRange_String(&d->sourceMime, param); } @@ -1383,37 +1385,42 @@ static void cacheDocumentGlyphs_DocumentWidget_(const iDocumentWidget *d) { } } +static void updateFromCachedResponse_DocumentWidget_(iDocumentWidget *d, float normScrollY, + const iGmResponse *resp) { + setLinkNumberMode_DocumentWidget_(d, iFalse); + clear_ObjectList(d->media); + delete_Gempub(d->sourceGempub); + d->sourceGempub = NULL; + reset_GmDocument(d->doc); + resetWideRuns_DocumentWidget_(d); + d->state = fetching_RequestState; + /* Do the fetch. */ { + d->initNormScrollY = normScrollY; + /* Use the cached response data. */ + updateTrust_DocumentWidget_(d, resp); + d->sourceTime = resp->when; + d->sourceStatus = success_GmStatusCode; + format_String(&d->sourceHeader, cstr_Lang("pageinfo.header.cached")); + set_Block(&d->sourceContent, &resp->body); + updateDocument_DocumentWidget_(d, resp, iTrue); + postProcessRequestContent_DocumentWidget_(d, iTrue); + } + d->state = ready_RequestState; + init_Anim(&d->altTextOpacity, 0); + reset_SmoothScroll(&d->scrollY); + init_Anim(&d->scrollY.pos, d->initNormScrollY * size_GmDocument(d->doc).y); + updateSideOpacity_DocumentWidget_(d, iFalse); + updateVisible_DocumentWidget_(d); + moveSpan_SmoothScroll(&d->scrollY, 0, 0); /* clamp position to new max */ + cacheDocumentGlyphs_DocumentWidget_(d); + d->drawBufs->flags |= updateTimestampBuf_DrawBufsFlag | updateSideBuf_DrawBufsFlag; + postCommandf_Root(as_Widget(d)->root, "document.changed doc:%p url:%s", d, cstr_String(d->mod.url)); +} + static iBool updateFromHistory_DocumentWidget_(iDocumentWidget *d) { const iRecentUrl *recent = findUrl_History(d->mod.history, d->mod.url); if (recent && recent->cachedResponse) { - const iGmResponse *resp = recent->cachedResponse; - clear_ObjectList(d->media); - delete_Gempub(d->sourceGempub); - d->sourceGempub = NULL; - reset_GmDocument(d->doc); - resetWideRuns_DocumentWidget_(d); - d->state = fetching_RequestState; - /* Do the fetch. */ { - d->initNormScrollY = recent->normScrollY; - /* Use the cached response data. */ - updateTrust_DocumentWidget_(d, resp); - d->sourceTime = resp->when; - d->sourceStatus = success_GmStatusCode; - format_String(&d->sourceHeader, cstr_Lang("pageinfo.header.cached")); - set_Block(&d->sourceContent, &resp->body); - updateDocument_DocumentWidget_(d, resp, iTrue); - postProcessRequestContent_DocumentWidget_(d, iTrue); - } - d->state = ready_RequestState; - init_Anim(&d->altTextOpacity, 0); - reset_SmoothScroll(&d->scrollY); - init_Anim(&d->scrollY.pos, d->initNormScrollY * size_GmDocument(d->doc).y); - updateSideOpacity_DocumentWidget_(d, iFalse); - updateVisible_DocumentWidget_(d); - moveSpan_SmoothScroll(&d->scrollY, 0, 0); /* clamp position to new max */ - cacheDocumentGlyphs_DocumentWidget_(d); - d->drawBufs->flags |= updateTimestampBuf_DrawBufsFlag | updateSideBuf_DrawBufsFlag; - postCommandf_Root(as_Widget(d)->root, "document.changed doc:%p url:%s", d, cstr_String(d->mod.url)); + updateFromCachedResponse_DocumentWidget_(d, recent->normScrollY, recent->cachedResponse); return iTrue; } else if (!isEmpty_String(d->mod.url)) { @@ -4413,6 +4420,20 @@ void setUrlFromCache_DocumentWidget(iDocumentWidget *d, const iString *url, iBoo } } +void setUrlAndSource_DocumentWidget(iDocumentWidget *d, const iString *url, const iString *mime, + const iBlock *source) { + setLinkNumberMode_DocumentWidget_(d, iFalse); + set_String(d->mod.url, url); + parseUser_DocumentWidget_(d); + iGmResponse *resp = new_GmResponse(); + resp->statusCode = success_GmStatusCode; + initCurrent_Time(&resp->when); + set_String(&resp->meta, mime); + set_Block(&resp->body, source); + updateFromCachedResponse_DocumentWidget_(d, 0, resp); + delete_GmResponse(resp); +} + iDocumentWidget *duplicate_DocumentWidget(const iDocumentWidget *orig) { iDocumentWidget *d = new_DocumentWidget(); delete_History(d->mod.history); diff --git a/src/ui/documentwidget.h b/src/ui/documentwidget.h index 12603437..c038f981 100644 --- a/src/ui/documentwidget.h +++ b/src/ui/documentwidget.h @@ -47,6 +47,7 @@ int documentWidth_DocumentWidget (const iDocumentWidget *); void setUrl_DocumentWidget (iDocumentWidget *, const iString *url); void setUrlFromCache_DocumentWidget (iDocumentWidget *, const iString *url, iBool isFromCache); +void setUrlAndSource_DocumentWidget (iDocumentWidget *, const iString *url, const iString *mime, const iBlock *source); void setInitialScroll_DocumentWidget (iDocumentWidget *, float normScrollY); /* set after content received */ void setRedirectCount_DocumentWidget (iDocumentWidget *, int count); void setSource_DocumentWidget (iDocumentWidget *, const iString *sourceText); diff --git a/src/ui/root.c b/src/ui/root.c index 1698a5d4..9a089992 100644 --- a/src/ui/root.c +++ b/src/ui/root.c @@ -438,10 +438,7 @@ static void updateNavBarIdentity_(iWidget *navBar) { setFlags_Widget(tool, selected_WidgetFlag, ident != NULL); /* Update menu. */ iLabelWidget *idItem = child_Widget(findChild_Widget(button, "menu"), 0); - iString *subjectName = ident ? collect_String(subject_TlsCertificate(ident->cert)) : NULL; - if (subjectName && startsWith_String(subjectName, "CN = ")) { - remove_Block(&subjectName->chars, 0, 5); - } + const iString *subjectName = ident ? name_GmIdentity(ident) : NULL; setTextCStr_LabelWidget( idItem, subjectName ? format_CStr(uiTextAction_ColorEscape "%s", cstr_String(subjectName)) diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 556ae951..f9bdbf67 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -169,9 +169,10 @@ static void updateContextMenu_SidebarWidget_(iSidebarWidget *d) { { "---", 0, 0, NULL }, { edit_Icon " ${menu.edit.notes}", 0, 0, "ident.edit" }, { "${ident.fingerprint}", 0, 0, "ident.fingerprint" }, + { export_Icon " ${ident.export}", 0, 0, "ident.export" }, { "---", 0, 0, NULL }, { delete_Icon " " uiTextCaution_ColorEscape "${ident.delete}", 0, 0, "ident.delete confirm:1" }, - }, 8); + }, 9); /* Used URLs. */ const iGmIdentity *ident = menuIdentity_SidebarWidget_(d); if (ident) { @@ -440,10 +441,7 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { iSidebarItem *item = new_SidebarItem(); item->id = (uint32_t) index_PtrArrayConstIterator(&i); item->icon = 0x1f464; /* person */ - set_String(&item->label, collect_String(subject_TlsCertificate(ident->cert))); - if (startsWith_String(&item->label, "CN = ")) { - remove_Block(&item->label.chars, 0, 5); - } + set_String(&item->label, name_GmIdentity(ident)); iDate until; validUntil_TlsCertificate(ident->cert, &until); const iBool isActive = isUsedOn_GmIdentity(ident, tabUrl); @@ -480,11 +478,11 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { addActionButton_SidebarWidget_(d, add_Icon " ${sidebar.action.ident.new}", "ident.new", 0); addActionButton_SidebarWidget_(d, "${sidebar.action.ident.import}", "ident.import", 0); } + /* const iMenuItem menuItems[] = { { person_Icon " ${ident.use}", 0, 0, "ident.use arg:1" }, { close_Icon " ${ident.stopuse}", 0, 0, "ident.use arg:0" }, { close_Icon " ${ident.stopuse.all}", 0, 0, "ident.use arg:0 clear:1" }, - { "${ident.showuse}", 0, 0, "ident.showuse" }, { "---", 0, 0, NULL }, { edit_Icon " ${menu.edit.notes}", 0, 0, "ident.edit" }, { "${ident.fingerprint}", 0, 0, "ident.fingerprint" }, @@ -494,6 +492,7 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { { delete_Icon " " uiTextCaution_ColorEscape "${ident.delete}", 0, 0, "ident.delete confirm:1" }, }; d->menu = makeMenu_Widget(as_Widget(d), menuItems, iElemCount(menuItems)); + */ break; } default: @@ -792,6 +791,9 @@ static void itemClicked_SidebarWidget_(iSidebarWidget *d, iSidebarItem *item, si } case identities_SidebarMode: { d->contextItem = item; + if (d->contextIndex != iInvalidPos) { + invalidateItem_ListWidget(d->list, d->contextIndex); + } d->contextIndex = itemIndex; if (itemIndex < numItems_ListWidget(d->list)) { updateContextMenu_SidebarWidget_(d); @@ -1277,6 +1279,20 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) } return iTrue; } + else if (isCommand_Widget(w, ev, "ident.export")) { + const iGmIdentity *ident = menuIdentity_SidebarWidget_(d); + if (ident) { + iString *pem = collect_String(pem_TlsCertificate(ident->cert)); + append_String(pem, collect_String(privateKeyPem_TlsCertificate(ident->cert))); + iDocumentWidget *expTab = newTab_App(NULL, iTrue); + setUrlAndSource_DocumentWidget( + expTab, + collectNewFormat_String("file:%s.pem", cstr_String(name_GmIdentity(ident))), + collectNewCStr_String("text/plain"), + utf8_String(pem)); + } + return iTrue; + } else if (isCommand_Widget(w, ev, "ident.setnotes")) { iGmIdentity *ident = pointerLabel_Command(cmd, "ident"); if (ident) { @@ -1385,7 +1401,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) d->contextIndex = iInvalidPos; } } - if (d->menu && ev->type == SDL_MOUSEBUTTONDOWN) { + if ((d->menu || d->mode == identities_SidebarMode )&& ev->type == SDL_MOUSEBUTTONDOWN) { if (ev->button.button == SDL_BUTTON_RIGHT) { d->contextItem = NULL; if (!isVisible_Widget(d->menu)) { @@ -1457,11 +1473,13 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) (!cmdClear && cmdUse && isUsedOn_GmIdentity(ident, docUrl)) || (!cmdClear && !cmdUse && !isUsedOn_GmIdentity(ident, docUrl))); } + /* else if (equal_Command(cmdItem, "ident.showuse")) { setFlags_Widget(as_Widget(menuItem), disabled_WidgetFlag, !isUsed_GmIdentity(ident)); } + */ } } } -- cgit v1.2.3 From aa3690044d7096c20a6608a5c7fb0546d407da5a Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 21 May 2021 11:09:17 +0300 Subject: Keybindings for split view menu The split view keys now have keybindings. The default bindings for horizontal/vertical were changed to conform to Emacs (3/2). IssueID #278 --- po/en.po | 24 ++++++++++++++++++++++++ res/lang/de.bin | Bin 20430 -> 20844 bytes res/lang/en.bin | Bin 19153 -> 19567 bytes res/lang/es.bin | Bin 21146 -> 21560 bytes res/lang/fi.bin | Bin 21120 -> 21534 bytes res/lang/fr.bin | Bin 21636 -> 22050 bytes res/lang/ia.bin | Bin 21337 -> 21751 bytes res/lang/ie.bin | Bin 20508 -> 20922 bytes res/lang/pl.bin | Bin 22141 -> 22555 bytes res/lang/ru.bin | Bin 32219 -> 32633 bytes res/lang/sr.bin | Bin 30798 -> 31212 bytes res/lang/tok.bin | Bin 19542 -> 19956 bytes res/lang/zh_Hans.bin | Bin 18301 -> 18715 bytes res/lang/zh_Hant.bin | Bin 18375 -> 18789 bytes src/ui/keys.c | 12 ++++++++++++ src/ui/root.c | 4 ++-- 16 files changed, 38 insertions(+), 2 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/po/en.po b/po/en.po index 440d074f..8ea38b94 100644 --- a/po/en.po +++ b/po/en.po @@ -1375,6 +1375,30 @@ msgstr "Set view split mode" msgid "keys.split.next" msgstr "Switch focus to next split" +msgid "keys.split.menu.merge" +msgstr "Split view menu: Merge tabs" + +msgid "keys.split.menu.swap" +msgstr "Split view menu: Swap sides" + +msgid "keys.split.menu.horiz" +msgstr "Split view menu: Horizontal" + +msgid "keys.split.menu.horiz12" +msgstr "Split view menu: Horizontal 1:2" + +msgid "keys.split.menu.horiz21" +msgstr "Split view menu: Horizontal 2:1" + +msgid "keys.split.menu.vert" +msgstr "Split view menu: Vertical" + +msgid "keys.split.menu.vert12" +msgstr "Split view menu: Vertical 1:2" + +msgid "keys.split.menu.vert21" +msgstr "Split view menu: Vertical 2:1" + msgid "keys.hoverurl" msgstr "Toggle show URL on hover" diff --git a/res/lang/de.bin b/res/lang/de.bin index 59bde344..d42d4cfc 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index a8093411..4b7c1af3 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index c582efdc..815cc7b0 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 1e155087..6d1eaa78 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index 1a88c420..c18cbc99 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index c5800ec2..c47e3104 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 0b4d5414..974a1310 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 48f16b05..dd047ff9 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 48a9c7d8..ad2ad465 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 111528b5..9c512c31 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index d06b4356..24378b1c 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index 27c269f6..c1a0d4f7 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index e78942bf..adeaceeb 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/ui/keys.c b/src/ui/keys.c index 42d0d613..8af7867c 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c @@ -188,6 +188,7 @@ static void clear_Keys_(iKeys *d) { enum iBindFlag { argRepeat_BindFlag = iBit(1), argRelease_BindFlag = iBit(2), + noDirectTrigger_BindFlag = iBit(3), /* can only be triggered via LabelWidget */ }; /* TODO: This indirection could be used for localization, although all UI strings @@ -227,6 +228,14 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] = { 81, { "${keys.tab.next}", nextTab_KeyShortcut, "tabs.next" }, 0 }, { 90, { "${keys.split.menu}", SDLK_j, KMOD_PRIMARY, "splitmenu.open" }, 0 }, { 91, { "${keys.split.next}", SDLK_TAB, KMOD_CTRL, "keyroot.next", }, 0 }, + { 92, { "${keys.split.menu.merge}", '1', 0, "ui.split arg:0", }, noDirectTrigger_BindFlag }, + { 93, { "${keys.split.menu.swap}", SDLK_x, 0, "ui.split swap:1", }, noDirectTrigger_BindFlag }, + { 94, { "${keys.split.menu.horiz}", '3', 0, "ui.split arg:3 axis:0", }, noDirectTrigger_BindFlag }, + { 95, { "${keys.split.menu.horiz12}", SDLK_d, 0, "ui.split arg:1 axis:0", }, noDirectTrigger_BindFlag }, + { 96, { "${keys.split.menu.horiz21}", SDLK_e, 0, "ui.split arg:2 axis:0", }, noDirectTrigger_BindFlag }, + { 97, { "${keys.split.menu.vert}", '2', 0, "ui.split arg:3 axis:1", }, noDirectTrigger_BindFlag }, + { 98, { "${keys.split.menu.vert12}", SDLK_f, 0, "ui.split arg:1 axis:1", }, noDirectTrigger_BindFlag }, + { 99, { "${keys.split.menu.vert21}", SDLK_r, 0, "ui.split arg:2 axis:1", }, noDirectTrigger_BindFlag }, { 100,{ "${keys.hoverurl}", '/', KMOD_PRIMARY, "prefs.hoverlink.toggle" }, 0 }, /* The following cannot currently be changed (built-in duplicates). */ #if defined (iPlatformApple) @@ -432,6 +441,9 @@ iBool processEvent_Keys(const SDL_Event *ev) { if (ev->type == SDL_KEYDOWN || ev->type == SDL_KEYUP) { const iBinding *bind = find_Keys_(d, ev->key.keysym.sym, keyMods_Sym(ev->key.keysym.mod)); if (bind) { + if (bind->flags & noDirectTrigger_BindFlag) { + return iFalse; + } if (ev->type == SDL_KEYUP) { if (bind->flags & argRelease_BindFlag) { postCommandf_Root(root, "%s release:1", cstr_String(&bind->command)); diff --git a/src/ui/root.c b/src/ui/root.c index 9a089992..2a2130d8 100644 --- a/src/ui/root.c +++ b/src/ui/root.c @@ -1308,11 +1308,11 @@ void createUserInterface_Root(iRoot *d) { { "${menu.split.merge}", '1', 0, "ui.split arg:0" }, { "${menu.split.swap}", SDLK_x, 0, "ui.split swap:1" }, { "---", 0, 0, NULL }, - { "${menu.split.horizontal}", '2', 0, "ui.split arg:3 axis:0" }, + { "${menu.split.horizontal}", '3', 0, "ui.split arg:3 axis:0" }, { "${menu.split.horizontal} 1:2", SDLK_d, 0, "ui.split arg:1 axis:0" }, { "${menu.split.horizontal} 2:1", SDLK_e, 0, "ui.split arg:2 axis:0" }, { "---", 0, 0, NULL }, - { "${menu.split.vertical}", '3', 0, "ui.split arg:3 axis:1" }, + { "${menu.split.vertical}", '2', 0, "ui.split arg:3 axis:1" }, { "${menu.split.vertical} 1:2", SDLK_f, 0, "ui.split arg:1 axis:1" }, { "${menu.split.vertical} 2:1", SDLK_r, 0, "ui.split arg:2 axis:1" }, }, 10); -- cgit v1.2.3 From f53e6d34fbb8d2f2fb54aff8b746b1c5d06fe497 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 25 May 2021 18:25:40 +0300 Subject: Removed Symbola, replaced with other/new fonts Symbola's license is not permissive enough, so it has been removed. Added "Smol Emoji" with face emoticons and other UI characters for Lagrange. More symbols provided by Noto Sans Symbols and Noto Sans Symbols 2. The fallback fonts are now Iosevka, which has a pretty good coverage (although monospace), and the user's chosen TrueType font (which could still be a local copy of Symbola). Still a work in progress: some characters are missing. IssueID #283 --- CMakeLists.txt | 4 +- po/en.po | 3 + res/fonts/NotoSansSymbols-Regular.ttf | Bin 0 -> 168520 bytes res/fonts/NotoSansSymbols2-Regular.ttf | Bin 0 -> 583072 bytes res/fonts/SmolEmoji-Regular.ttf | Bin 0 -> 40384 bytes res/fonts/Symbola.ttf | Bin 3310696 -> 0 bytes res/lang/de.bin | Bin 20844 -> 20884 bytes res/lang/en.bin | Bin 19567 -> 19591 bytes res/lang/es.bin | Bin 21560 -> 21600 bytes res/lang/fi.bin | Bin 21534 -> 21574 bytes res/lang/fr.bin | Bin 22050 -> 22090 bytes res/lang/ia.bin | Bin 21751 -> 21791 bytes res/lang/ie.bin | Bin 20922 -> 20962 bytes res/lang/pl.bin | Bin 22555 -> 22595 bytes res/lang/ru.bin | Bin 32633 -> 32673 bytes res/lang/sr.bin | Bin 31212 -> 31252 bytes res/lang/tok.bin | Bin 19956 -> 19996 bytes res/lang/zh_Hans.bin | Bin 18715 -> 18755 bytes res/lang/zh_Hant.bin | Bin 18789 -> 18829 bytes src/app.c | 37 +++++++--- src/defs.h | 2 +- src/gmrequest.c | 4 +- src/prefs.c | 5 ++ src/prefs.h | 1 + src/ui/inputwidget.h | 5 ++ src/ui/keys.c | 8 +-- src/ui/root.c | 8 +-- src/ui/text.c | 127 +++++++++++++++++++++------------ src/ui/text.h | 16 +++-- src/ui/util.c | 2 + 30 files changed, 153 insertions(+), 69 deletions(-) create mode 100644 res/fonts/NotoSansSymbols-Regular.ttf create mode 100644 res/fonts/NotoSansSymbols2-Regular.ttf create mode 100644 res/fonts/SmolEmoji-Regular.ttf delete mode 100644 res/fonts/Symbola.ttf (limited to 'res/lang/fi.bin') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8429193a..f48d6fdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,17 +72,19 @@ set (EMBED_RESOURCES res/fonts/NotoSansArabicUI-Regular.ttf res/fonts/NotoSansJP-Regular.ttf res/fonts/NotoSansSC-Regular.ttf + res/fonts/NotoSansSymbols-Regular.ttf + res/fonts/NotoSansSymbols2-Regular.ttf res/fonts/Nunito-Bold.ttf res/fonts/Nunito-ExtraBold.ttf res/fonts/Nunito-ExtraLight.ttf res/fonts/Nunito-LightItalic.ttf res/fonts/Nunito-Regular.ttf + res/fonts/SmolEmoji-Regular.ttf res/fonts/SourceSans3-Bold.ttf res/fonts/SourceSans3-ExtraLight.ttf res/fonts/SourceSans3-It.ttf res/fonts/SourceSans3-Regular.ttf res/fonts/SourceSans3-Semibold.ttf - res/fonts/Symbola.ttf res/lang/de.bin res/lang/en.bin res/lang/es.bin diff --git a/po/en.po b/po/en.po index 7e9477ab..96f894d1 100644 --- a/po/en.po +++ b/po/en.po @@ -1210,6 +1210,9 @@ msgstr "On Dark" msgid "prefs.boldlink.light" msgstr "On Light" +msgid "prefs.userfont" +msgstr "Symbol font:" + msgid "prefs.linewidth" msgstr "Line width:" diff --git a/res/fonts/NotoSansSymbols-Regular.ttf b/res/fonts/NotoSansSymbols-Regular.ttf new file mode 100644 index 00000000..68847551 Binary files /dev/null and b/res/fonts/NotoSansSymbols-Regular.ttf differ diff --git a/res/fonts/NotoSansSymbols2-Regular.ttf b/res/fonts/NotoSansSymbols2-Regular.ttf new file mode 100644 index 00000000..79706435 Binary files /dev/null and b/res/fonts/NotoSansSymbols2-Regular.ttf differ diff --git a/res/fonts/SmolEmoji-Regular.ttf b/res/fonts/SmolEmoji-Regular.ttf new file mode 100644 index 00000000..de7cf07f Binary files /dev/null and b/res/fonts/SmolEmoji-Regular.ttf differ diff --git a/res/fonts/Symbola.ttf b/res/fonts/Symbola.ttf deleted file mode 100644 index f4bb1b7b..00000000 Binary files a/res/fonts/Symbola.ttf and /dev/null differ diff --git a/res/lang/de.bin b/res/lang/de.bin index d42d4cfc..41e5d121 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index 4b7c1af3..c3ede7c0 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index 815cc7b0..cdf6f4fe 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 6d1eaa78..83711d2f 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index c18cbc99..0dc78464 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index c47e3104..52af09ed 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 974a1310..ccf95b6e 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index dd047ff9..3f37675f 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index ad2ad465..124a0a88 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 9c512c31..062d8c2f 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index 24378b1c..ef0f2962 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index c1a0d4f7..95be4c4f 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index adeaceeb..f53edccc 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/app.c b/src/app.c index e22ee494..bb3afea6 100644 --- a/src/app.c +++ b/src/app.c @@ -204,6 +204,7 @@ static iString *serializePrefs_App_(const iApp *d) { appendFormat_String(str, "uiscale arg:%f\n", uiScale_Window(d->window)); appendFormat_String(str, "prefs.dialogtab arg:%d\n", d->prefs.dialogTab); appendFormat_String(str, "font.set arg:%d\n", d->prefs.font); + appendFormat_String(str, "font.user path:%s\n", cstr_String(&d->prefs.symbolFontPath)); appendFormat_String(str, "headingfont.set arg:%d\n", d->prefs.headingFont); appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent); appendFormat_String(str, "smoothscroll arg:%d\n", d->prefs.smoothScrolling); @@ -1555,24 +1556,25 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) { isSelected_Widget(findChild_Widget(d, "prefs.imageloadscroll"))); postCommandf_App("hidetoolbarscroll arg:%d", isSelected_Widget(findChild_Widget(d, "prefs.hidetoolbarscroll"))); - postCommandf_App("ostheme arg:%d", - isSelected_Widget(findChild_Widget(d, "prefs.ostheme"))); + postCommandf_App("ostheme arg:%d", isSelected_Widget(findChild_Widget(d, "prefs.ostheme"))); + postCommandf_App("font.user path:%s", + cstrText_InputWidget(findChild_Widget(d, "prefs.userfont"))); postCommandf_App("decodeurls arg:%d", isSelected_Widget(findChild_Widget(d, "prefs.decodeurls"))); postCommandf_App("searchurl address:%s", - cstr_String(text_InputWidget(findChild_Widget(d, "prefs.searchurl")))); + cstrText_InputWidget(findChild_Widget(d, "prefs.searchurl"))); postCommandf_App("cachesize.set arg:%d", - toInt_String(text_InputWidget(findChild_Widget(d, "prefs.cachesize")))); + toInt_String(text_InputWidget(findChild_Widget(d, "prefs.cachesize")))); postCommandf_App("ca.file path:%s", - cstr_String(text_InputWidget(findChild_Widget(d, "prefs.ca.file")))); + cstrText_InputWidget(findChild_Widget(d, "prefs.ca.file"))); postCommandf_App("ca.path path:%s", - cstr_String(text_InputWidget(findChild_Widget(d, "prefs.ca.path")))); + cstrText_InputWidget(findChild_Widget(d, "prefs.ca.path"))); postCommandf_App("proxy.gemini address:%s", - cstr_String(text_InputWidget(findChild_Widget(d, "prefs.proxy.gemini")))); + cstrText_InputWidget(findChild_Widget(d, "prefs.proxy.gemini"))); postCommandf_App("proxy.gopher address:%s", - cstr_String(text_InputWidget(findChild_Widget(d, "prefs.proxy.gopher")))); + cstrText_InputWidget(findChild_Widget(d, "prefs.proxy.gopher"))); postCommandf_App("proxy.http address:%s", - cstr_String(text_InputWidget(findChild_Widget(d, "prefs.proxy.http")))); + cstrText_InputWidget(findChild_Widget(d, "prefs.proxy.http"))); const iWidget *tabs = findChild_Widget(d, "prefs.tabs"); if (tabs) { postCommandf_App("prefs.dialogtab arg:%u", @@ -1892,6 +1894,22 @@ iBool handleCommand_App(const char *cmd) { resetFonts_Text(); return iTrue; } + else if (equal_Command(cmd, "font.user")) { + const char *path = suffixPtr_Command(cmd, "path"); + if (cmp_String(&d->prefs.symbolFontPath, path)) { + if (!isFrozen) { + setFreezeDraw_Window(get_Window(), iTrue); + } + setCStr_String(&d->prefs.symbolFontPath, path); + loadUserFonts_Text(); + resetFonts_Text(); + if (!isFrozen) { + postCommand_App("font.changed"); + postCommand_App("window.unfreeze"); + } + } + return iTrue; + } else if (equal_Command(cmd, "font.set")) { if (!isFrozen) { setFreezeDraw_Window(get_Window(), iTrue); @@ -2332,6 +2350,7 @@ iBool handleCommand_App(const char *cmd) { setToggle_Widget(findChild_Widget(dlg, "prefs.archive.openindex"), d->prefs.openArchiveIndexPages); setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme); setToggle_Widget(findChild_Widget(dlg, "prefs.customframe"), d->prefs.customFrame); + setText_InputWidget(findChild_Widget(dlg, "prefs.userfont"), &d->prefs.symbolFontPath); updatePrefsPinSplitButtons_(dlg, d->prefs.pinSplit); updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage)); setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize); diff --git a/src/defs.h b/src/defs.h index 650f7e65..c19dd50e 100644 --- a/src/defs.h +++ b/src/defs.h @@ -62,7 +62,7 @@ enum iFileVersion { #define home_Icon "\U0001f3e0" #define edit_Icon "\u270e" #define delete_Icon "\u232b" -#define copy_Icon "\u2bba" +#define copy_Icon "\u2398" //"\u2bba" #define check_Icon "\u2714" #define ballotCheck_Icon "\U0001f5f9" #define inbox_Icon "\U0001f4e5" diff --git a/src/gmrequest.c b/src/gmrequest.c index 3dd92eec..1325c025 100644 --- a/src/gmrequest.c +++ b/src/gmrequest.c @@ -346,6 +346,7 @@ static const iBlock *replaceVariables_(const iBlock *block) { if (equal_Rangecc(name, "APP_VERSION")) { repl = range_CStr(LAGRANGE_APP_VERSION); } +#if 0 else if (startsWith_Rangecc(name, "BT:")) { /* block text */ repl = range_String(collect_String(renderBlockChars_Text( &fontFiraSansRegular_Embedded, @@ -356,12 +357,13 @@ static const iBlock *replaceVariables_(const iBlock *block) { } else if (startsWith_Rangecc(name, "ST:")) { /* shaded text */ repl = range_String(collect_String(renderBlockChars_Text( - &fontSymbola_Embedded, + &fontSmolEmojiRegular_Embedded, 20, shading_TextBlockMode, &(iString){ iBlockLiteral( name.start + 3, size_Range(&name) - 3, size_Range(&name) - 3) }))); } +#endif else if (equal_Rangecc(name, "ALT")) { #if defined (iPlatformApple) repl = range_CStr("\u2325"); diff --git a/src/prefs.c b/src/prefs.c index 96fa3c59..b29b33b5 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -68,6 +68,7 @@ void init_Prefs(iPrefs *d) { init_String(&d->httpProxy); init_String(&d->downloadDir); init_String(&d->searchUrl); + init_String(&d->symbolFontPath); /* TODO: Add some platform-specific common locations? */ if (fileExistsCStr_FileInfo("/etc/ssl/cert.pem")) { /* macOS */ setCStr_String(&d->caFile, "/etc/ssl/cert.pem"); @@ -75,9 +76,13 @@ void init_Prefs(iPrefs *d) { if (fileExistsCStr_FileInfo("/etc/ssl/certs")) { setCStr_String(&d->caPath, "/etc/ssl/certs"); } +#if defined (iPlatformAppleDesktop) + setCStr_String(&d->symbolFontPath, "/System/Library/Fonts/Apple Symbols.ttf"); +#endif } void deinit_Prefs(iPrefs *d) { + deinit_String(&d->symbolFontPath); deinit_String(&d->searchUrl); deinit_String(&d->geminiProxy); deinit_String(&d->gopherProxy); diff --git a/src/prefs.h b/src/prefs.h index 5c01ebda..7185c8f9 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -70,6 +70,7 @@ struct Impl_Prefs { iString gopherProxy; iString httpProxy; /* Style */ + iString symbolFontPath; enum iTextFont font; enum iTextFont headingFont; iBool monospaceGemini; diff --git a/src/ui/inputwidget.h b/src/ui/inputwidget.h index cb32a29c..5c39aae0 100644 --- a/src/ui/inputwidget.h +++ b/src/ui/inputwidget.h @@ -63,6 +63,11 @@ void setNotifyEdits_InputWidget (iInputWidget *, iBool notifyEdits); void setEatEscape_InputWidget (iInputWidget *, iBool eatEscape); const iString * text_InputWidget (const iInputWidget *); + +iLocalDef const char *cstrText_InputWidget(const iInputWidget *d) { + return cstr_String(text_InputWidget(d)); +} + iInputWidgetContentPadding contentPadding_InputWidget (const iInputWidget *); diff --git a/src/ui/keys.c b/src/ui/keys.c index 87a5fb88..17cc0e72 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c @@ -311,7 +311,10 @@ static iBinding *findCommand_Keys_(iKeys *d, const char *command) { static void updateLookup_Keys_(iKeys *d) { clear_PtrSet(&d->lookup); iConstForEach(Array, i, &d->bindings) { - insert_PtrSet(&d->lookup, i.value); + const iBinding *bind = i.value; + if (~bind->flags & noDirectTrigger_BindFlag) { + insert_PtrSet(&d->lookup, i.value); + } } } @@ -442,9 +445,6 @@ iBool processEvent_Keys(const SDL_Event *ev) { if (ev->type == SDL_KEYDOWN || ev->type == SDL_KEYUP) { const iBinding *bind = find_Keys_(d, ev->key.keysym.sym, keyMods_Sym(ev->key.keysym.mod)); if (bind) { - if (bind->flags & noDirectTrigger_BindFlag) { - return iFalse; - } if (ev->type == SDL_KEYUP) { if (bind->flags & argRelease_BindFlag) { postCommandf_Root(root, "%s release:1", cstr_String(&bind->command)); diff --git a/src/ui/root.c b/src/ui/root.c index 7a409a75..49925856 100644 --- a/src/ui/root.c +++ b/src/ui/root.c @@ -156,10 +156,10 @@ static const char *pageMenuCStr_ = midEllipsis_Icon; /* TODO: A preference for these, maybe? */ static const char *stopSeqCStr_[] = { /* Corners */ - uiTextCaution_ColorEscape "\U0000230c", - uiTextCaution_ColorEscape "\U0000230d", - uiTextCaution_ColorEscape "\U0000230f", - uiTextCaution_ColorEscape "\U0000230e", + uiTextCaution_ColorEscape "\U0000231c", + uiTextCaution_ColorEscape "\U0000231d", + uiTextCaution_ColorEscape "\U0000231f", + uiTextCaution_ColorEscape "\U0000231e", #if 0 /* Rotating arrow */ uiTextCaution_ColorEscape "\U00002b62", diff --git a/src/ui/text.c b/src/ui/text.c index b0c4f557..0e6a6d32 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include +#include #include #include #include @@ -124,10 +125,6 @@ struct Impl_Font { iBool isMonospaced; iBool manualKernOnly; enum iFontSize sizeId; /* used to look up different fonts of matching size */ -// enum iFontId -// enum iFontId japaneseFont; /* font to use for Japanese glyphs */ -// enum iFontId chineseFont; /* font to use for Simplified Chinese glyphs */ -// enum iFontId koreanFont; /* font to use for Korean glyphs */ uint32_t indexTable[128 - 32]; /* quick ASCII lookup */ }; @@ -155,13 +152,12 @@ static void init_Font(iFont *d, const iBlock *data, int height, float scale, d->xScale *= floorf(advance) / advance; } } - d->vertOffset = height * (1.0f - scale) / 2; - d->baseline = ascent * d->yScale; - d->sizeId = sizeId; -// d->symbolsFont = symbolsFont; -// d->japaneseFont = regularJapanese_FontId; -// d->chineseFont = regularChinese_FontId; -// d->koreanFont = regularKorean_FontId; + d->baseline = ascent * d->yScale; + d->vertOffset = height * (1.0f - scale) / 2; + if (scale > 1.0f) { + d->vertOffset /= 2; /* Tweak for Noto Sans Symbols */ + } + d->sizeId = sizeId; memset(d->indexTable, 0xff, sizeof(d->indexTable)); } @@ -215,7 +211,8 @@ struct Impl_Text { iRegExp * ansiEscape; }; -static iText text_; +static iText text_; +static iBlock *userFont_; static void initFonts_Text_(iText *d) { const float textSize = fontSize_UI * d->contentFontSize; @@ -321,27 +318,31 @@ static void initFonts_Text_(iText *d) { { &fontIosevkaTermExtended_Embedded, smallMonoSize, 1.0f, contentMonoSmall_FontSize }, { &fontIosevkaTermExtended_Embedded, monoSize, 1.0f, contentMono_FontSize }, /* extra content fonts */ - { &fontSourceSans3Regular_Embedded, textSize, scaling, contentRegular_FontSize }, - { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, contentRegular_FontSize }, + { &fontSourceSans3Regular_Embedded, textSize, scaling, contentRegular_FontSize }, +// { &fontIosevkaTermExtended_Embedded, textSize, 0.866f, contentRegular_FontSize }, /* symbols and scripts */ -#define DEFINE_FONT_SET(data) \ - { &data, uiSize, 1.0f, uiNormal_FontSize }, \ - { &data, uiSize * 1.125f, 1.0f, uiMedium_FontSize }, \ - { &data, uiSize * 1.333f, 1.0f, uiBig_FontSize }, \ - { &data, uiSize * 1.666f, 1.0f, uiLarge_FontSize }, \ - { &data, textSize, 1.0f, contentRegular_FontSize }, \ - { &data, textSize * 1.200f, 1.0f, contentMedium_FontSize }, \ - { &data, textSize * 1.333f, 1.0f, contentBig_FontSize }, \ - { &data, textSize * 1.666f, 1.0f, contentLarge_FontSize }, \ - { &data, textSize * 2.000f, 1.0f, contentHuge_FontSize }, \ - { &data, smallMonoSize, 1.0f, contentMonoSmall_FontSize }, \ - { &data, monoSize, 1.0f, contentMono_FontSize } - DEFINE_FONT_SET(fontSymbola_Embedded), - DEFINE_FONT_SET(fontNotoEmojiRegular_Embedded), - DEFINE_FONT_SET(fontNotoSansJPRegular_Embedded), - DEFINE_FONT_SET(fontNotoSansSCRegular_Embedded), - DEFINE_FONT_SET(fontNanumGothicRegular_Embedded), /* TODO: should use Noto Sans here, too */ - DEFINE_FONT_SET(fontNotoSansArabicUIRegular_Embedded), +#define DEFINE_FONT_SET(data, glyphScale) \ + { (data), uiSize, glyphScale, uiNormal_FontSize }, \ + { (data), uiSize * 1.125f, glyphScale, uiMedium_FontSize }, \ + { (data), uiSize * 1.333f, glyphScale, uiBig_FontSize }, \ + { (data), uiSize * 1.666f, glyphScale, uiLarge_FontSize }, \ + { (data), textSize, glyphScale, contentRegular_FontSize }, \ + { (data), textSize * 1.200f, glyphScale, contentMedium_FontSize }, \ + { (data), textSize * 1.333f, glyphScale, contentBig_FontSize }, \ + { (data), textSize * 1.666f, glyphScale, contentLarge_FontSize }, \ + { (data), textSize * 2.000f, glyphScale, contentHuge_FontSize }, \ + { (data), smallMonoSize, glyphScale, contentMonoSmall_FontSize }, \ + { (data), monoSize, glyphScale, contentMono_FontSize } + DEFINE_FONT_SET(userFont_ ? userFont_ : &fontIosevkaTermExtended_Embedded, 1.0f), + DEFINE_FONT_SET(&fontIosevkaTermExtended_Embedded, 0.866f), + DEFINE_FONT_SET(&fontNotoSansSymbolsRegular_Embedded, 1.45f), + DEFINE_FONT_SET(&fontNotoSansSymbols2Regular_Embedded, 1.45f), + DEFINE_FONT_SET(&fontSmolEmojiRegular_Embedded, 1.0f), + DEFINE_FONT_SET(&fontNotoEmojiRegular_Embedded, 1.0f), + DEFINE_FONT_SET(&fontNotoSansJPRegular_Embedded, 1.0f), + DEFINE_FONT_SET(&fontNotoSansSCRegular_Embedded, 1.0f), + DEFINE_FONT_SET(&fontNanumGothicRegular_Embedded, 1.0f), /* TODO: should use Noto Sans here, too */ + DEFINE_FONT_SET(&fontNotoSansArabicUIRegular_Embedded, 1.0f), }; iForIndices(i, fontData) { iFont *font = &d->fonts[i]; @@ -401,8 +402,28 @@ static void deinitCache_Text_(iText *d) { SDL_DestroyTexture(d->cache); } +void loadUserFonts_Text(void) { + if (userFont_) { + delete_Block(userFont_); + userFont_ = NULL; + } + /* Load the system font. */ + const iPrefs *prefs = prefs_App(); + if (!isEmpty_String(&prefs->symbolFontPath)) { + iFile *f = new_File(&prefs->symbolFontPath); + if (open_File(f, readOnly_FileMode)) { + userFont_ = readAll_File(f); + } + else { + fprintf(stderr, "[Text] failed to open: %s\n", cstr_String(&prefs->symbolFontPath)); + } + iRelease(f); + } +} + void init_Text(SDL_Renderer *render) { iText *d = &text_; + loadUserFonts_Text(); d->contentFont = nunito_TextFont; d->headingFont = nunito_TextFont; d->contentFontSize = contentScale_Text_; @@ -542,14 +563,27 @@ static void allocate_Font_(iFont *d, iGlyph *glyph, int hoff) { } iLocalDef iFont *characterFont_Font_(iFont *d, iChar ch, uint32_t *glyphIndex) { + /* Smol Emoji overrides all other fonts. */ + if (ch != 0x20) { + iFont *smol = font_Text_(smolEmoji_FontId + d->sizeId); + if (smol != d && (*glyphIndex = glyphIndex_Font_(smol, ch)) != 0) { + return smol; + } + } if ((*glyphIndex = glyphIndex_Font_(d, ch)) != 0) { return d; } - /* Not defined in current font, try Noto Emoji (for selected characters). */ - if ((ch >= 0x1f300 && ch < 0x1f600) || (ch >= 0x1f680 && ch <= 0x1f6c5)) { - iFont *emoji = font_Text_(emoji_FontId + d->sizeId); - if (emoji != d && (*glyphIndex = glyphIndex_Font_(emoji, ch)) != 0) { - return emoji; + const int fallbacks[] = { + smolEmoji_FontId, + notoEmoji_FontId, + symbols2_FontId, + symbols_FontId + }; + /* First fallback is Smol Emoji. */ + iForIndices(i, fallbacks) { + iFont *fallback = font_Text_(fallbacks[i] + d->sizeId); + if (fallback != d && (*glyphIndex = glyphIndex_Font_(fallback, ch)) != 0) { + return fallback; } } /* Try Simplified Chinese. */ @@ -588,13 +622,18 @@ iLocalDef iFont *characterFont_Font_(iFont *d, iChar ch, uint32_t *glyphIndex) { return d; } #endif - /* Fall back to Symbola for anything else. */ - iFont *font = font_Text_(symbols_FontId + d->sizeId); - *glyphIndex = glyphIndex_Font_(font, ch); -// if (!*glyphIndex) { -// fprintf(stderr, "failed to find %08x (%lc)\n", ch, ch); fflush(stderr); -// } - return font; + /* User's symbols font. */ { + iFont *sys = font_Text_(userSymbols_FontId + d->sizeId); + if (sys != d && (*glyphIndex = glyphIndex_Font_(sys, ch)) != 0) { + return sys; + } + } +// iFont *font = font_Text_(iosevka_FontId + d->sizeId); +// *glyphIndex = glyphIndex_Font_(font, ch); + if (!*glyphIndex) { + fprintf(stderr, "failed to find %08x (%lc)\n", ch, (int)ch); fflush(stderr); + } + return d; } static iGlyph *glyph_Font_(iFont *d, iChar ch) { diff --git a/src/ui/text.h b/src/ui/text.h index 044ddd32..1bb60e8b 100644 --- a/src/ui/text.h +++ b/src/ui/text.h @@ -68,11 +68,14 @@ enum iFontId { monospace_FontId, /* extra content fonts */ defaultContentSized_FontId, /* UI font but sized to regular_FontId */ - regularMonospace_FontId, /* symbols and scripts */ - symbols_FontId, - emoji_FontId = symbols_FontId + max_FontSize, - japanese_FontId = emoji_FontId + max_FontSize, + userSymbols_FontId, + iosevka_FontId = userSymbols_FontId + max_FontSize, + symbols_FontId = iosevka_FontId + max_FontSize, + symbols2_FontId = symbols_FontId + max_FontSize, + smolEmoji_FontId = symbols2_FontId + max_FontSize, + notoEmoji_FontId = smolEmoji_FontId + max_FontSize, + japanese_FontId = notoEmoji_FontId + max_FontSize, chineseSimplified_FontId = japanese_FontId + max_FontSize, korean_FontId = chineseSimplified_FontId + max_FontSize, arabic_FontId = korean_FontId + max_FontSize, @@ -91,7 +94,7 @@ enum iFontId { uiInput_FontId = defaultMedium_FontId, uiContent_FontId = defaultMedium_FontId, uiContentBold_FontId = defaultMediumBold_FontId, - uiContentSymbols_FontId = symbols_FontId + uiMedium_FontSize, + uiContentSymbols_FontId = symbols_FontId + uiMedium_FontSize, /* Document fonts: */ paragraph_FontId = regular_FontId, firstParagraph_FontId = medium_FontId, @@ -102,6 +105,7 @@ enum iFontId { heading2_FontId = largeBold_FontId, heading3_FontId = big_FontId, banner_FontId = largeLight_FontId, + regularMonospace_FontId = iosevka_FontId + contentRegular_FontSize }; iLocalDef iBool isJapanese_FontId(enum iFontId id) { @@ -124,6 +128,8 @@ extern int gap_Text; /* affected by content font size */ void init_Text (SDL_Renderer *); void deinit_Text (void); +void loadUserFonts_Text (void); /* based on Prefs */ + void setContentFont_Text (enum iTextFont font); void setHeadingFont_Text (enum iTextFont font); void setContentFontSize_Text (float fontSizeFactor); /* affects all except `default*` fonts */ diff --git a/src/ui/util.c b/src/ui/util.c index 6c87ba26..977eba9d 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -1525,6 +1525,7 @@ void updatePreferencesLayout_Widget(iWidget *prefs) { static const char *inputIds[] = { "prefs.searchurl", "prefs.downloads", + "prefs.userfont", "prefs.ca.file", "prefs.ca.path", "prefs.proxy.gemini", @@ -1786,6 +1787,7 @@ iWidget *makePreferences_Widget(void) { updateSize_LabelWidget((iLabelWidget *) tog); } addChildFlags_Widget(values, iClob(boldLink), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); + addPrefsInputWithHeading_(headings, values, "prefs.userfont", iClob(new_InputWidget(0))); } makeTwoColumnHeading_("${heading.prefs.paragraph}", headings, values); addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.linewidth}"))); -- cgit v1.2.3 From 3f06ba4868c974e86d616dc3049c2e5f5402e83f Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 28 May 2021 08:40:56 +0300 Subject: Lang: Translations for New Identity scopes --- po/en.po | 9 +++++++++ res/lang/de.bin | Bin 20884 -> 20997 bytes res/lang/en.bin | Bin 19591 -> 19702 bytes res/lang/es.bin | Bin 21600 -> 22044 bytes res/lang/fi.bin | Bin 21574 -> 21685 bytes res/lang/fr.bin | Bin 22090 -> 22609 bytes res/lang/ia.bin | Bin 21791 -> 21907 bytes res/lang/ie.bin | Bin 20962 -> 21075 bytes res/lang/pl.bin | Bin 22595 -> 22713 bytes res/lang/ru.bin | Bin 32673 -> 32794 bytes res/lang/sr.bin | Bin 31252 -> 31369 bytes res/lang/tok.bin | Bin 19996 -> 20112 bytes res/lang/zh_Hans.bin | Bin 18755 -> 18866 bytes res/lang/zh_Hant.bin | Bin 18829 -> 19051 bytes src/ui/util.c | 6 +++--- 15 files changed, 12 insertions(+), 3 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/po/en.po b/po/en.po index 96f894d1..e32ba5c1 100644 --- a/po/en.po +++ b/po/en.po @@ -936,6 +936,15 @@ msgstr "not saved to disk" msgid "dlg.newident.scope" msgstr "Use on:" +msgid "dlg.newident.scope.domain" +msgstr "Current Domain" + +msgid "dlg.newident.scope.page" +msgstr "Current Page" + +msgid "dlg.newident.scope.none" +msgstr "Not Used" + msgid "dlg.newident.email" msgstr "Email:" diff --git a/res/lang/de.bin b/res/lang/de.bin index 41e5d121..a70f5f62 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index c3ede7c0..19650c34 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index cdf6f4fe..e4d45e79 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 83711d2f..06c815fa 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index 0dc78464..e39abdfa 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index 52af09ed..0c0797eb 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index ccf95b6e..9aa66449 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 3f37675f..6df22643 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 124a0a88..c6ea9e0a 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 062d8c2f..a770ac48 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index ef0f2962..6335c836 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index 95be4c4f..8490d0d6 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index f53edccc..b39feba1 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/ui/util.c b/src/ui/util.c index 977eba9d..edac214f 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -2064,9 +2064,9 @@ iWidget *makeIdentityCreation_Widget(void) { /* Where will the new identity be active on? */ { addChild_Widget(headings, iClob(makeHeading_Widget("${dlg.newident.scope}"))); const iMenuItem items[] = { - { "Current Domain", 0, 0, "ident.scope arg:0" }, - { "Current Page", 0, 0, "ident.scope arg:1" }, - { "Not Used", 0, 0, "ident.scope arg:2" }, + { "${dlg.newident.scope.domain}", 0, 0, "ident.scope arg:0" }, + { "${dlg.newident.scope.page}", 0, 0, "ident.scope arg:1" }, + { "${dlg.newident.scope.none}", 0, 0, "ident.scope arg:2" }, }; setId_Widget(addChild_Widget(values, iClob(makeMenuButton_LabelWidget( -- cgit v1.2.3 From 23e31410556e9b4e22c3742b2b137bd5d96abac8 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 29 May 2021 07:17:45 +0300 Subject: Gempub: Fixed glitches in DocumentWidget --- po/en.po | 3 +++ res/lang/de.bin | Bin 20997 -> 21054 bytes res/lang/en.bin | Bin 19702 -> 19759 bytes res/lang/es.bin | Bin 22044 -> 22101 bytes res/lang/fi.bin | Bin 21685 -> 21742 bytes res/lang/fr.bin | Bin 22609 -> 22666 bytes res/lang/ia.bin | Bin 21907 -> 21964 bytes res/lang/ie.bin | Bin 21075 -> 21132 bytes res/lang/pl.bin | Bin 22713 -> 22770 bytes res/lang/ru.bin | Bin 32794 -> 32851 bytes res/lang/sr.bin | Bin 31369 -> 31426 bytes res/lang/tok.bin | Bin 20112 -> 20169 bytes res/lang/zh_Hans.bin | Bin 18866 -> 18923 bytes res/lang/zh_Hant.bin | Bin 19051 -> 19108 bytes src/gempub.c | 19 +++++++------ src/gempub.h | 1 + src/ui/documentwidget.c | 70 +++++++++++++++++++++++++++++++++++------------- 17 files changed, 67 insertions(+), 26 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/po/en.po b/po/en.po index e32ba5c1..bbca83e5 100644 --- a/po/en.po +++ b/po/en.po @@ -191,6 +191,9 @@ msgstr "Save to Files" msgid "menu.save.downloads" msgstr "Save to Downloads" +msgid "menu.save.downloads.open" +msgstr "Save to Downloads and Open File" + msgid "menu.sidebar" msgstr "Toggle Sidebar" diff --git a/res/lang/de.bin b/res/lang/de.bin index a70f5f62..45260c31 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index 19650c34..728c7ff8 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index e4d45e79..d6cdd974 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 06c815fa..b66badcb 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index e39abdfa..232338c9 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index 0c0797eb..e460faf7 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 9aa66449..87e3c0e5 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 6df22643..0c021408 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index c6ea9e0a..17df17a8 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index a770ac48..74f897cb 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index 6335c836..4d8259b3 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index 8490d0d6..c5b6cede 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index b39feba1..56d7643d 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/gempub.c b/src/gempub.c index f3021add..1f5d58ce 100644 --- a/src/gempub.c +++ b/src/gempub.c @@ -94,6 +94,9 @@ static void parseNavigationLinks_Gempub_(const iGempub *d) { set_String(&link.url, absoluteUrl_String(url_GmRequest(index), collectNewRange_String(url))); setRange_String(&link.label, capturedRange_RegExpMatch(&m, 2)); trim_String(&link.label); + if (isEmpty_String(&link.label)) { + setRange_String(&link.label, url); + } pushBack_Array(d->navLinks, &link); } iEndCollect(); @@ -280,7 +283,7 @@ static void appendProperty_Gempub_(const iGempub *d, const char *label, } } -static iBool isRemote_Gempub_(const iGempub *d) { +iBool isRemote_Gempub(const iGempub *d) { return !equalCase_Rangecc(urlScheme_String(&d->baseUrl), "file"); } @@ -295,7 +298,7 @@ iString *coverPageSource_Gempub(const iGempub *d) { } appendCStr_String(out, "\n"); appendProperty_Gempub_(d, "${gempub.meta.author}:", author_GempubProperty, out); - if (!isRemote_Gempub_(d)) { + if (!isRemote_Gempub(d)) { appendFormat_String(out, "\n=> %s " book_Icon " ${gempub.cover.view}\n", cstr_String(indexPageUrl_Gempub(d))); if (hasProperty_Gempub_(d, cover_GempubProperty)) { @@ -306,12 +309,12 @@ iString *coverPageSource_Gempub(const iGempub *d) { else { iString *key = collectNew_String(); /* TODO: add a helper for this */ toString_Sym(SDLK_s, KMOD_PRIMARY, key); - appendCStr_String(out, "\n${gempub.cover.viewlocal} "); - appendFormat_String(out, - cstr_Lang("error.unsupported.suggestsave"), - cstr_String(key), - saveToDownloads_Label); - appendCStr_String(out, "\n"); + appendCStr_String(out, "\n${gempub.cover.viewlocal}\n"); +// appendFormat_String(out, +// cstr_Lang("error.unsupported.suggestsave"), +// cstr_String(key), +// saveToDownloads_Label); +// appendCStr_String(out, "\n"); } appendCStr_String(out, "\n## ${gempub.cover.aboutbook}\n"); appendProperty_Gempub_(d, "${gempub.meta.version}:", version_GempubProperty, out); diff --git a/src/gempub.h b/src/gempub.h index c03cabe6..e5f1b8eb 100644 --- a/src/gempub.h +++ b/src/gempub.h @@ -53,6 +53,7 @@ void close_Gempub (iGempub *); void setBaseUrl_Gempub (iGempub *, const iString *baseUrl); iBool isOpen_Gempub (const iGempub *); +iBool isRemote_Gempub (const iGempub *); iString * coverPageSource_Gempub (const iGempub *); iBool preloadCoverImage_Gempub(const iGempub *, iGmDocument *doc); diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index c8aad02b..a02e0bca 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -820,6 +820,13 @@ static iRangecc currentHeading_DocumentWidget_(const iDocumentWidget *d) { return heading; } +static int updateScrollMax_DocumentWidget_(iDocumentWidget *d) { + arrange_Widget(d->footerButtons); /* scrollMax depends on footer height */ + const int scrollMax = scrollMax_DocumentWidget_(d); + setMax_SmoothScroll(&d->scrollY, scrollMax); + return scrollMax; +} + static void updateVisible_DocumentWidget_(iDocumentWidget *d) { iChangeFlags(d->flags, centerVertically_DocumentWidgetFlag, @@ -827,7 +834,7 @@ static void updateVisible_DocumentWidget_(iDocumentWidget *d) { !isSuccess_GmStatusCode(d->sourceStatus)); const iRangei visRange = visibleRange_DocumentWidget_(d); const iRect bounds = bounds_Widget(as_Widget(d)); - const int scrollMax = scrollMax_DocumentWidget_(d); + const int scrollMax = updateScrollMax_DocumentWidget_(d); /* Reposition the footer buttons as appropriate. */ /* TODO: You can just position `footerButtons` here completely without having to get `Widget` involved with the offset in any way. */ @@ -837,7 +844,6 @@ static void updateVisible_DocumentWidget_(iDocumentWidget *d) { const int hPad = (width_Rect(bounds) - iMin(120 * gap_UI, width_Rect(docBounds))) / 2; const int vPad = 3 * gap_UI; setPadding_Widget(d->footerButtons, hPad, vPad, hPad, vPad); - arrange_Widget(d->footerButtons); d->footerButtons->animOffsetRef = (scrollMax > 0 ? &d->scrollY.pos : NULL); if (scrollMax <= 0) { d->footerButtons->animOffsetRef = NULL; @@ -848,7 +854,6 @@ static void updateVisible_DocumentWidget_(iDocumentWidget *d) { d->footerButtons->rect.pos.y = size_GmDocument(d->doc).y + 2 * gap_UI * d->pageMargin; } } - setMax_SmoothScroll(&d->scrollY, scrollMax); setRange_ScrollWidget(d->scroll, (iRangei){ 0, scrollMax }); const int docSize = size_GmDocument(d->doc).y; setThumb_ScrollWidget(d->scroll, @@ -1066,7 +1071,7 @@ static void makeFooterButtons_DocumentWidget_(iDocumentWidget *d, const iMenuIte resizeWidthOfChildren_WidgetFlag | arrangeHeight_WidgetFlag | fixedPosition_WidgetFlag | resizeToParentWidth_WidgetFlag, iTrue); - setBackgroundColor_Widget(d->footerButtons, tmBackground_ColorId); + //setBackgroundColor_Widget(d->footerButtons, tmBackground_ColorId); for (size_t i = 0; i < count; ++i) { iLabelWidget *button = addChildFlags_Widget( d->footerButtons, @@ -1079,6 +1084,7 @@ static void makeFooterButtons_DocumentWidget_(iDocumentWidget *d, const iMenuIte addChild_Widget(as_Widget(d), iClob(d->footerButtons)); arrange_Widget(d->footerButtons); arrange_Widget(w); + updateVisible_DocumentWidget_(d); /* final placement for the buttons */ } static void showErrorPage_DocumentWidget_(iDocumentWidget *d, enum iGmStatusCode code, @@ -1222,7 +1228,7 @@ static void postProcessRequestContent_DocumentWidget_(iDocumentWidget *d, iBool } if (d->sourceGempub) { if (equal_String(d->mod.url, coverPageUrl_Gempub(d->sourceGempub))) { - if (equalCase_Rangecc(urlScheme_String(d->mod.url), "file")) { + if (!isRemote_Gempub(d->sourceGempub)) { iArray *items = collectNew_Array(sizeof(iMenuItem)); pushBack_Array( items, @@ -1244,6 +1250,19 @@ static void postProcessRequestContent_DocumentWidget_(iDocumentWidget *d, iBool } makeFooterButtons_DocumentWidget_(d, constData_Array(items), size_Array(items)); } + else { + makeFooterButtons_DocumentWidget_( + d, + (iMenuItem[]){ { book_Icon " ${menu.save.downloads.open}", + SDLK_s, + KMOD_PRIMARY | KMOD_SHIFT, + "document.save open:1" }, + { download_Icon " " saveToDownloads_Label, + SDLK_s, + KMOD_PRIMARY, + "document.save" } }, + 2); + } if (preloadCoverImage_Gempub(d->sourceGempub, d->doc)) { redoLayout_GmDocument(d->doc); updateVisible_DocumentWidget_(d); @@ -2048,7 +2067,8 @@ static iBool fetchNextUnfetchedImage_DocumentWidget_(iDocumentWidget *d) { return iFalse; } -static void saveToDownloads_(const iString *url, const iString *mime, const iBlock *content) { +static const iString *saveToDownloads_(const iString *url, const iString *mime, const iBlock *content, + iBool showDialog) { const iString *savePath = downloadPathForUrl_App(url, mime); /* Write the file. */ { iFile *f = new_File(savePath); @@ -2060,17 +2080,22 @@ static void saveToDownloads_(const iString *url, const iString *mime, const iBlo #if defined (iPlatformAppleMobile) exportDownloadedFile_iOS(savePath); #else - const iMenuItem items[2] = { - { "${dlg.save.opendownload}", 0, 0, - format_CStr("!open url:%s", cstrCollect_String(makeFileUrl_String(savePath))) }, - { "${dlg.message.ok}", 0, 0, "message.ok" }, - }; - makeMessage_Widget(uiHeading_ColorEscape "${heading.save}", - format_CStr("%s\n${dlg.save.size} %.3f %s", cstr_String(path_File(f)), - isMega ? size / 1.0e6f : (size / 1.0e3f), - isMega ? "${mb}" : "${kb}"), - items, iElemCount(items)); + if (showDialog) { + const iMenuItem items[2] = { + { "${dlg.save.opendownload}", 0, 0, + format_CStr("!open url:%s", cstrCollect_String(makeFileUrl_String(savePath))) }, + { "${dlg.message.ok}", 0, 0, "message.ok" }, + }; + makeMessage_Widget(uiHeading_ColorEscape "${heading.save}", + format_CStr("%s\n${dlg.save.size} %.3f %s", + cstr_String(path_File(f)), + isMega ? size / 1.0e6f : (size / 1.0e3f), + isMega ? "${mb}" : "${kb}"), + items, + iElemCount(items)); + } #endif + return savePath; } else { makeSimpleMessage_Widget(uiTextCaution_ColorEscape "${heading.save.error}", @@ -2078,6 +2103,7 @@ static void saveToDownloads_(const iString *url, const iString *mime, const iBlo } iRelease(f); } + return collectNew_String(); } static void addAllLinks_(void *context, const iGmRun *run) { @@ -2556,7 +2582,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) const iMediaRequest *media = findMediaRequest_DocumentWidget_(d, linkId); if (media) { saveToDownloads_(url_GmRequest(media->req), meta_GmRequest(media->req), - body_GmRequest(media->req)); + body_GmRequest(media->req), iTrue); } } else if (equal_Command(cmd, "document.save") && document_App() == d) { @@ -2565,7 +2591,13 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) "${dlg.save.incomplete}"); } else if (!isEmpty_Block(&d->sourceContent)) { - saveToDownloads_(d->mod.url, &d->sourceMime, &d->sourceContent); + const iBool doOpen = argLabel_Command(cmd, "open"); + const iString *savePath = saveToDownloads_(d->mod.url, &d->sourceMime, + &d->sourceContent, !doOpen); + if (!isEmpty_String(savePath) && doOpen) { + postCommandf_Root( + w->root, "!open url:%s", cstrCollect_String(makeFileUrl_String(savePath))); + } } return iTrue; } @@ -2675,6 +2707,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) return iTrue; } else if (equal_Command(cmd, "scroll.bottom") && document_App() == d) { + updateScrollMax_DocumentWidget_(d); /* scrollY.max might not be fully updated */ init_Anim(&d->scrollY.pos, d->scrollY.max); invalidate_VisBuf(d->visBuf); clampScroll_DocumentWidget_(d); @@ -3188,6 +3221,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e iArray items; init_Array(&items, sizeof(iMenuItem)); if (d->contextLink) { + /* Context menu for a link. */ const iString *linkUrl = linkUrl_GmDocument(d->doc, d->contextLink->linkId); // const int linkFlags = linkFlags_GmDocument(d->doc, d->contextLink->linkId); const iRangecc scheme = urlScheme_String(linkUrl); -- cgit v1.2.3 From 55e0f439cc4c32df2d280487031f789b63a9e287 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 29 May 2021 08:06:19 +0300 Subject: Preferences: Added toggle for UI animations --- po/en.po | 3 +++ res/about/version.gmi | 3 ++- res/lang/de.bin | Bin 21054 -> 21080 bytes res/lang/en.bin | Bin 19759 -> 19785 bytes res/lang/es.bin | Bin 22101 -> 22127 bytes res/lang/fi.bin | Bin 21742 -> 21768 bytes res/lang/fr.bin | Bin 22666 -> 22692 bytes res/lang/ia.bin | Bin 21964 -> 21990 bytes res/lang/ie.bin | Bin 21132 -> 21158 bytes res/lang/pl.bin | Bin 22770 -> 22796 bytes res/lang/ru.bin | Bin 32851 -> 32877 bytes res/lang/sr.bin | Bin 31426 -> 31452 bytes res/lang/tok.bin | Bin 20169 -> 20195 bytes res/lang/zh_Hans.bin | Bin 18923 -> 18949 bytes res/lang/zh_Hant.bin | Bin 19108 -> 19134 bytes src/app.c | 6 ++++++ src/ui/sidebarwidget.c | 3 ++- src/ui/util.c | 2 ++ 18 files changed, 15 insertions(+), 2 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/po/en.po b/po/en.po index bbca83e5..9744f761 100644 --- a/po/en.po +++ b/po/en.po @@ -1160,6 +1160,9 @@ msgstr "UI scale factor:" msgid "prefs.customframe" msgstr "Custom window frame:" +msgid "prefs.animate" +msgstr "Animations:" + msgid "prefs.retainwindow" msgstr "Retain placement:" diff --git a/res/about/version.gmi b/res/about/version.gmi index a3a7c43d..e1b62835 100644 --- a/res/about/version.gmi +++ b/res/about/version.gmi @@ -13,7 +13,8 @@ * Disallow sending query responses that are too long (1024 bytes maximum). * Shift-click to select a range of text in input widgets (i.e, without dragging). * Footer buttons: on certain pages (e.g., error messages) show relevant actions in the bottom of the page. For example, if a certificate is required for viewing a page, show buttons for creating a new identity and showing the Identities sidebar. -* Link navigation shortcut icons are drawn with a consistent appearance. +* Gempub: Linear navigation through the book with Left/Right arrow keys and via footer buttons. The navigation order is determined by links on the Gempub index page. +* Link navigation shortcut icons (home row and numbered) are drawn with a consistent appearance. * Animate showing and hiding of sidebars and dialogs. * macOS: Workaround for a Metal rendering issue. * Added "Smol Emoji" and "Noto Sans Symbols" fonts, removed Symbola. Note: Many Emoji and pictographs added in recent years are still missing. diff --git a/res/lang/de.bin b/res/lang/de.bin index 45260c31..a5f3c427 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index 728c7ff8..3fe8fc26 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index d6cdd974..8a8c314f 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index b66badcb..361f3fce 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index 232338c9..d6875a05 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index e460faf7..1ebd2fea 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 87e3c0e5..4738fd3e 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 0c021408..877ffaf7 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 17df17a8..8301f8d4 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 74f897cb..75fe0b99 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index 4d8259b3..d5419504 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index c5b6cede..66c62937 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index 56d7643d..57e310e2 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/app.c b/src/app.c index bb3afea6..663fa2e8 100644 --- a/src/app.c +++ b/src/app.c @@ -213,6 +213,7 @@ static iString *serializePrefs_App_(const iApp *d) { appendFormat_String(str, "decodeurls arg:%d\n", d->prefs.decodeUserVisibleURLs); appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); /* TODO: Set up an array of booleans in Prefs and do these in a loop. */ + appendFormat_String(str, "prefs.animate.changed arg:%d\n", d->prefs.uiAnimations); appendFormat_String(str, "prefs.mono.gemini.changed arg:%d\n", d->prefs.monospaceGemini); appendFormat_String(str, "prefs.mono.gopher.changed arg:%d\n", d->prefs.monospaceGopher); appendFormat_String(str, "prefs.boldlink.dark.changed arg:%d\n", d->prefs.boldLinkDark); @@ -2108,6 +2109,10 @@ iBool handleCommand_App(const char *cmd) { d->prefs.openArchiveIndexPages = arg_Command(cmd) != 0; return iTrue; } + else if (equal_Command(cmd, "prefs.animate.changed")) { + d->prefs.uiAnimations = arg_Command(cmd) != 0; + return iTrue; + } else if (equal_Command(cmd, "saturation.set")) { d->prefs.saturation = (float) arg_Command(cmd) / 100.0f; if (!isFrozen) { @@ -2350,6 +2355,7 @@ iBool handleCommand_App(const char *cmd) { setToggle_Widget(findChild_Widget(dlg, "prefs.archive.openindex"), d->prefs.openArchiveIndexPages); setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme); setToggle_Widget(findChild_Widget(dlg, "prefs.customframe"), d->prefs.customFrame); + setToggle_Widget(findChild_Widget(dlg, "prefs.animate"), d->prefs.uiAnimations); setText_InputWidget(findChild_Widget(dlg, "prefs.userfont"), &d->prefs.symbolFontPath); updatePrefsPinSplitButtons_(dlg, d->prefs.pinSplit); updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage)); diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 395138bb..27646b22 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -936,7 +936,8 @@ static iBool handleSidebarCommand_SidebarWidget_(iSidebarWidget *d, const char * if (arg_Command(cmd) && isVisible_Widget(w)) { return iTrue; } - const iBool isAnimated = argLabel_Command(cmd, "noanim") == 0 && + const iBool isAnimated = prefs_App()->uiAnimations && + argLabel_Command(cmd, "noanim") == 0 && (deviceType_App() != phone_AppDeviceType); int visX = 0; if (isVisible_Widget(w)) { diff --git a/src/ui/util.c b/src/ui/util.c index edac214f..c4fb8886 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -1698,6 +1698,8 @@ iWidget *makePreferences_Widget(void) { addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.customframe}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.customframe"))); #endif + addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.animate}"))); + addChild_Widget(values, iClob(makeToggle_Widget("prefs.animate"))); makeTwoColumnHeading_("${heading.prefs.scrolling}", headings, values); addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.smoothscroll}"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.smoothscroll"))); -- cgit v1.2.3 From 05e2ce8b07e8332af887f608831c36d4f7bde664 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 29 May 2021 15:26:13 +0300 Subject: Keys: Redundant split menu language strings --- po/en.po | 25 ++----------------------- res/lang/de.bin | Bin 21080 -> 20699 bytes res/lang/en.bin | Bin 19785 -> 19404 bytes res/lang/es.bin | Bin 22127 -> 21746 bytes res/lang/fi.bin | Bin 21768 -> 21892 bytes res/lang/fr.bin | Bin 22692 -> 22311 bytes res/lang/ia.bin | Bin 21990 -> 21609 bytes res/lang/ie.bin | Bin 21158 -> 21153 bytes res/lang/pl.bin | Bin 22796 -> 22415 bytes res/lang/ru.bin | Bin 32877 -> 32496 bytes res/lang/sr.bin | Bin 31452 -> 31969 bytes res/lang/tok.bin | Bin 20195 -> 19814 bytes res/lang/zh_Hans.bin | Bin 18949 -> 18568 bytes res/lang/zh_Hant.bin | Bin 19134 -> 18753 bytes src/ui/keys.c | 16 ++++++++-------- 15 files changed, 10 insertions(+), 31 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/po/en.po b/po/en.po index 9744f761..8fe6b96d 100644 --- a/po/en.po +++ b/po/en.po @@ -1393,29 +1393,8 @@ msgstr "Set view split mode" msgid "keys.split.next" msgstr "Switch focus to next split" -msgid "keys.split.menu.merge" -msgstr "Split view menu: Merge tabs" - -msgid "keys.split.menu.swap" -msgstr "Split view menu: Swap sides" - -msgid "keys.split.menu.horiz" -msgstr "Split view menu: Horizontal" - -msgid "keys.split.menu.horiz12" -msgstr "Split view menu: Horizontal 1:2" - -msgid "keys.split.menu.horiz21" -msgstr "Split view menu: Horizontal 2:1" - -msgid "keys.split.menu.vert" -msgstr "Split view menu: Vertical" - -msgid "keys.split.menu.vert12" -msgstr "Split view menu: Vertical 1:2" - -msgid "keys.split.menu.vert21" -msgstr "Split view menu: Vertical 2:1" +msgid "keys.split.item" +msgstr "Split view menu:" msgid "keys.hoverurl" msgstr "Toggle show URL on hover" diff --git a/res/lang/de.bin b/res/lang/de.bin index a5f3c427..b89c8b0f 100644 Binary files a/res/lang/de.bin and b/res/lang/de.bin differ diff --git a/res/lang/en.bin b/res/lang/en.bin index 3fe8fc26..0ac42d88 100644 Binary files a/res/lang/en.bin and b/res/lang/en.bin differ diff --git a/res/lang/es.bin b/res/lang/es.bin index 8a8c314f..01d86e3f 100644 Binary files a/res/lang/es.bin and b/res/lang/es.bin differ diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 361f3fce..7034468b 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ diff --git a/res/lang/fr.bin b/res/lang/fr.bin index d6875a05..0b78f3b7 100644 Binary files a/res/lang/fr.bin and b/res/lang/fr.bin differ diff --git a/res/lang/ia.bin b/res/lang/ia.bin index 1ebd2fea..e6590afc 100644 Binary files a/res/lang/ia.bin and b/res/lang/ia.bin differ diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 4738fd3e..dcf6a70d 100644 Binary files a/res/lang/ie.bin and b/res/lang/ie.bin differ diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 877ffaf7..9f42024c 100644 Binary files a/res/lang/pl.bin and b/res/lang/pl.bin differ diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 8301f8d4..3cacac36 100644 Binary files a/res/lang/ru.bin and b/res/lang/ru.bin differ diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 75fe0b99..af0acbf9 100644 Binary files a/res/lang/sr.bin and b/res/lang/sr.bin differ diff --git a/res/lang/tok.bin b/res/lang/tok.bin index d5419504..8f10e051 100644 Binary files a/res/lang/tok.bin and b/res/lang/tok.bin differ diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index 66c62937..b155036d 100644 Binary files a/res/lang/zh_Hans.bin and b/res/lang/zh_Hans.bin differ diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index 57e310e2..57ce2d83 100644 Binary files a/res/lang/zh_Hant.bin and b/res/lang/zh_Hant.bin differ diff --git a/src/ui/keys.c b/src/ui/keys.c index 17cc0e72..b15fe04b 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c @@ -228,14 +228,14 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] = { 81, { "${keys.tab.next}", nextTab_KeyShortcut, "tabs.next" }, 0 }, { 90, { "${keys.split.menu}", SDLK_j, KMOD_PRIMARY, "splitmenu.open" }, 0 }, { 91, { "${keys.split.next}", SDLK_TAB, KMOD_CTRL, "keyroot.next", }, 0 }, - { 92, { "${keys.split.menu.merge}", '1', 0, "ui.split arg:0", }, noDirectTrigger_BindFlag }, - { 93, { "${keys.split.menu.swap}", SDLK_x, 0, "ui.split swap:1", }, noDirectTrigger_BindFlag }, - { 94, { "${keys.split.menu.horiz}", '3', 0, "ui.split arg:3 axis:0", }, noDirectTrigger_BindFlag }, - { 95, { "${keys.split.menu.horiz12}", SDLK_d, 0, "ui.split arg:1 axis:0", }, noDirectTrigger_BindFlag }, - { 96, { "${keys.split.menu.horiz21}", SDLK_e, 0, "ui.split arg:2 axis:0", }, noDirectTrigger_BindFlag }, - { 97, { "${keys.split.menu.vert}", '2', 0, "ui.split arg:3 axis:1", }, noDirectTrigger_BindFlag }, - { 98, { "${keys.split.menu.vert12}", SDLK_f, 0, "ui.split arg:1 axis:1", }, noDirectTrigger_BindFlag }, - { 99, { "${keys.split.menu.vert21}", SDLK_r, 0, "ui.split arg:2 axis:1", }, noDirectTrigger_BindFlag }, + { 92, { "${keys.split.item} ${menu.split.merge}", '1', 0, "ui.split arg:0", }, noDirectTrigger_BindFlag }, + { 93, { "${keys.split.item} ${menu.split.swap}", SDLK_x, 0, "ui.split swap:1", }, noDirectTrigger_BindFlag }, + { 94, { "${keys.split.item} ${menu.split.horizontal}", '3', 0, "ui.split arg:3 axis:0", }, noDirectTrigger_BindFlag }, + { 95, { "${keys.split.item} ${menu.split.horizontal} 1:2", SDLK_d, 0, "ui.split arg:1 axis:0", }, noDirectTrigger_BindFlag }, + { 96, { "${keys.split.item} ${menu.split.horizontal} 2:1", SDLK_e, 0, "ui.split arg:2 axis:0", }, noDirectTrigger_BindFlag }, + { 97, { "${keys.split.item} ${menu.split.vertical}", '2', 0, "ui.split arg:3 axis:1", }, noDirectTrigger_BindFlag }, + { 98, { "${keys.split.item} ${menu.split.vertical} 1:2", SDLK_f, 0, "ui.split arg:1 axis:1", }, noDirectTrigger_BindFlag }, + { 99, { "${keys.split.item} ${menu.split.vertical} 2:1", SDLK_r, 0, "ui.split arg:2 axis:1", }, noDirectTrigger_BindFlag }, { 100,{ "${keys.hoverurl}", '/', KMOD_PRIMARY, "prefs.hoverlink.toggle" }, 0 }, { 110,{ "${menu.save.downloads}", SDLK_s, KMOD_PRIMARY, "document.save" }, 0 }, /* The following cannot currently be changed (built-in duplicates). */ -- cgit v1.2.3 From a066105ac34187c14e248773e9d453bafd160e86 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 29 May 2021 15:29:42 +0300 Subject: Lang: Recompiled language strings --- res/lang/fi.bin | Bin 21892 -> 21901 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'res/lang/fi.bin') diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 7034468b..d19dc0e8 100644 Binary files a/res/lang/fi.bin and b/res/lang/fi.bin differ -- cgit v1.2.3