Add "Einstellungen" interface and improve Lua execution flow

Introduced a new "Einstellungen" (Settings) interface with an HTML page and integrated it into the application workflow. Enhanced Lua execution handling with optional console output and improved UI updates. Adjusted installer UI to better align buttons and icons with user experience.
This commit is contained in:
2024-12-16 23:16:22 +01:00
parent 5b61db140e
commit f5dd50a9f7
13 changed files with 379 additions and 64 deletions

View File

@@ -1,20 +1,21 @@
#include <saucer/app.hpp>
#include "toolboxWindow.h"
#include "tray.h"
#include "toolboxTray.h"
#include "resource.h"
ToolboxWindow* g_toolboxWindow = nullptr;
void on_quit(struct tray_menu *item) {
tray_exit();
}
void on_click(struct tray_menu *item) {
if (g_toolboxWindow->m_bShow)
g_toolboxWindow->hide();
else
g_toolboxWindow->show();
void on_click(struct tray_menu *item = nullptr) {
if (g_toolboxWindow) {
if (g_toolboxWindow->m_bShow)
g_toolboxWindow->hide();
else
g_toolboxWindow->show();
}
}
int start(){
@@ -33,17 +34,24 @@ int start(){
HICON hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1));
struct tray_menu tray_menu_items[] = {
{"<EFBFBD>ffnen", 0, 0, NULL, on_click, 0},
{"-", 0, 0, NULL, nullptr, 0},
{"Beenden", 0, 0, NULL, on_quit, 0},
{nullptr, 0, 0, NULL, nullptr, 0}
// Tray-Men<65> definieren
tray_menu tray_menu_items[] = {
{"<EFBFBD>ffnen", 0, 0, 0, on_click, nullptr},
{"-", 0, 0, 0, nullptr, nullptr}, // Separator
{"Beenden", 0, 0, 0, on_quit, nullptr},
{nullptr, 0, 0, 0, nullptr, nullptr} // Ende des Men<65>s
};
struct tray tray = {
.icon = (char*)"toolbox.ico",
.menu = tray_menu_items
};
// ToolboxTray erstellen
toolboxTray tray("toolbox.ico", "Toolbox Application Tray");
// Linksklick-Aktion registrieren
tray.setLeftClickAction([&]() {
on_click(nullptr); // Ruft die Funktion ohne Men<65>eintrag auf
});
// Tray-Men<65> registrieren
tray.setTrayMenu(tray_menu_items);
if (tray_init(&tray) != 0) {
fprintf(stderr, "Fehler beim Initialisieren des Tray-Icons\n");