plusui-native 0.2.105 → 0.2.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/assets/icon-generator.js +251 -251
- package/src/assets/resource-embedder.js +351 -351
- package/src/index.js +1358 -1354
- package/templates/base/assets/README.md +88 -88
- package/templates/manager.js +288 -275
- package/templates/react/frontend/vite.config.ts +1 -1
- package/templates/react/main.cpp.template +5 -7
- package/templates/solid/frontend/vite.config.ts +1 -1
- package/templates/solid/main.cpp.template +5 -7
|
@@ -23,7 +23,6 @@ using json = nlohmann::json;
|
|
|
23
23
|
struct AppConfig {
|
|
24
24
|
std::string name = "{{PROJECT_NAME}}";
|
|
25
25
|
std::string version = "0.1.0";
|
|
26
|
-
bool showWhenFrontendReady = true; // Hides blank webview until Solid mounts
|
|
27
26
|
} appConfig;
|
|
28
27
|
|
|
29
28
|
struct WindowConfig {
|
|
@@ -38,6 +37,7 @@ struct WindowConfig {
|
|
|
38
37
|
bool devTools = true;
|
|
39
38
|
bool scrollbars = false;
|
|
40
39
|
bool fileDrop = true; // Enable file drop from OS to webview
|
|
40
|
+
bool tray = true; // Enable system tray
|
|
41
41
|
std::string route = "/"; // Starting route
|
|
42
42
|
int devServerPort = 5173;
|
|
43
43
|
} windowConfig;
|
|
@@ -80,30 +80,28 @@ int main() {
|
|
|
80
80
|
.skipTaskbar(!windowConfig.showInTaskbar)
|
|
81
81
|
.scrollbars(windowConfig.scrollbars)
|
|
82
82
|
.fileDrop(windowConfig.fileDrop)
|
|
83
|
+
.tray(windowConfig.tray)
|
|
83
84
|
.centered(true)
|
|
84
85
|
.build();
|
|
85
86
|
|
|
86
87
|
// Icon from embedded assets
|
|
87
88
|
#ifdef ASSET_ICON_PNG
|
|
88
89
|
mainWindow.setIconFromMemory(ASSET_ICON_PNG, ASSET_ICON_PNG_LEN);
|
|
90
|
+
mainWindow.setTrayIconFromMemory(ASSET_ICON_PNG, ASSET_ICON_PNG_LEN);
|
|
89
91
|
#endif
|
|
90
92
|
|
|
91
|
-
// Hide until frontend signals it's ready (no blank flash)
|
|
92
|
-
if (appConfig.showWhenFrontendReady) {
|
|
93
|
-
mainWindow.hide();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
93
|
// Wire up connect system (for custom frontend ↔ backend communication)
|
|
97
94
|
// Run `plusui connect` after adding custom connect methods
|
|
98
95
|
static Connect conn;
|
|
99
96
|
bindConnect(mainWindow, conn);
|
|
100
97
|
|
|
101
|
-
// Load frontend
|
|
98
|
+
// Load frontend then show.
|
|
102
99
|
#ifdef PLUSUI_DEV_MODE
|
|
103
100
|
mainWindow.navigate("http://localhost:" + std::to_string(windowConfig.devServerPort) + windowConfig.route);
|
|
104
101
|
#else
|
|
105
102
|
mainWindow.loadFile("frontend/dist/index.html" + (windowConfig.route == "/" ? "" : "#" + windowConfig.route));
|
|
106
103
|
#endif
|
|
104
|
+
mainWindow.show();
|
|
107
105
|
|
|
108
106
|
App runtime;
|
|
109
107
|
runtime.run();
|