Complete support for fallback icons on Windows using the Tango theme

actorid
Pieter van der Kloet 14 years ago
parent 7b9ce2114f
commit a0586cda99

@ -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*)),

@ -7,11 +7,11 @@
<file alias="openmw-header.png">resources/images/openmw-header.png</file>
<file alias="playpage-background.png">resources/images/playpage-background.png</file>
</qresource>
<qresource prefix="/icons">
<file alias="48x48/video-display.png">resources/icons/video-display.png</file>
<file alias="16x16/document-new.png">resources/icons/document-new.png</file>
<file alias="16x16/edit-copy.png">resources/icons/edit-copy.png</file>
<file alias="16x16/edit-delete.png">resources/icons/edit-delete.png</file>
<qresource prefix="icons/tango">
<file alias="index.theme">resources/icons/tango/index.theme</file>
<file alias="video-display.png">resources/icons/tango/video-display.png</file>
<file alias="16x16/document-new.png">resources/icons/tango/document-new.png</file>
<file alias="16x16/edit-copy.png">resources/icons/tango/edit-copy.png</file>
<file alias="16x16/edit-delete.png">resources/icons/tango/edit-delete.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

@ -0,0 +1,8 @@
[Icon Theme]
Name=Tango
Comment=Tango Theme
Inherits=default
Directories=16x16
[16x16]
Size=16

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Loading…
Cancel
Save