mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 10:50:23 +08:00
fix, tray: fixed tray message popup icon
This commit is contained in:
parent
c1b3818e9c
commit
5a8decacc9
@ -1 +1 @@
|
|||||||
6049
|
6050
|
||||||
|
@ -199,12 +199,7 @@ MessageOpt Qv2rayWidgetApplication::MessageBoxAsk(QWidget *parent, const QString
|
|||||||
return MessageBoxButtonMap.key(QMessageBox::question(parent, title, text, btns));
|
return MessageBoxButtonMap.key(QMessageBox::question(parent, title, text, btns));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qv2rayWidgetApplication::ShowTrayMessage(const QString &m, const QIcon &icon, int msecs)
|
void Qv2rayWidgetApplication::ShowTrayMessage(const QString &m, int msecs)
|
||||||
{
|
{
|
||||||
hTray->showMessage("Qv2ray", m, icon, msecs);
|
hTray->showMessage("Qv2ray", m, QIcon(":/assets/icons/qv2ray.png"), msecs);
|
||||||
}
|
|
||||||
|
|
||||||
void Qv2rayWidgetApplication::ShowTrayMessage(const QString &m, QSystemTrayIcon::MessageIcon icon, int msecs)
|
|
||||||
{
|
|
||||||
hTray->showMessage("Qv2ray", m, icon, msecs);
|
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,7 @@ namespace Qv2ray
|
|||||||
void MessageBoxWarn(QWidget *parent, const QString &title, const QString &text) override;
|
void MessageBoxWarn(QWidget *parent, const QString &title, const QString &text) override;
|
||||||
void MessageBoxInfo(QWidget *parent, const QString &title, const QString &text) override;
|
void MessageBoxInfo(QWidget *parent, const QString &title, const QString &text) override;
|
||||||
MessageOpt MessageBoxAsk(QWidget *parent, const QString &title, const QString &text, const QList<MessageOpt> &buttons) override;
|
MessageOpt MessageBoxAsk(QWidget *parent, const QString &title, const QString &text, const QList<MessageOpt> &buttons) override;
|
||||||
void ShowTrayMessage(const QString &m, const QIcon &icon, int msecs = 10000);
|
void ShowTrayMessage(const QString &m, int msecs = 10000);
|
||||||
void ShowTrayMessage(const QString &m, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000);
|
|
||||||
void OpenURL(const QString &url) override;
|
void OpenURL(const QString &url) override;
|
||||||
|
|
||||||
inline QSystemTrayIcon **GetTrayIcon()
|
inline QSystemTrayIcon **GetTrayIcon()
|
||||||
|
@ -619,7 +619,7 @@ void MainWindow::OnDisconnected(const ConnectionGroupPair &id)
|
|||||||
locateBtn->setEnabled(false);
|
locateBtn->setEnabled(false);
|
||||||
if (!GlobalConfig.uiConfig.quietMode)
|
if (!GlobalConfig.uiConfig.quietMode)
|
||||||
{
|
{
|
||||||
QvWidgetApplication->ShowTrayMessage(tr("Disconnected from: ") + GetDisplayName(id.connectionId), this->windowIcon());
|
QvWidgetApplication->ShowTrayMessage(tr("Disconnected from: ") + GetDisplayName(id.connectionId));
|
||||||
}
|
}
|
||||||
qvAppTrayIcon->setToolTip(TRAY_TOOLTIP_PREFIX);
|
qvAppTrayIcon->setToolTip(TRAY_TOOLTIP_PREFIX);
|
||||||
netspeedLabel->setText("0.00 B/s" NEWLINE "0.00 B/s");
|
netspeedLabel->setText("0.00 B/s" NEWLINE "0.00 B/s");
|
||||||
@ -646,7 +646,7 @@ void MainWindow::OnConnected(const ConnectionGroupPair &id)
|
|||||||
auto name = GetDisplayName(id.connectionId);
|
auto name = GetDisplayName(id.connectionId);
|
||||||
if (!GlobalConfig.uiConfig.quietMode)
|
if (!GlobalConfig.uiConfig.quietMode)
|
||||||
{
|
{
|
||||||
QvWidgetApplication->ShowTrayMessage(tr("Connected: ") + name, this->windowIcon());
|
QvWidgetApplication->ShowTrayMessage(tr("Connected: ") + name);
|
||||||
}
|
}
|
||||||
qvAppTrayIcon->setToolTip(TRAY_TOOLTIP_PREFIX NEWLINE + tr("Connected: ") + name);
|
qvAppTrayIcon->setToolTip(TRAY_TOOLTIP_PREFIX NEWLINE + tr("Connected: ") + name);
|
||||||
connetionStatusLabel->setText(tr("Connected: ") + name);
|
connetionStatusLabel->setText(tr("Connected: ") + name);
|
||||||
|
Loading…
Reference in New Issue
Block a user