This commit is contained in:
LZX committed 2026-09-11 23:57:36 +08:00
1 parent b03ece33a2
commit 54c3083c24
29 files changed
+2150 -549

No files matched your search

+28
View File
@@ -9,6 +9,8 @@ class CodeEditorAppBar extends StatelessWidget implements PreferredSizeWidget {
final VoidCallback? onSave;
final VoidCallback? onSaveAll;
final VoidCallback? onRun;
final VoidCallback? onCloseAllTabs;
final VoidCallback? onCloseProject;
final VoidCallback? onSettings;
const CodeEditorAppBar({
@@ -19,6 +21,8 @@ class CodeEditorAppBar extends StatelessWidget implements PreferredSizeWidget {
this.onSave,
this.onSaveAll,
this.onRun,
this.onCloseAllTabs,
this.onCloseProject,
this.onSettings,
});
@@ -103,6 +107,10 @@ class CodeEditorAppBar extends StatelessWidget implements PreferredSizeWidget {
onSelected: (value) {
if (value == 'save_all') {
onSaveAll?.call();
} else if (value == 'close_all_tabs') {
onCloseAllTabs?.call();
} else if (value == 'close_project') {
onCloseProject?.call();
} else if (value == 'settings') {
onSettings?.call();
}
@@ -118,6 +126,26 @@ class CodeEditorAppBar extends StatelessWidget implements PreferredSizeWidget {
],
),
),
PopupMenuItem<String>(
value: 'close_all_tabs',
child: Row(
children: [
const Icon(Icons.close_fullscreen_outlined, size: 20),
const SizedBox(width: 10),
Text(l10n.closeAllTabs),
],
),
),
PopupMenuItem<String>(
value: 'close_project',
child: Row(
children: [
const Icon(Icons.folder_off_outlined, size: 20),
const SizedBox(width: 10),
Text(l10n.closeProject),
],
),
),
PopupMenuItem<String>(
value: 'settings',
child: Row(