mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 16:46:51 +08:00
Disable undo/redo for editors where it hasn't been implemented
This commit is contained in:
@ -90,10 +90,11 @@ class EditorBottomBar extends StatelessWidget {
|
||||
maintainInteractivity: false,
|
||||
),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.undo),
|
||||
onPressed: undoAllowed ? onUndoSelected : null,
|
||||
),
|
||||
if (undoAllowed != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.undo),
|
||||
onPressed: undoAllowed ? onUndoSelected : null,
|
||||
),
|
||||
FlatButton.icon(
|
||||
icon: const Icon(Icons.folder),
|
||||
label: Text(parentFolder.publicName),
|
||||
@ -102,10 +103,11 @@ class EditorBottomBar extends StatelessWidget {
|
||||
editor.moveNoteToFolderSelected(note);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.redo),
|
||||
onPressed: redoAllowed ? onRedoSelected : null,
|
||||
),
|
||||
if (redoAllowed != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.redo),
|
||||
onPressed: redoAllowed ? onRedoSelected : null,
|
||||
),
|
||||
const Spacer(),
|
||||
menuIcon,
|
||||
],
|
||||
|
@ -185,8 +185,8 @@ class ChecklistEditorState extends State<ChecklistEditor>
|
||||
),
|
||||
onUndoSelected: _undo,
|
||||
onRedoSelected: _redo,
|
||||
undoAllowed: false,
|
||||
redoAllowed: false,
|
||||
undoAllowed: null,
|
||||
redoAllowed: null,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -108,8 +108,8 @@ class JournalEditorState extends State<JournalEditor>
|
||||
body: editor,
|
||||
onUndoSelected: _undo,
|
||||
onRedoSelected: _redo,
|
||||
undoAllowed: false,
|
||||
redoAllowed: false,
|
||||
undoAllowed: null,
|
||||
redoAllowed: null,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -142,8 +142,8 @@ class MarkdownEditorState extends State<MarkdownEditor>
|
||||
body: editor,
|
||||
onUndoSelected: _undo,
|
||||
onRedoSelected: _redo,
|
||||
undoAllowed: false,
|
||||
redoAllowed: false,
|
||||
undoAllowed: null,
|
||||
redoAllowed: null,
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user