From: Flavio Tordini Date: Mon, 2 Nov 2009 20:24:39 +0000 (+0100) Subject: Better window icon X-Git-Tag: 0.8~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e9ac8e15ab1221b9573394be7b53b79bfcf59863;p=minitube Better window icon --- 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();