From a0586cda995888258426e7d7bb3c8d5df9802bc4 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Tue, 10 May 2011 18:00:15 +0200 Subject: [PATCH] Complete support for fallback icons on Windows using the Tango theme --- apps/launcher/maindialog.cpp | 48 +++++++++--------- apps/launcher/resources.qrc | 12 ++--- .../resources/icons/tango/document-new.png | Bin 0 -> 477 bytes .../resources/icons/tango/edit-copy.png | Bin 0 -> 498 bytes .../resources/icons/tango/edit-delete.png | Bin 0 -> 680 bytes .../resources/icons/tango/index.theme | 8 +++ .../resources/icons/tango/video-display.png | Bin 0 -> 2547 bytes 7 files changed, 39 insertions(+), 29 deletions(-) create mode 100644 apps/launcher/resources/icons/tango/document-new.png create mode 100644 apps/launcher/resources/icons/tango/edit-copy.png create mode 100644 apps/launcher/resources/icons/tango/edit-delete.png create mode 100644 apps/launcher/resources/icons/tango/index.theme create mode 100644 apps/launcher/resources/icons/tango/video-display.png diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index a2ab3aeb6..b5e7a491a 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -41,16 +41,11 @@ MainDialog::MainDialog() buttonBox->setStandardButtons(QDialogButtonBox::Close); buttonBox->addButton(playButton, QDialogButtonBox::AcceptRole); - //QSpacerItem *vSpacer1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - QVBoxLayout *dialogLayout = new QVBoxLayout(this); dialogLayout->addWidget(mIconWidget); - //dialogLayout->addItem(vSpacer1); dialogLayout->addWidget(groupBox); - dialogLayout->addWidget(buttonBox); - //mainLayout->addStretch(1); - //mainLayout->addSpacing(12); + setWindowTitle(tr("OpenMW Launcher")); setWindowIcon(QIcon(":/images/openmw-icon.png")); @@ -66,23 +61,30 @@ MainDialog::MainDialog() void MainDialog::createIcons() { - QListWidgetItem *configButton = new QListWidgetItem(mIconWidget); - configButton->setIcon(QIcon(":/images/openmw-icon.png")); - configButton->setText(tr("Play")); - configButton->setTextAlignment(Qt::AlignCenter); - configButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); - - QListWidgetItem *updateButton = new QListWidgetItem(mIconWidget); - updateButton->setIcon(QIcon::fromTheme("video-display")); - updateButton->setText(tr("Graphics")); - updateButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom | Qt::AlignAbsolute); - updateButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); - - QListWidgetItem *queryButton = new QListWidgetItem(mIconWidget); - queryButton->setIcon(QIcon(":/images/openmw-plugin-icon.png")); - queryButton->setText(tr("Data Files")); - queryButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom); - queryButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + if (!QIcon::hasThemeIcon("document-new")) { + QIcon::setThemeName("tango"); + } + + // We create a fallback icon because the default fallback doesn't work + QIcon graphicsIcon = QIcon(":/icons/tango/video-display.png"); + + QListWidgetItem *playButton = new QListWidgetItem(mIconWidget); + playButton->setIcon(QIcon(":/images/openmw-icon.png")); + playButton->setText(tr("Play")); + playButton->setTextAlignment(Qt::AlignCenter); + playButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + + QListWidgetItem *graphicsButton = new QListWidgetItem(mIconWidget); + graphicsButton->setIcon(QIcon::fromTheme("video-display", graphicsIcon)); + graphicsButton->setText(tr("Graphics")); + graphicsButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom | Qt::AlignAbsolute); + graphicsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + + QListWidgetItem *dataFilesButton = new QListWidgetItem(mIconWidget); + dataFilesButton->setIcon(QIcon(":/images/openmw-plugin-icon.png")); + dataFilesButton->setText(tr("Data Files")); + dataFilesButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom); + dataFilesButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); connect(mIconWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), diff --git a/apps/launcher/resources.qrc b/apps/launcher/resources.qrc index 07e6896dd..7fbf62da2 100644 --- a/apps/launcher/resources.qrc +++ b/apps/launcher/resources.qrc @@ -7,11 +7,11 @@ resources/images/openmw-header.png resources/images/playpage-background.png - - - resources/icons/video-display.png - resources/icons/document-new.png - resources/icons/edit-copy.png - resources/icons/edit-delete.png + + resources/icons/tango/index.theme + resources/icons/tango/video-display.png + resources/icons/tango/document-new.png + resources/icons/tango/edit-copy.png + resources/icons/tango/edit-delete.png diff --git a/apps/launcher/resources/icons/tango/document-new.png b/apps/launcher/resources/icons/tango/document-new.png new file mode 100644 index 0000000000000000000000000000000000000000..4c3efdd6fa334616f87698708e73b2a5111c3278 GIT binary patch literal 477 zcmV<30V4j1P);y z08cd6u?+wK010qNS#tmY3ljhU3ljkVnw%H_000McNliru)dCU@CLGhY87Tk&0cuG^ zK~y-)t&mSkTTu|je{=7RRwR8Tg3!ua7TnbCTxO{o^9{0bS-(ZzvfXzh1jK^hz)d&Z zDuq%?vQkP(T7(e)MPi%YcgKY$#u$@SdNwl*bLN~gQZARbYqeUD5tyC*%iLU>XVGu+ z%b(xnqHiDJ&%R{C8KqK5$Km{VQ!h{7Xy?43mnSQoi^k%vwzBKmGBd8L(rh*fApjsE zJ@t&)W7>Wp4I*kr6}$~JG#W`y z)G#6Xf76e95r#Ql*+}S4tk-SEw(HMMH$UOFgT8OyWIuox(>z|!eNT?Q)#FJN+p=4fyzsz3(&M5 z1Oj8QEH>2c<<$iq9`D@|1fH*+ou9fEhcV03wkV2NSzd)@nNYt}lHgoRaN9}vHG1pg5Cj3DD1s1zdc6*S;N$b%7N-)ik literal 0 HcmV?d00001 diff --git a/apps/launcher/resources/icons/tango/edit-delete.png b/apps/launcher/resources/icons/tango/edit-delete.png new file mode 100644 index 0000000000000000000000000000000000000000..ea03150a1c15ec650240042fb695e7be84bc3e28 GIT binary patch literal 680 zcmV;Z0$2TsP)&~9SKOY%f0nX^lS0%q#YP1;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