Use icon theme so we can have more than one icon size per icon
This commit is contained in:
@ -128,7 +128,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
// Add the news label to the news toolbar.
|
||||
{
|
||||
newsLabel = new QToolButton();
|
||||
newsLabel->setIcon(QIcon(":/icons/toolbar/news"));
|
||||
newsLabel->setIcon(QIcon::fromTheme("news"));
|
||||
newsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
newsLabel->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
ui->newsToolBar->insertWidget(ui->actionMoreNews, newsLabel);
|
||||
@ -203,9 +203,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
m_statusLeft = new QLabel(tr("No instance selected"), this);
|
||||
m_statusRight = new QLabel(tr("No status available"), this);
|
||||
m_statusRefresh = new QToolButton(this);
|
||||
m_statusRefresh->setCheckable(true);
|
||||
m_statusRefresh->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
m_statusRefresh->setIcon(
|
||||
QPixmap(":/icons/toolbar/refresh").scaled(16, 16, Qt::KeepAspectRatio));
|
||||
m_statusRefresh->setIcon(QIcon::fromTheme("refresh"));
|
||||
|
||||
statusBar()->addPermanentWidget(m_statusLeft, 1);
|
||||
statusBar()->addPermanentWidget(m_statusRight, 0);
|
||||
@ -241,8 +241,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
accountMenuButton->setMenu(accountMenu);
|
||||
accountMenuButton->setPopupMode(QToolButton::InstantPopup);
|
||||
accountMenuButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
accountMenuButton->setIcon(
|
||||
QPixmap(":/icons/toolbar/noaccount").scaled(48, 48, Qt::KeepAspectRatio));
|
||||
accountMenuButton->setIcon(QIcon::fromTheme("noaccount"));
|
||||
|
||||
QWidgetAction *accountMenuButtonAction = new QWidgetAction(this);
|
||||
accountMenuButtonAction->setDefaultWidget(accountMenuButton);
|
||||
@ -408,7 +407,7 @@ void MainWindow::repopulateAccountsMenu()
|
||||
|
||||
QAction *action = new QAction(tr("No Default Account"), this);
|
||||
action->setCheckable(true);
|
||||
action->setIcon(QPixmap(":/icons/toolbar/noaccount").scaled(48, 48, Qt::KeepAspectRatio));
|
||||
action->setIcon(QIcon::fromTheme("noaccount"));
|
||||
action->setData("");
|
||||
if (active_username.isEmpty())
|
||||
{
|
||||
@ -462,8 +461,7 @@ void MainWindow::activeAccountChanged()
|
||||
}
|
||||
|
||||
// Set the icon to the "no account" icon.
|
||||
accountMenuButton->setIcon(
|
||||
QPixmap(":/icons/toolbar/noaccount").scaled(48, 48, Qt::KeepAspectRatio));
|
||||
accountMenuButton->setIcon(QIcon::fromTheme("noaccount"));
|
||||
}
|
||||
|
||||
bool MainWindow::eventFilter(QObject *obj, QEvent *ev)
|
||||
@ -533,8 +531,9 @@ static QString convertStatus(const QString &status)
|
||||
|
||||
void MainWindow::reloadStatus()
|
||||
{
|
||||
m_statusRefresh->setChecked(true);
|
||||
MMC->statusChecker()->reloadStatus();
|
||||
updateStatusUI();
|
||||
//updateStatusUI();
|
||||
}
|
||||
|
||||
static QString makeStatusString(const QMap<QString, QString> statuses)
|
||||
@ -555,16 +554,7 @@ void MainWindow::updateStatusUI()
|
||||
auto statuses = statusChecker->getStatusEntries();
|
||||
|
||||
QString status = makeStatusString(statuses);
|
||||
if(statusChecker->isLoadingStatus())
|
||||
{
|
||||
m_statusRefresh->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
m_statusRefresh->setText(tr("Loading..."));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_statusRefresh->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
m_statusRefresh->setText(tr(""));
|
||||
}
|
||||
m_statusRefresh->setChecked(false);
|
||||
|
||||
m_statusRight->setText(status);
|
||||
|
||||
@ -574,8 +564,7 @@ void MainWindow::updateStatusUI()
|
||||
void MainWindow::updateStatusFailedUI()
|
||||
{
|
||||
m_statusRight->setText(makeStatusString(QMap<QString, QString>()));
|
||||
m_statusRefresh->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
m_statusRefresh->setText(tr("Failed."));
|
||||
m_statusRefresh->setChecked(false);
|
||||
|
||||
statusTimer.start(60 * 1000);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
<string>MultiMC 5</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<iconset resource="../resources/multimc/multimc.qrc">
|
||||
<normaloff>:/icons/multimc/scalable/apps/multimc.svg</normaloff>:/icons/multimc/scalable/apps/multimc.svg</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
@ -152,8 +152,7 @@
|
||||
</widget>
|
||||
<action name="actionAddInstance">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/new</normaloff>:/icons/toolbar/new</iconset>
|
||||
<iconset theme="new"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Instance</string>
|
||||
@ -167,8 +166,7 @@
|
||||
</action>
|
||||
<action name="actionViewInstanceFolder">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/viewfolder</normaloff>:/icons/toolbar/viewfolder</iconset>
|
||||
<iconset theme="viewfolder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View Instance Folder</string>
|
||||
@ -182,8 +180,7 @@
|
||||
</action>
|
||||
<action name="actionRefresh">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/refresh</normaloff>:/icons/toolbar/refresh</iconset>
|
||||
<iconset theme="refresh"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
@ -197,8 +194,7 @@
|
||||
</action>
|
||||
<action name="actionViewCentralModsFolder">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/centralmods</normaloff>:/icons/toolbar/centralmods</iconset>
|
||||
<iconset theme="centralmods"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View Central Mods Folder</string>
|
||||
@ -212,8 +208,7 @@
|
||||
</action>
|
||||
<action name="actionCheckUpdate">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/checkupdate</normaloff>:/icons/toolbar/checkupdate</iconset>
|
||||
<iconset theme="checkupdate"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check for Updates</string>
|
||||
@ -227,8 +222,7 @@
|
||||
</action>
|
||||
<action name="actionSettings">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/settings</normaloff>:/icons/toolbar/settings</iconset>
|
||||
<iconset theme="settings"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
@ -245,8 +239,7 @@
|
||||
</action>
|
||||
<action name="actionReportBug">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/bug</normaloff>:/icons/toolbar/bug</iconset>
|
||||
<iconset theme="bug"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Report a Bug</string>
|
||||
@ -260,8 +253,7 @@
|
||||
</action>
|
||||
<action name="actionMoreNews">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/news</normaloff>:/icons/toolbar/news</iconset>
|
||||
<iconset theme="news"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>More News</string>
|
||||
@ -278,8 +270,7 @@
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/about</normaloff>:/icons/toolbar/about</iconset>
|
||||
<iconset theme="about"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About MultiMC</string>
|
||||
@ -332,7 +323,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<iconset resource="../resources/instances/instances.qrc">
|
||||
<normaloff>:/icons/instances/infinity</normaloff>:/icons/instances/infinity</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -472,8 +463,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/cat</normaloff>:/icons/toolbar/cat</iconset>
|
||||
<iconset theme="cat"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Meow</string>
|
||||
@ -484,8 +474,7 @@
|
||||
</action>
|
||||
<action name="actionCopyInstance">
|
||||
<property name="icon">
|
||||
<iconset resource="../graphics.qrc">
|
||||
<normaloff>:/icons/toolbar/copy</normaloff>:/icons/toolbar/copy</iconset>
|
||||
<iconset theme="copy"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy Instance</string>
|
||||
@ -508,7 +497,9 @@
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
<include location="../graphics.qrc"/>
|
||||
<include location="../resources/instances/instances.qrc"/>
|
||||
<include location="../resources/multimc/multimc.qrc"/>
|
||||
<include location="../resources/backgrounds/backgrounds.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Reference in New Issue
Block a user