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:
@@ -1,13 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include "tray.h"
|
||||
#include "toolboxWindow.h"
|
||||
|
||||
class toolboxTray {
|
||||
#include <functional>
|
||||
|
||||
class toolboxTray : public tray {
|
||||
public:
|
||||
// Konstruktor mit optionalen Parametern für Icon und Tooltip
|
||||
toolboxTray(const char* icon = nullptr, const char* tooltip = nullptr) {
|
||||
this->icon = icon;
|
||||
this->tooltip = const_cast<char*>(tooltip);
|
||||
this->menu = nullptr; // Initialisiere ohne Menü (kann später gesetzt werden)
|
||||
}
|
||||
|
||||
// Funktion, um die gewünschte Aktion für den Linksklick zu setzen
|
||||
void setLeftClickAction(const std::function<void()>& action) {
|
||||
leftClickAction = action;
|
||||
}
|
||||
|
||||
// Funktion zum Setzen des Tray-Menüs
|
||||
void setTrayMenu(tray_menu* menu) {
|
||||
this->menu = menu;
|
||||
}
|
||||
|
||||
// Ereignis-Handler für Mausklicks
|
||||
void handleMouseClick(int button) {
|
||||
if (button == LEFT_CLICK && leftClickAction) {
|
||||
// Führt die Linksklick-Aktion aus
|
||||
leftClickAction();
|
||||
} else if (button == RIGHT_CLICK) {
|
||||
// Zeigt das Menü
|
||||
showMenu();
|
||||
}
|
||||
}
|
||||
|
||||
enum MouseButton {
|
||||
LEFT_CLICK = 0,
|
||||
RIGHT_CLICK = 1
|
||||
};
|
||||
private:
|
||||
std::function<void()> leftClickAction; // Aktion für Linksklick
|
||||
|
||||
// Zeigt das Menü an (Rechtsklick)
|
||||
void showMenu() {
|
||||
if (this->menu) {
|
||||
tray_update(this); // Update des Trays mit dem Menü
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -72,4 +72,8 @@ private:
|
||||
void open_file_system();
|
||||
|
||||
void SetJsonItems();
|
||||
|
||||
void openEinst();
|
||||
|
||||
void openIndex();
|
||||
};
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// Created by slave on 06.12.2024.
|
||||
//
|
||||
|
||||
#ifndef TOOLBOX_TOOLBOX_TRAY_H
|
||||
#define TOOLBOX_TOOLBOX_TRAY_H
|
||||
|
||||
#include "tray.h"
|
||||
|
||||
|
||||
class toolbox_tray {
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //TOOLBOX_TOOLBOX_TRAY_H
|
||||
Reference in New Issue
Block a user