Add dark, light, blue and colored theme from pe.

Replaces the old dark and light themes
This commit is contained in:
Petr Mrázek
2014-10-26 23:44:20 +01:00
parent 92560bf0cd
commit 8f7aec032b
168 changed files with 4405 additions and 1902 deletions

View File

@ -501,6 +501,8 @@
<resources>
<include location="../resources/pe_dark/pe_dark.qrc"/>
<include location="../resources/pe_light/pe_light.qrc"/>
<include location="../resources/pe_blue/pe_blue.qrc"/>
<include location="../resources/pe_clolored/pe_colored.qrc"/>
<include location="../resources/multimc/multimc.qrc"/>
<include location="../resources/instances/instances.qrc"/>
</resources>

View File

@ -41,7 +41,7 @@ public:
}
virtual QIcon icon() const
{
return QIcon::fromTheme("plugin-red");
return QIcon::fromTheme("jarmods");
}
virtual QString id() const
{

View File

@ -37,7 +37,7 @@ public:
}
QIcon icon() const override
{
return QIcon::fromTheme("plugin-blue");
return QIcon::fromTheme("externaltools");
}
QString id() const override
{

View File

@ -276,6 +276,12 @@ void MultiMCPage::applySettings()
case 2:
s->set("IconTheme", "pe_light");
break;
case 3:
s->set("IconTheme", "pe_blue");
break;
case 4:
s->set("IconTheme", "pe_colored");
break;
case 0:
default:
s->set("IconTheme", "multimc");
@ -333,6 +339,14 @@ void MultiMCPage::loadSettings()
{
ui->themeComboBox->setCurrentIndex(2);
}
else if (theme == "pe_blue")
{
ui->themeComboBox->setCurrentIndex(3);
}
else if (theme == "pe_colored")
{
ui->themeComboBox->setCurrentIndex(4);
}
else
{
ui->themeComboBox->setCurrentIndex(0);

View File

@ -336,7 +336,7 @@
</item>
<item>
<property name="text">
<string>Simple</string>
<string>Simple (Dark Icons)</string>
</property>
</item>
<item>
@ -344,6 +344,16 @@
<string>Simple (Light Icons)</string>
</property>
</item>
<item>
<property name="text">
<string>Simple (Blue Icons)</string>
</property>
</item>
<item>
<property name="text">
<string>Simple (Colored Icons)</string>
</property>
</item>
</widget>
</item>
</layout>

View File

@ -26,5 +26,18 @@ void IconLabel::setIcon(QIcon icon)
void IconLabel::paintEvent(QPaintEvent *)
{
QPainter p(this);
m_icon.paint(&p, contentsRect());
QRect rect = contentsRect();
int width = rect.width();
int height = rect.height();
if(width < height)
{
rect.setHeight(width);
rect.translate(0, (height - width) / 2);
}
else if (width > height)
{
rect.setWidth(height);
rect.translate((width - height) / 2, 0);
}
m_icon.paint(&p, rect);
}