mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 13:50:12 +08:00
update go & Qt &&
revert windows tray context menu as Qt 6.8.2 has fixed it
This commit is contained in:
parent
5bf106f25d
commit
ab22fb0d40
18
.github/workflows/build-qv2ray-cmake.yml
vendored
18
.github/workflows/build-qv2ray-cmake.yml
vendored
@ -19,19 +19,19 @@ jobs:
|
||||
include:
|
||||
- cross_os: public_res
|
||||
cross_arch: public_res
|
||||
go_version: "1.23.5"
|
||||
go_version: "1.24"
|
||||
- cross_os: windows
|
||||
cross_arch: amd64
|
||||
go_version: "1.23.5"
|
||||
go_version: "1.24"
|
||||
- cross_os: linux
|
||||
cross_arch: amd64
|
||||
go_version: "1.23.5"
|
||||
go_version: "1.24"
|
||||
- cross_os: darwin
|
||||
cross_arch: amd64
|
||||
go_version: "1.23.5"
|
||||
go_version: "1.24"
|
||||
- cross_os: darwin
|
||||
cross_arch: arm64
|
||||
go_version: "1.23.5"
|
||||
go_version: "1.24"
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@ -73,16 +73,16 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- platform: windows-latest
|
||||
qt_version: "6.8.1"
|
||||
qt_version: "6.8.2"
|
||||
target: amd64
|
||||
- platform: ubuntu-latest
|
||||
qt_version: "6.8.1"
|
||||
qt_version: "6.8.2"
|
||||
target: amd64
|
||||
- platform: macos-latest
|
||||
qt_version: "6.8.1"
|
||||
qt_version: "6.8.2"
|
||||
target: x86_64
|
||||
- platform: macos-latest
|
||||
qt_version: "6.8.1"
|
||||
qt_version: "6.8.2"
|
||||
target: arm64
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
@ -311,22 +311,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
trayMenu->addAction(ui->actionRestart_Program);
|
||||
trayMenu->addAction(ui->menu_exit);
|
||||
tray->show();
|
||||
#ifndef Q_OS_WIN
|
||||
tray->setContextMenu(trayMenu);
|
||||
#else
|
||||
// popup once so that its height is calculated
|
||||
trayMenu->popup(QCursor::pos());
|
||||
trayMenu->hide();
|
||||
#endif
|
||||
connect(tray, &QSystemTrayIcon::activated, qApp, [=](QSystemTrayIcon::ActivationReason reason) {
|
||||
if (reason == QSystemTrayIcon::Context)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
int mh = trayMenu->geometry().height();
|
||||
auto cPos = QCursor::pos();
|
||||
trayMenu->popup({cPos.x(), cPos.y()-mh});
|
||||
#endif
|
||||
}
|
||||
if (reason == QSystemTrayIcon::Trigger) {
|
||||
if (this->isVisible()) {
|
||||
hide();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user