From 344e7c7551dad35c835fa3085396ebdac0f464fc Mon Sep 17 00:00:00 2001 From: morg Date: Wed, 1 Sep 2021 21:04:01 +0200 Subject: [PATCH] Make sure the exit action is the last action in the tray menu --- qt/OpenRGBDialog2.cpp | 4 ++-- qt/OpenRGBDialog2.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qt/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2.cpp index b5fc9cc1..59338de0 100644 --- a/qt/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2.cpp @@ -343,7 +343,7 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op connect(actionLightsOff, SIGNAL(triggered()), this, SLOT(on_LightsOff())); trayIconMenu->addAction(actionLightsOff); - QAction* actionExit = new QAction( "Exit", this ); + actionExit = new QAction( "Exit", this ); connect( actionExit, SIGNAL( triggered() ), this, SLOT( on_Exit() )); trayIconMenu->addAction(actionExit); @@ -807,7 +807,7 @@ void OpenRGBDialog2::AddPlugin(OpenRGBPluginEntry* plugin) if(NewTrayMenu) { - trayIconMenu->addMenu(NewTrayMenu); + trayIconMenu->insertMenu(actionExit, NewTrayMenu); } } diff --git a/qt/OpenRGBDialog2.h b/qt/OpenRGBDialog2.h index 68ef17ac..9e8c8e75 100644 --- a/qt/OpenRGBDialog2.h +++ b/qt/OpenRGBDialog2.h @@ -104,6 +104,8 @@ private: PluginManager* plugin_manager = nullptr; + QAction* actionExit; + private slots: void on_Exit(); void on_LightsOff();