From e9ac8e15ab1221b9573394be7b53b79bfcf59863 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Mon, 2 Nov 2009 21:24:39 +0100 Subject: [PATCH] Better window icon --- src/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 47302b0..867fa39 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,7 +36,19 @@ int main(int argc, char **argv) { MainWindow mainWin; mainWin.setWindowTitle(Constants::APP_NAME); - mainWin.setWindowIcon(QIcon(":/images/app.png")); + + if (!QFile::exists(dataDir)) { + dataDir = qApp->applicationDirPath() + "/data"; + } + const int iconSizes [] = { 16, 22, 24, 32, 48, 64, 128, 256 }; + QIcon appIcon; + for (int i = 0; i < 8; i++) { + QString size = QString::number(iconSizes[i]); + QString png = dataDir + "/" + size + "x" + size + "/minitube.png"; + // qDebug() << png; + appIcon.addFile(png); + } + mainWin.setWindowIcon(appIcon); mainWin.show(); -- 2.39.5