mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:29:55 +00:00
Complete support for fallback icons on Windows using the Tango theme
This commit is contained in:
parent
7b9ce2114f
commit
a0586cda99
7 changed files with 37 additions and 27 deletions
|
@ -41,16 +41,11 @@ MainDialog::MainDialog()
|
||||||
buttonBox->setStandardButtons(QDialogButtonBox::Close);
|
buttonBox->setStandardButtons(QDialogButtonBox::Close);
|
||||||
buttonBox->addButton(playButton, QDialogButtonBox::AcceptRole);
|
buttonBox->addButton(playButton, QDialogButtonBox::AcceptRole);
|
||||||
|
|
||||||
//QSpacerItem *vSpacer1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
|
||||||
|
|
||||||
QVBoxLayout *dialogLayout = new QVBoxLayout(this);
|
QVBoxLayout *dialogLayout = new QVBoxLayout(this);
|
||||||
dialogLayout->addWidget(mIconWidget);
|
dialogLayout->addWidget(mIconWidget);
|
||||||
//dialogLayout->addItem(vSpacer1);
|
|
||||||
dialogLayout->addWidget(groupBox);
|
dialogLayout->addWidget(groupBox);
|
||||||
|
|
||||||
dialogLayout->addWidget(buttonBox);
|
dialogLayout->addWidget(buttonBox);
|
||||||
//mainLayout->addStretch(1);
|
|
||||||
//mainLayout->addSpacing(12);
|
|
||||||
|
|
||||||
setWindowTitle(tr("OpenMW Launcher"));
|
setWindowTitle(tr("OpenMW Launcher"));
|
||||||
setWindowIcon(QIcon(":/images/openmw-icon.png"));
|
setWindowIcon(QIcon(":/images/openmw-icon.png"));
|
||||||
|
@ -66,23 +61,30 @@ MainDialog::MainDialog()
|
||||||
|
|
||||||
void MainDialog::createIcons()
|
void MainDialog::createIcons()
|
||||||
{
|
{
|
||||||
QListWidgetItem *configButton = new QListWidgetItem(mIconWidget);
|
if (!QIcon::hasThemeIcon("document-new")) {
|
||||||
configButton->setIcon(QIcon(":/images/openmw-icon.png"));
|
QIcon::setThemeName("tango");
|
||||||
configButton->setText(tr("Play"));
|
}
|
||||||
configButton->setTextAlignment(Qt::AlignCenter);
|
|
||||||
configButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
||||||
|
|
||||||
QListWidgetItem *updateButton = new QListWidgetItem(mIconWidget);
|
// We create a fallback icon because the default fallback doesn't work
|
||||||
updateButton->setIcon(QIcon::fromTheme("video-display"));
|
QIcon graphicsIcon = QIcon(":/icons/tango/video-display.png");
|
||||||
updateButton->setText(tr("Graphics"));
|
|
||||||
updateButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom | Qt::AlignAbsolute);
|
|
||||||
updateButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
||||||
|
|
||||||
QListWidgetItem *queryButton = new QListWidgetItem(mIconWidget);
|
QListWidgetItem *playButton = new QListWidgetItem(mIconWidget);
|
||||||
queryButton->setIcon(QIcon(":/images/openmw-plugin-icon.png"));
|
playButton->setIcon(QIcon(":/images/openmw-icon.png"));
|
||||||
queryButton->setText(tr("Data Files"));
|
playButton->setText(tr("Play"));
|
||||||
queryButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom);
|
playButton->setTextAlignment(Qt::AlignCenter);
|
||||||
queryButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
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,
|
connect(mIconWidget,
|
||||||
SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
|
SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
<file alias="openmw-header.png">resources/images/openmw-header.png</file>
|
<file alias="openmw-header.png">resources/images/openmw-header.png</file>
|
||||||
<file alias="playpage-background.png">resources/images/playpage-background.png</file>
|
<file alias="playpage-background.png">resources/images/playpage-background.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/icons">
|
<qresource prefix="icons/tango">
|
||||||
|
<file alias="index.theme">resources/icons/tango/index.theme</file>
|
||||||
<file alias="48x48/video-display.png">resources/icons/video-display.png</file>
|
<file alias="video-display.png">resources/icons/tango/video-display.png</file>
|
||||||
<file alias="16x16/document-new.png">resources/icons/document-new.png</file>
|
<file alias="16x16/document-new.png">resources/icons/tango/document-new.png</file>
|
||||||
<file alias="16x16/edit-copy.png">resources/icons/edit-copy.png</file>
|
<file alias="16x16/edit-copy.png">resources/icons/tango/edit-copy.png</file>
|
||||||
<file alias="16x16/edit-delete.png">resources/icons/edit-delete.png</file>
|
<file alias="16x16/edit-delete.png">resources/icons/tango/edit-delete.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
BIN
apps/launcher/resources/icons/tango/document-new.png
Normal file
BIN
apps/launcher/resources/icons/tango/document-new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 477 B |
BIN
apps/launcher/resources/icons/tango/edit-copy.png
Normal file
BIN
apps/launcher/resources/icons/tango/edit-copy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 498 B |
BIN
apps/launcher/resources/icons/tango/edit-delete.png
Normal file
BIN
apps/launcher/resources/icons/tango/edit-delete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 680 B |
8
apps/launcher/resources/icons/tango/index.theme
Normal file
8
apps/launcher/resources/icons/tango/index.theme
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[Icon Theme]
|
||||||
|
Name=Tango
|
||||||
|
Comment=Tango Theme
|
||||||
|
Inherits=default
|
||||||
|
Directories=16x16
|
||||||
|
|
||||||
|
[16x16]
|
||||||
|
Size=16
|
BIN
apps/launcher/resources/icons/tango/video-display.png
Normal file
BIN
apps/launcher/resources/icons/tango/video-display.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
Loading…
Reference in a new issue