Adding a tray icon.

This commit is contained in:
2026-04-29 14:33:43 +02:00
parent cacffbcc2a
commit 8165ee20cc
10 changed files with 462 additions and 1 deletions
+11
View File
@@ -19,6 +19,8 @@ class WebViewQt;
class WebviewWindow;
class Command;
class CommandEvent;
class QSystemTrayIcon;
class QMenu;
class Rktwebview_qt : public QObject
{
@@ -30,6 +32,8 @@ private:
int _context_counter;
QHash<int, QWebEngineProfile *> _contexts;
QHash<int, WebviewWindow *> _views;
QHash<int, QSystemTrayIcon *> _trays;
QHash<int, QMenu *> _tray_menus;
QHash<int, event_cb_t> _view_js_callbacks;
QTimer _process_events;
@@ -114,6 +118,13 @@ public:
bool rktValid(rktwebview_t wv);
public: // Tray
rktwebview_t rktTrayCreate(const char *icon_file, const char *tooltip, event_cb_t evt_cb);
result_t rktTraySetIcon(rktwebview_t tray, const char *icon_file);
result_t rktTraySetTooltip(rktwebview_t tray, const char *tooltip);
result_t rktTrayShowMessage(rktwebview_t tray, const char *title, const char *message);
result_t rktTraySetMenu(rktwebview_t tray, const char *menu_json);
public:
// Events for the backend
void pageLoaded(rktwebview_t w, bool ok);