Change Zen Mode text

Show 'Enable Zen Mode' or 'Disable Zen Mode' instead of just the toggle.
This commit is contained in:
Vishesh Handa
2020-07-27 09:49:24 +02:00
parent 571c219711
commit 3996a9163b
3 changed files with 17 additions and 4 deletions

View File

@ -63,7 +63,9 @@ editors:
addImage: Add Image from Gallery
editFileName: Edit File Name
tags: Edit Tags
zen: Toggle Zen Mode
zen:
enable: Enable Zen Mode
disable: Disable Zen Mode
saveNoteFailed:
title: Failed to Save Note
message: We're sorry, but we cannot seem to save the Note. It has been copied to the clipboard to avoid data loss.

View File

@ -90,6 +90,7 @@ class EditorBottomBar extends StatelessWidget {
final EditorState editorState;
final NotesFolderFS parentFolder;
final bool allowEdits;
final bool zenMode;
final Func0<void> onZenModeChanged;
EditorBottomBar({
@ -97,6 +98,7 @@ class EditorBottomBar extends StatelessWidget {
@required this.editorState,
@required this.parentFolder,
@required this.allowEdits,
@required this.zenMode,
@required this.onZenModeChanged,
});
@ -118,8 +120,13 @@ class EditorBottomBar extends StatelessWidget {
onPressed: () {
showModalBottomSheet(
context: context,
builder: (c) =>
_buildBottomMenuSheet(c, editor, editorState, onZenModeChanged),
builder: (c) => _buildBottomMenuSheet(
c,
editor,
editorState,
zenMode,
onZenModeChanged,
),
elevation: 0,
);
},
@ -214,6 +221,7 @@ Widget _buildBottomMenuSheet(
BuildContext context,
Editor editor,
EditorState editorState,
bool zenModeEnabled,
Func0<void> zenModeChanged,
) {
return Container(
@ -266,7 +274,9 @@ Widget _buildBottomMenuSheet(
ProOverlay(
child: ListTile(
leading: const FaIcon(FontAwesomeIcons.peace),
title: Text(tr('editors.common.zen')),
title: Text(tr(zenModeEnabled
? 'editors.common.zen.disable'
: 'editors.common.zen.enable')),
onTap: () {
zenModeChanged();
Navigator.of(context).pop();

View File

@ -88,6 +88,7 @@ class _EditorScaffoldState extends State<EditorScaffold> {
editorState: widget.editorState,
parentFolder: widget.parentFolder,
allowEdits: widget.allowEdits,
zenMode: zenMode,
onZenModeChanged: () {
setState(() {
zenMode = !zenMode;