统一应用顶部栏与设置入口

This commit is contained in:
张家训
2026-08-01 14:59:08 +08:00
parent 0a24a9b52b
commit 145b6559b8
5 changed files with 148 additions and 24 deletions
@@ -111,9 +111,9 @@ public class WorkUtilsApplication implements CommandLineRunner {
Platform.runLater(Theme::initTheme);
// 设置导航栏刷新回调(插件管理中启用/禁用后刷新侧边栏)
settingsService.setNavItemsRefresher(items -> Platform.runLater(() -> {
settingsService.setNavItemsRefresher(ignoredItems -> Platform.runLater(() -> {
if (mainWindow != null) {
mainWindow.refreshNavItems(items);
mainWindow.refreshNavItems(buildNavItems());
// 重新绑定插件面板
for (Plugin plugin : pluginManager.getEnabledPlugins()) {
PluginDescriptor desc = plugin.getDescriptor();
@@ -131,7 +131,7 @@ public class WorkUtilsApplication implements CommandLineRunner {
CountDownLatch windowClosed = new CountDownLatch(1);
Platform.runLater(() -> {
try {
mainWindow = new MainWindow(navItems, properties);
mainWindow = new MainWindow(navItems, properties, this::openSettingsEmbedded);
mainWindow.showAndWait();
} catch (Exception e) {
log.error("主窗口创建失败", e);
@@ -164,14 +164,6 @@ public class WorkUtilsApplication implements CommandLineRunner {
));
}
// 系统设置 — 内嵌为 Tab
items.add(new MainWindow.NavItem(
"⚙️", "系统设置",
"配置系统路径、数据库连接、项目路径、多数据源、字体大小等",
this::openSettingsEmbedded,
"__settings__"
));
return items;
}