Implement window hiding and tray icon functionality

Added methods to hide and show the Toolbox window and integrated a system tray icon with menu options, including window toggle and application quit functionality. Moved Lua script execution to occur after successful script loading. Introduced resource inclusion in the project files to support icon loading.
This commit is contained in:
2024-12-07 23:07:55 +01:00
parent 486094b540
commit 4fa4c6df6c
7 changed files with 116 additions and 16 deletions

6
inc/resource.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef RESOURCE_H
#define RESOURCE_H
#define IDI_ICON1 101 // ID für das Icon
#endif // RESOURCE_H

13
inc/toolboxTray.h Normal file
View File

@@ -0,0 +1,13 @@
#pragma once
#include "tray.h"
#include "toolboxWindow.h"
class toolboxTray {
public:
private:
};

View File

@@ -10,10 +10,13 @@ class ToolboxWindow {
public:
// Konstruktor erhält das Application-Objekt als Parameter
explicit ToolboxWindow(std::shared_ptr<saucer::application>& app);
~ToolboxWindow();
bool m_bShow = false;
// Methode zum Anzeigen des Fensters
void show();
void hide();
// Für die Fensterinitialisierung
void initialize();
@@ -35,9 +38,13 @@ public:
std::vector<ToolboxItem> m_toolboxItems;
saucer::smartview<saucer::default_serializer, hwnd_module> m_webview;
private:
std::shared_ptr<saucer::application> m_app;
saucer::smartview<saucer::default_serializer, hwnd_module> m_webview;
std::thread m_threadMonitor;
std::atomic<bool> m_runningMonitor = true;
void configureWindow();
void loadResources();
void runLuaScript();
@@ -51,4 +58,6 @@ private:
void debug_print();
void run_lua(int id);
void monitor_focus();
};