1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-30 19:56:10 +00:00

Added inline monospaced pre option

This commit is contained in:
M66B 2022-01-29 18:27:22 +01:00
parent b2765393c1
commit 1e513eaa3d
2 changed files with 18 additions and 5 deletions

View file

@ -3802,6 +3802,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.getMenu().add(Menu.NONE, R.string.title_disable_widths, 3, R.string.title_disable_widths)
.setCheckable(true)
.setChecked(prefs.getBoolean("override_width", false));
popupMenu.getMenu().add(Menu.NONE, R.string.title_monospaced_pre, 4, R.string.title_monospaced_pre)
.setCheckable(true)
.setChecked(prefs.getBoolean("monospaced_pre", false));
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
@ -3810,17 +3813,26 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (itemId == R.string.title_fullscreen) {
onActionOpenFull(message);
return true;
} else if (itemId == R.string.title_fit_width || itemId == R.string.title_disable_widths) {
} else if (itemId == R.string.title_fit_width ||
itemId == R.string.title_disable_widths ||
itemId == R.string.title_monospaced_pre) {
boolean enabled = !item.isChecked();
item.setChecked(enabled);
String key = (itemId == R.string.title_fit_width
? "overview_mode" : "override_width");
prefs.edit().putBoolean(key, enabled).apply();
if (itemId == R.string.title_fit_width)
prefs.edit().putBoolean("overview_mode", enabled).apply();
else if (itemId == R.string.title_disable_widths)
prefs.edit().putBoolean("override_width", enabled).apply();
else if (itemId == R.string.title_monospaced_pre)
prefs.edit().putBoolean("monospaced_pre", enabled).apply();
properties.setSize(message.id, null);
properties.setHeight(message.id, null);
properties.setPosition(message.id, null);
if ("overview_mode".equals(key) && wvBody instanceof WebView)
if (itemId == R.string.title_fit_width && wvBody instanceof WebView)
((WebView) wvBody).getSettings().setLoadWithOverviewMode(enabled);
bindBody(message, false);
return true;
}

View file

@ -1183,6 +1183,7 @@
<string name="title_fullscreen">Show fullscreen</string>
<string name="title_fit_width">Fit width</string>
<string name="title_disable_widths">Disable widths</string>
<string name="title_monospaced_pre">Monospaced &lt;pre&gt;</string>
<string name="title_unused_inline">Unused inline images will be removed on send</string>
<string name="title_accross_remark">Messages moved across accounts will be downloaded again resulting in extra data usage</string>
<string name="title_raw_saved">Raw message saved</string>