mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-03-14 13:20:59 +00:00
NOISSUE do not re-create the logo icon every time it is requested
This caused significant lag.
This commit is contained in:
parent
ddedefe6d3
commit
8b65ad3aea
@ -17,6 +17,8 @@
|
||||
#include <QFileInfo>
|
||||
#include <xdgicon.h>
|
||||
|
||||
QIcon logoIcon = QIcon(":/logo.svg");
|
||||
|
||||
IconType operator--(IconType &t, int)
|
||||
{
|
||||
IconType temp = t;
|
||||
@ -25,11 +27,8 @@ IconType operator--(IconType &t, int)
|
||||
case IconType::Builtin:
|
||||
t = IconType::ToBeDeleted;
|
||||
break;
|
||||
case IconType::Transient:
|
||||
t = IconType::Builtin;
|
||||
break;
|
||||
case IconType::FileBased:
|
||||
t = IconType::Transient;
|
||||
t = IconType::Builtin;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
@ -63,7 +62,7 @@ QIcon MMCIcon::icon() const
|
||||
}
|
||||
if(m_current_type == IconType::Builtin && m_key == "logo")
|
||||
{
|
||||
return QIcon(":/logo.svg");
|
||||
return logoIcon;
|
||||
}
|
||||
auto & icon = m_images[m_current_type].icon;
|
||||
if(!icon.isNull())
|
||||
|
@ -21,7 +21,6 @@
|
||||
enum IconType : unsigned
|
||||
{
|
||||
Builtin,
|
||||
Transient,
|
||||
FileBased,
|
||||
ICONS_TOTAL,
|
||||
ToBeDeleted
|
||||
|
Loading…
x
Reference in New Issue
Block a user