mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-02 14:14:10 +00:00
Fix icon not showing on Windows
For some reason QIcon::fromTheme(QStringLiteral("okular")) doesn't return the proper icon on WelcomeScreen construction, i'm guessing that's a bit too early, though haven't investigated why
This commit is contained in:
parent
e83c4f56a4
commit
137cfec205
|
@ -113,8 +113,6 @@ WelcomeScreen::WelcomeScreen(QWidget *parent)
|
|||
|
||||
setupUi(this);
|
||||
|
||||
appIcon->setPixmap(QIcon::fromTheme(QStringLiteral("okular")).pixmap(KIconLoader::SizeEnormous));
|
||||
|
||||
connect(openButton, &QPushButton::clicked, this, &WelcomeScreen::openClicked);
|
||||
connect(closeButton, &QPushButton::clicked, this, &WelcomeScreen::closeClicked);
|
||||
|
||||
|
@ -151,6 +149,15 @@ WelcomeScreen::~WelcomeScreen()
|
|||
delete m_recentsItemDelegate;
|
||||
}
|
||||
|
||||
void WelcomeScreen::showEvent(QShowEvent *e)
|
||||
{
|
||||
if (appIcon->pixmap(Qt::ReturnByValue).isNull()) {
|
||||
appIcon->setPixmap(QIcon::fromTheme(QStringLiteral("okular")).pixmap(KIconLoader::SizeEnormous));
|
||||
}
|
||||
|
||||
QWidget::showEvent(e);
|
||||
}
|
||||
|
||||
void WelcomeScreen::loadRecents()
|
||||
{
|
||||
m_recentsModel->loadEntries(KSharedConfig::openConfig()->group("Recent Files"));
|
||||
|
|
|
@ -33,6 +33,9 @@ Q_SIGNALS:
|
|||
void forgetAllRecents();
|
||||
void forgetRecentItem(QUrl const &url);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *e) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void recentsItemActivated(QModelIndex const &index);
|
||||
void recentListChanged();
|
||||
|
|
Loading…
Reference in a new issue