mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Change Zen Mode text
Show 'Enable Zen Mode' or 'Disable Zen Mode' instead of just the toggle.
This commit is contained in:
@ -63,7 +63,9 @@ editors:
|
|||||||
addImage: Add Image from Gallery
|
addImage: Add Image from Gallery
|
||||||
editFileName: Edit File Name
|
editFileName: Edit File Name
|
||||||
tags: Edit Tags
|
tags: Edit Tags
|
||||||
zen: Toggle Zen Mode
|
zen:
|
||||||
|
enable: Enable Zen Mode
|
||||||
|
disable: Disable Zen Mode
|
||||||
saveNoteFailed:
|
saveNoteFailed:
|
||||||
title: Failed to Save Note
|
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.
|
message: We're sorry, but we cannot seem to save the Note. It has been copied to the clipboard to avoid data loss.
|
||||||
|
@ -90,6 +90,7 @@ class EditorBottomBar extends StatelessWidget {
|
|||||||
final EditorState editorState;
|
final EditorState editorState;
|
||||||
final NotesFolderFS parentFolder;
|
final NotesFolderFS parentFolder;
|
||||||
final bool allowEdits;
|
final bool allowEdits;
|
||||||
|
final bool zenMode;
|
||||||
final Func0<void> onZenModeChanged;
|
final Func0<void> onZenModeChanged;
|
||||||
|
|
||||||
EditorBottomBar({
|
EditorBottomBar({
|
||||||
@ -97,6 +98,7 @@ class EditorBottomBar extends StatelessWidget {
|
|||||||
@required this.editorState,
|
@required this.editorState,
|
||||||
@required this.parentFolder,
|
@required this.parentFolder,
|
||||||
@required this.allowEdits,
|
@required this.allowEdits,
|
||||||
|
@required this.zenMode,
|
||||||
@required this.onZenModeChanged,
|
@required this.onZenModeChanged,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -118,8 +120,13 @@ class EditorBottomBar extends StatelessWidget {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) =>
|
builder: (c) => _buildBottomMenuSheet(
|
||||||
_buildBottomMenuSheet(c, editor, editorState, onZenModeChanged),
|
c,
|
||||||
|
editor,
|
||||||
|
editorState,
|
||||||
|
zenMode,
|
||||||
|
onZenModeChanged,
|
||||||
|
),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -214,6 +221,7 @@ Widget _buildBottomMenuSheet(
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
Editor editor,
|
Editor editor,
|
||||||
EditorState editorState,
|
EditorState editorState,
|
||||||
|
bool zenModeEnabled,
|
||||||
Func0<void> zenModeChanged,
|
Func0<void> zenModeChanged,
|
||||||
) {
|
) {
|
||||||
return Container(
|
return Container(
|
||||||
@ -266,7 +274,9 @@ Widget _buildBottomMenuSheet(
|
|||||||
ProOverlay(
|
ProOverlay(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: const FaIcon(FontAwesomeIcons.peace),
|
leading: const FaIcon(FontAwesomeIcons.peace),
|
||||||
title: Text(tr('editors.common.zen')),
|
title: Text(tr(zenModeEnabled
|
||||||
|
? 'editors.common.zen.disable'
|
||||||
|
: 'editors.common.zen.enable')),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
zenModeChanged();
|
zenModeChanged();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
@ -88,6 +88,7 @@ class _EditorScaffoldState extends State<EditorScaffold> {
|
|||||||
editorState: widget.editorState,
|
editorState: widget.editorState,
|
||||||
parentFolder: widget.parentFolder,
|
parentFolder: widget.parentFolder,
|
||||||
allowEdits: widget.allowEdits,
|
allowEdits: widget.allowEdits,
|
||||||
|
zenMode: zenMode,
|
||||||
onZenModeChanged: () {
|
onZenModeChanged: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
zenMode = !zenMode;
|
zenMode = !zenMode;
|
||||||
|
Reference in New Issue
Block a user