Added guards for colorSchemechanged and Qt::ColorScheme. updated workflow to save apt cache

This commit is contained in:
Lasan Mahaliyana
2026-02-28 23:38:10 +05:30
parent 6be0557457
commit 036d541824
2 changed files with 10 additions and 0 deletions
@@ -33,6 +33,14 @@ jobs:
# Share repository cache between workflows.
repository-cache: true
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/release-nearby-qml-tray.yaml') }}
restore-keys: apt-${{ runner.os }}-
save-always: true
- name: Install Linux build dependencies
run: |
sudo apt-get update
@@ -155,10 +155,12 @@ int main(int argc, char* argv[]) {
QObject::connect(&app, &QCoreApplication::aboutToQuit, &controller,
[&controller]() { controller.stop(); });
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
QObject::connect(app.styleHints(), &QStyleHints::colorSchemeChanged, &tray,
[&tray, &resolve_tray_icon](Qt::ColorScheme) {
tray.setIcon(resolve_tray_icon());
});
#endif
tray.setContextMenu(&tray_menu);
tray.show();