Added option to not zoom message text in message editor

pull/213/head
M66B 1 year ago
parent 8bc778bba8
commit 04a34acdd5

@ -112,7 +112,8 @@ public class FragmentAnswer extends FragmentBase {
String compose_font = prefs.getString("compose_font", "");
boolean compact = prefs.getBoolean("compose_compact", false);
int zoom = prefs.getInt("compose_zoom", compact ? 0 : 1);
int message_zoom = prefs.getInt("message_zoom", 100);
boolean editor_zoom = prefs.getBoolean("editor_zoom", true);
int message_zoom = (editor_zoom ? prefs.getInt("message_zoom", 100) : 100);
setSubtitle(R.string.title_answer_caption);
setHasOptionsMenu(true);

@ -2174,7 +2174,8 @@ public class FragmentCompose extends FragmentBase {
private void setZoom() {
final Context context = getContext();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
int message_zoom = prefs.getInt("message_zoom", 100);
boolean editor_zoom = prefs.getBoolean("editor_zoom", true);
int message_zoom = (editor_zoom ? prefs.getInt("message_zoom", 100) : 100);
float textSize = Helper.getTextSize(context, zoom);
if (textSize != 0) {
etBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize * message_zoom / 100f);

@ -164,6 +164,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swHideAttachments;
private TextView tvMessageZoom;
private SeekBar sbMessageZoom;
private SwitchCompat swEditorZoom;
private SwitchCompat swOverviewMode;
private SwitchCompat swContrast;
@ -214,7 +215,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"keywords_header", "labels_header", "flags", "flags_background",
"preview", "preview_italic", "preview_lines", "align_header",
"addresses", "hide_attachments",
"message_zoom", "overview_mode",
"message_zoom", "editor_zoom", "overview_mode",
"hyphenation", "display_font", "contrast", "monospaced_pre",
"text_separators",
"collapse_quotes", "image_placeholders", "inline_images", "button_extra",
@ -333,6 +334,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swHideAttachments = view.findViewById(R.id.swHideAttachments);
tvMessageZoom = view.findViewById(R.id.tvMessageZoom);
sbMessageZoom = view.findViewById(R.id.sbMessageZoom);
swEditorZoom = view.findViewById(R.id.swEditorZoom);
swOverviewMode = view.findViewById(R.id.swOverviewMode);
swContrast = view.findViewById(R.id.swContrast);
swHyphenation = view.findViewById(R.id.swHyphenation);
@ -1187,6 +1189,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swEditorZoom.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("editor_zoom", checked).apply();
}
});
swOverviewMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -1592,6 +1601,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
if (message_zoom >= 50 && message_zoom <= 250)
sbMessageZoom.setProgress(message_zoom - 50);
swEditorZoom.setChecked(prefs.getBoolean("editor_zoom", true));
swOverviewMode.setChecked(prefs.getBoolean("overview_mode", false));
swContrast.setChecked(prefs.getBoolean("contrast", false));

@ -1746,6 +1746,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessageZoom" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swEditorZoom"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_editor_text_zoom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/sbMessageZoom"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swOverviewMode"
android:layout_width="0dp"
@ -1754,7 +1766,7 @@
android:text="@string/title_advanced_overview_mode"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/sbMessageZoom"
app:layout_constraintTop_toBottomOf="@id/swEditorZoom"
app:switchPadding="12dp" />
<TextView

@ -614,6 +614,7 @@
<string name="title_advanced_attachments_alt">Show attachments after the message text</string>
<string name="title_advanced_thumbnails">Show image thumbnails after the message text</string>
<string name="title_advanced_message_text_zoom2">Default message text zoom: %1$s %%</string>
<string name="title_advanced_editor_text_zoom">Zoom message text also in the message editor</string>
<string name="title_advanced_overview_mode">Zoom original messages to fit the screen</string>
<string name="title_advanced_hyphenation">Use automatic hyphenation</string>
<string name="title_advanced_contrast">Use high contrast for message text</string>

Loading…
Cancel
Save