diff options
-rwxr-xr-x | po/compile.py | 3 | ||||
-rw-r--r-- | po/en.po | 12 | ||||
-rw-r--r-- | res/lang/de.bin | bin | 21728 -> 21867 bytes | |||
-rw-r--r-- | res/lang/en.bin | bin | 20425 -> 20564 bytes | |||
-rw-r--r-- | res/lang/es.bin | bin | 22807 -> 22946 bytes | |||
-rw-r--r-- | res/lang/fi.bin | bin | 22930 -> 23069 bytes | |||
-rw-r--r-- | res/lang/fr.bin | bin | 23340 -> 23479 bytes | |||
-rw-r--r-- | res/lang/ia.bin | bin | 22638 -> 22777 bytes | |||
-rw-r--r-- | res/lang/ie.bin | bin | 22196 -> 22335 bytes | |||
-rw-r--r-- | res/lang/pl.bin | bin | 23444 -> 23583 bytes | |||
-rw-r--r-- | res/lang/ru.bin | bin | 33675 -> 33814 bytes | |||
-rw-r--r-- | res/lang/sr.bin | bin | 33080 -> 33219 bytes | |||
-rw-r--r-- | res/lang/tok.bin | bin | 20821 -> 20960 bytes | |||
-rw-r--r-- | res/lang/zh_Hans.bin | bin | 19597 -> 19736 bytes | |||
-rw-r--r-- | res/lang/zh_Hant.bin | bin | 19782 -> 19921 bytes | |||
-rw-r--r-- | src/app.c | 12 | ||||
-rw-r--r-- | src/ui/util.c | 70 |
17 files changed, 83 insertions, 14 deletions
diff --git a/po/compile.py b/po/compile.py index 257f9b6f..e1839e2e 100755 --- a/po/compile.py +++ b/po/compile.py | |||
@@ -25,7 +25,8 @@ ESCAPES = { | |||
25 | '"': '"', | 25 | '"': '"', |
26 | 'n': '\n', | 26 | 'n': '\n', |
27 | 'r': '\r', | 27 | 'r': '\r', |
28 | 't': '\t' | 28 | 't': '\t', |
29 | 'v': '\v', | ||
29 | } | 30 | } |
30 | 31 | ||
31 | if '--new' in sys.argv: | 32 | if '--new' in sys.argv: |
@@ -1193,6 +1193,15 @@ msgstr "UI scale factor:" | |||
1193 | msgid "prefs.customframe" | 1193 | msgid "prefs.customframe" |
1194 | msgstr "Custom window frame:" | 1194 | msgstr "Custom window frame:" |
1195 | 1195 | ||
1196 | msgid "prefs.returnkey" | ||
1197 | msgstr "Return key behavior:" | ||
1198 | |||
1199 | msgid "prefs.returnkey.linebreak" | ||
1200 | msgstr "Line break" | ||
1201 | |||
1202 | msgid "prefs.returnkey.accept" | ||
1203 | msgstr "Accept" | ||
1204 | |||
1196 | msgid "prefs.animate" | 1205 | msgid "prefs.animate" |
1197 | msgstr "Animations:" | 1206 | msgstr "Animations:" |
1198 | 1207 | ||
@@ -1441,6 +1450,9 @@ msgstr "Split view menu:" | |||
1441 | msgid "keys.hoverurl" | 1450 | msgid "keys.hoverurl" |
1442 | msgstr "Toggle show URL on hover" | 1451 | msgstr "Toggle show URL on hover" |
1443 | 1452 | ||
1453 | msgid "keys.upload" | ||
1454 | msgstr "Upload Page with Titan" | ||
1455 | |||
1444 | msgid "error.badstatus" | 1456 | msgid "error.badstatus" |
1445 | msgstr "Unknown Status Code" | 1457 | msgstr "Unknown Status Code" |
1446 | 1458 | ||
diff --git a/res/lang/de.bin b/res/lang/de.bin index 2ef9d61b..13575cbe 100644 --- a/res/lang/de.bin +++ b/res/lang/de.bin | |||
Binary files differ | |||
diff --git a/res/lang/en.bin b/res/lang/en.bin index f39f3f04..92bfb3eb 100644 --- a/res/lang/en.bin +++ b/res/lang/en.bin | |||
Binary files differ | |||
diff --git a/res/lang/es.bin b/res/lang/es.bin index 588bddb8..6b6dbc8e 100644 --- a/res/lang/es.bin +++ b/res/lang/es.bin | |||
Binary files differ | |||
diff --git a/res/lang/fi.bin b/res/lang/fi.bin index f19686d9..edbbc72b 100644 --- a/res/lang/fi.bin +++ b/res/lang/fi.bin | |||
Binary files differ | |||
diff --git a/res/lang/fr.bin b/res/lang/fr.bin index de1858e5..ddc3bb90 100644 --- a/res/lang/fr.bin +++ b/res/lang/fr.bin | |||
Binary files differ | |||
diff --git a/res/lang/ia.bin b/res/lang/ia.bin index d1df3ad9..6c377e8b 100644 --- a/res/lang/ia.bin +++ b/res/lang/ia.bin | |||
Binary files differ | |||
diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 66b5526a..3198929f 100644 --- a/res/lang/ie.bin +++ b/res/lang/ie.bin | |||
Binary files differ | |||
diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 6fb392b7..ad9db0bd 100644 --- a/res/lang/pl.bin +++ b/res/lang/pl.bin | |||
Binary files differ | |||
diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 85b8a9c1..104ee326 100644 --- a/res/lang/ru.bin +++ b/res/lang/ru.bin | |||
Binary files differ | |||
diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 88798b80..60cbfb45 100644 --- a/res/lang/sr.bin +++ b/res/lang/sr.bin | |||
Binary files differ | |||
diff --git a/res/lang/tok.bin b/res/lang/tok.bin index 03b8a0e5..6ee6f498 100644 --- a/res/lang/tok.bin +++ b/res/lang/tok.bin | |||
Binary files differ | |||
diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index 7b334048..d0e2987e 100644 --- a/res/lang/zh_Hans.bin +++ b/res/lang/zh_Hans.bin | |||
Binary files differ | |||
diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index 40fe7d97..8d31e63c 100644 --- a/res/lang/zh_Hant.bin +++ b/res/lang/zh_Hant.bin | |||
Binary files differ | |||
@@ -219,6 +219,7 @@ static iString *serializePrefs_App_(const iApp *d) { | |||
219 | appendFormat_String(str, "decodeurls arg:%d\n", d->prefs.decodeUserVisibleURLs); | 219 | appendFormat_String(str, "decodeurls arg:%d\n", d->prefs.decodeUserVisibleURLs); |
220 | appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); | 220 | appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); |
221 | appendFormat_String(str, "linespacing.set arg:%f\n", d->prefs.lineSpacing); | 221 | appendFormat_String(str, "linespacing.set arg:%f\n", d->prefs.lineSpacing); |
222 | appendFormat_String(str, "returnkey.set arg:%d\n", d->prefs.returnKey); | ||
222 | /* TODO: Set up an array of booleans in Prefs and do these in a loop. */ | 223 | /* TODO: Set up an array of booleans in Prefs and do these in a loop. */ |
223 | appendFormat_String(str, "prefs.animate.changed arg:%d\n", d->prefs.uiAnimations); | 224 | appendFormat_String(str, "prefs.animate.changed arg:%d\n", d->prefs.uiAnimations); |
224 | appendFormat_String(str, "prefs.mono.gemini.changed arg:%d\n", d->prefs.monospaceGemini); | 225 | appendFormat_String(str, "prefs.mono.gemini.changed arg:%d\n", d->prefs.monospaceGemini); |
@@ -1700,6 +1701,11 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) { | |||
1700 | setFlags_Widget(findChild_Widget(d, "prefs.quoteicon.1"), selected_WidgetFlag, arg == 1); | 1701 | setFlags_Widget(findChild_Widget(d, "prefs.quoteicon.1"), selected_WidgetFlag, arg == 1); |
1701 | return iFalse; | 1702 | return iFalse; |
1702 | } | 1703 | } |
1704 | else if (equal_Command(cmd, "returnkey.set")) { | ||
1705 | updateDropdownSelection_(findChild_Widget(d, "prefs.returnkey"), | ||
1706 | format_CStr("returnkey.set arg:%d", arg_Command(cmd))); | ||
1707 | return iFalse; | ||
1708 | } | ||
1703 | else if (equal_Command(cmd, "pinsplit.set")) { | 1709 | else if (equal_Command(cmd, "pinsplit.set")) { |
1704 | updatePrefsPinSplitButtons_(d, arg_Command(cmd)); | 1710 | updatePrefsPinSplitButtons_(d, arg_Command(cmd)); |
1705 | return iFalse; | 1711 | return iFalse; |
@@ -2103,6 +2109,10 @@ iBool handleCommand_App(const char *cmd) { | |||
2103 | } | 2109 | } |
2104 | return iTrue; | 2110 | return iTrue; |
2105 | } | 2111 | } |
2112 | else if (equal_Command(cmd, "returnkey.set")) { | ||
2113 | d->prefs.returnKey = arg_Command(cmd); | ||
2114 | return iTrue; | ||
2115 | } | ||
2106 | else if (equal_Command(cmd, "pinsplit.set")) { | 2116 | else if (equal_Command(cmd, "pinsplit.set")) { |
2107 | d->prefs.pinSplit = arg_Command(cmd); | 2117 | d->prefs.pinSplit = arg_Command(cmd); |
2108 | return iTrue; | 2118 | return iTrue; |
@@ -2536,6 +2546,8 @@ iBool handleCommand_App(const char *cmd) { | |||
2536 | updateScrollSpeedButtons_(dlg, mouse_ScrollType, d->prefs.smoothScrollSpeed[mouse_ScrollType]); | 2546 | updateScrollSpeedButtons_(dlg, mouse_ScrollType, d->prefs.smoothScrollSpeed[mouse_ScrollType]); |
2537 | updateScrollSpeedButtons_(dlg, keyboard_ScrollType, d->prefs.smoothScrollSpeed[keyboard_ScrollType]); | 2547 | updateScrollSpeedButtons_(dlg, keyboard_ScrollType, d->prefs.smoothScrollSpeed[keyboard_ScrollType]); |
2538 | updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage)); | 2548 | updateDropdownSelection_(findChild_Widget(dlg, "prefs.uilang"), cstr_String(&d->prefs.uiLanguage)); |
2549 | updateDropdownSelection_(findChild_Widget(dlg, "prefs.returnkey"), | ||
2550 | format_CStr("returnkey.set arg:%d", d->prefs.returnKey)); | ||
2539 | setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize); | 2551 | setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize); |
2540 | setText_InputWidget(findChild_Widget(dlg, "prefs.uiscale"), | 2552 | setText_InputWidget(findChild_Widget(dlg, "prefs.uiscale"), |
2541 | collectNewFormat_String("%g", uiScale_Window(d->window))); | 2553 | collectNewFormat_String("%g", uiScale_Window(d->window))); |
diff --git a/src/ui/util.c b/src/ui/util.c index 63600557..152df0bd 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1607,6 +1607,22 @@ static void addPrefsInputWithHeading_(iWidget *headings, iWidget *values, | |||
1607 | addDialogInputWithHeading_(headings, values, format_CStr("${%s}", id), id, input); | 1607 | addDialogInputWithHeading_(headings, values, format_CStr("${%s}", id), id, input); |
1608 | } | 1608 | } |
1609 | 1609 | ||
1610 | static size_t findWidestItemLabel_(const iMenuItem *items, size_t num) { | ||
1611 | int widest = 0; | ||
1612 | size_t widestPos = iInvalidPos; | ||
1613 | for (size_t i = 0; i < num; i++) { | ||
1614 | const int width = | ||
1615 | measure_Text(uiLabel_FontId, | ||
1616 | translateCStr_Lang(items[i].label)) | ||
1617 | .advance.x; | ||
1618 | if (widestPos == iInvalidPos || width > widest) { | ||
1619 | widest = width; | ||
1620 | widestPos = i; | ||
1621 | } | ||
1622 | } | ||
1623 | return widestPos; | ||
1624 | } | ||
1625 | |||
1610 | iWidget *makePreferences_Widget(void) { | 1626 | iWidget *makePreferences_Widget(void) { |
1611 | iWidget *dlg = makeSheet_Widget("prefs"); | 1627 | iWidget *dlg = makeSheet_Widget("prefs"); |
1612 | addChildFlags_Widget(dlg, | 1628 | addChildFlags_Widget(dlg, |
@@ -1661,20 +1677,8 @@ iWidget *makePreferences_Widget(void) { | |||
1661 | { "${lang.zh.hant} - zh", 0, 0, "uilang id:zh_Hant" }, | 1677 | { "${lang.zh.hant} - zh", 0, 0, "uilang id:zh_Hant" }, |
1662 | }; | 1678 | }; |
1663 | pushBackN_Array(uiLangs, langItems, iElemCount(langItems)); | 1679 | pushBackN_Array(uiLangs, langItems, iElemCount(langItems)); |
1664 | //sort_Array(uiLangs, cmp_MenuItem_); | ||
1665 | /* TODO: Add an arrange flag for resizing parent to widest child. */ | 1680 | /* TODO: Add an arrange flag for resizing parent to widest child. */ |
1666 | int widest = 0; | 1681 | size_t widestPos = findWidestItemLabel_(data_Array(uiLangs), size_Array(uiLangs)); |
1667 | size_t widestPos = iInvalidPos; | ||
1668 | iConstForEach(Array, i, uiLangs) { | ||
1669 | const int width = | ||
1670 | measure_Text(uiLabel_FontId, | ||
1671 | translateCStr_Lang(((const iMenuItem *) i.value)->label)) | ||
1672 | .advance.x; | ||
1673 | if (widestPos == iInvalidPos || width > widest) { | ||
1674 | widest = width; | ||
1675 | widestPos = index_ArrayConstIterator(&i); | ||
1676 | } | ||
1677 | } | ||
1678 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.uilang}"))); | 1682 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.uilang}"))); |
1679 | setId_Widget(addChildFlags_Widget(values, | 1683 | setId_Widget(addChildFlags_Widget(values, |
1680 | iClob(makeMenuButton_LabelWidget( | 1684 | iClob(makeMenuButton_LabelWidget( |
@@ -1691,6 +1695,46 @@ iWidget *makePreferences_Widget(void) { | |||
1691 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.customframe}"))); | 1695 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.customframe}"))); |
1692 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.customframe"))); | 1696 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.customframe"))); |
1693 | #endif | 1697 | #endif |
1698 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.returnkey}"))); | ||
1699 | /* Return key behaviors. */ { | ||
1700 | const iMenuItem returnKeyBehaviors[] = { | ||
1701 | { "${prefs.returnkey.linebreak} " | ||
1702 | uiTextAction_ColorEscape shift_Icon return_Icon restore_ColorEscape | ||
1703 | " ${prefs.returnkey.accept} " | ||
1704 | uiTextAction_ColorEscape return_Icon, | ||
1705 | 0, | ||
1706 | 0, | ||
1707 | format_CStr("returnkey.set arg:%d", default_ReturnKeyBehavior) }, | ||
1708 | { "${prefs.returnkey.linebreak} " | ||
1709 | uiTextAction_ColorEscape return_Icon restore_ColorEscape | ||
1710 | " ${prefs.returnkey.accept} " | ||
1711 | uiTextAction_ColorEscape shift_Icon return_Icon, | ||
1712 | 0, | ||
1713 | 0, | ||
1714 | format_CStr("returnkey.set arg:%d", acceptWithShift_ReturnKeyBehavior) }, | ||
1715 | { "${prefs.returnkey.linebreak} " | ||
1716 | uiTextAction_ColorEscape return_Icon restore_ColorEscape | ||
1717 | " ${prefs.returnkey.accept} " uiTextAction_ColorEscape | ||
1718 | #if defined (iPlatformApple) | ||
1719 | "\u2318" return_Icon, | ||
1720 | #else | ||
1721 | "Ctrl" return_Icon, | ||
1722 | #endif | ||
1723 | 0, | ||
1724 | 0, | ||
1725 | format_CStr("returnkey.set arg:%d", acceptWithPrimaryMod_ReturnKeyBehavior) }, | ||
1726 | }; | ||
1727 | iLabelWidget *returnKey = makeMenuButton_LabelWidget( | ||
1728 | returnKeyBehaviors[findWidestItemLabel_(returnKeyBehaviors, | ||
1729 | iElemCount(returnKeyBehaviors))] | ||
1730 | .label, | ||
1731 | returnKeyBehaviors, | ||
1732 | iElemCount(returnKeyBehaviors)); | ||
1733 | setBackgroundColor_Widget(findChild_Widget(as_Widget(returnKey), "menu"), | ||
1734 | uiBackgroundMenu_ColorId); | ||
1735 | setId_Widget(addChildFlags_Widget(values, iClob(returnKey), alignLeft_WidgetFlag), | ||
1736 | "prefs.returnkey"); | ||
1737 | } | ||
1694 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.animate}"))); | 1738 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.animate}"))); |
1695 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.animate"))); | 1739 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.animate"))); |
1696 | makeTwoColumnHeading_("${heading.prefs.scrolling}", headings, values); | 1740 | makeTwoColumnHeading_("${heading.prefs.scrolling}", headings, values); |