refactor: use QList for the tray's Action List
This commit is contained in:
parent
8aec0dd5bb
commit
ebad12a922
3 changed files with 4 additions and 5 deletions
|
|
@ -522,10 +522,9 @@ void MainWindow::moveEvent(QMoveEvent *event)
|
||||||
|
|
||||||
void MainWindow::open()
|
void MainWindow::open()
|
||||||
{
|
{
|
||||||
|
QList<QAction *> trayActions{ui->m_pActionStartCore, ui->m_pActionStopCore, nullptr, ui->m_pActionQuit};
|
||||||
|
|
||||||
std::vector<QAction *> trayMenu = {ui->m_pActionStartCore, ui->m_pActionStopCore, nullptr, ui->m_pActionQuit};
|
m_TrayIcon.create(trayActions);
|
||||||
|
|
||||||
m_TrayIcon.create(trayMenu);
|
|
||||||
|
|
||||||
if (m_AppConfig.autoHide()) {
|
if (m_AppConfig.autoHide()) {
|
||||||
hide();
|
hide();
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ void TrayIcon::showRetryLoop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrayIcon::create(std::vector<QAction *> const &actions)
|
void TrayIcon::create(const QList<QAction *> &actions)
|
||||||
{
|
{
|
||||||
m_pTrayIconMenu = std::make_unique<QMenu>();
|
m_pTrayIconMenu = std::make_unique<QMenu>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class TrayIcon : public QObject
|
||||||
public:
|
public:
|
||||||
explicit TrayIcon() = default;
|
explicit TrayIcon() = default;
|
||||||
|
|
||||||
void create(std::vector<QAction *> const &actions);
|
void create(const QList<QAction *> &actions);
|
||||||
void setIcon(const QIcon &icon);
|
void setIcon(const QIcon &icon);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue