mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[RTL UI] use auto or LTR text direction in some specific cases
Allow TextBoxWidget new text direction/lang parameters to be set on upper widgets, and propagate them all the way to it (ScrollTextWidget, InputText, InputDialog, TextViewer). Use specific non-default ones in some specific cases: - Force LTR text direction when showing HTML and CSS, and configuration files (in some plugins). - Use Wikipedia server language and text direction when showing an article. - Use auto with Dictionary results, as we don't know the dictionary language, and they may contain mixed content. - Force LTR when showing some paths (still needs more of them) TextEditor plugin: add 2 new options "Auto paragraph direction" and "Force paragraph direction LTR". Footnotes popup: grab HTML direction, and forward it to MuPDF for proper display.
This commit is contained in:
@@ -781,6 +781,8 @@ function ReaderHighlight:viewSelectionHTML(debug_view)
|
||||
text = css_text or _("Failed getting CSS content"),
|
||||
text_face = Font:getFace("smallinfont"),
|
||||
justified = false,
|
||||
para_direction_rtl = false,
|
||||
auto_para_direction = false,
|
||||
buttons_table = {
|
||||
{{
|
||||
text = _("Prettify"),
|
||||
@@ -792,6 +794,8 @@ function ReaderHighlight:viewSelectionHTML(debug_view)
|
||||
text = prettifyCss(css_text),
|
||||
text_face = Font:getFace("smallinfont"),
|
||||
justified = false,
|
||||
para_direction_rtl = false,
|
||||
auto_para_direction = false,
|
||||
})
|
||||
end,
|
||||
}},
|
||||
@@ -838,6 +842,8 @@ function ReaderHighlight:viewSelectionHTML(debug_view)
|
||||
text = html,
|
||||
text_face = Font:getFace("smallinfont"),
|
||||
justified = false,
|
||||
para_direction_rtl = false,
|
||||
auto_para_direction = false,
|
||||
buttons_table = buttons_table,
|
||||
}
|
||||
UIManager:show(textviewer)
|
||||
|
||||
Reference in New Issue
Block a user