Respect DE icon for app.
This commit is contained in:
parent
6b1cd82dcb
commit
a3e6485739
4 changed files with 15 additions and 1 deletions
|
@ -58,6 +58,7 @@ FormMain::FormMain(QWidget* parent, Qt::WindowFlags f)
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
qApp->setMainForm(this);
|
qApp->setMainForm(this);
|
||||||
|
|
||||||
|
setWindowIcon(qApp->desktopAwareIcon());
|
||||||
setWindowTitle(APP_LONG_NAME);
|
setWindowTitle(APP_LONG_NAME);
|
||||||
|
|
||||||
#if defined (USE_WEBENGINE)
|
#if defined (USE_WEBENGINE)
|
||||||
|
|
|
@ -426,6 +426,17 @@ NetworkUrlInterceptor* Application::urlIinterceptor() {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QIcon Application::desktopAwareIcon() const {
|
||||||
|
auto from_theme = m_icons->fromTheme(APP_LOW_NAME);
|
||||||
|
|
||||||
|
if (!from_theme.isNull()) {
|
||||||
|
return from_theme;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return QIcon(APP_ICON_PATH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Application::showTrayIcon() {
|
void Application::showTrayIcon() {
|
||||||
// Display tray icon if it is enabled and available.
|
// Display tray icon if it is enabled and available.
|
||||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
if (SystemTrayIcon::isSystemTrayActivated()) {
|
||||||
|
|
|
@ -85,6 +85,8 @@ class RSSGUARD_DLLSPEC Application : public QtSingleApplication {
|
||||||
NetworkUrlInterceptor* urlIinterceptor();
|
NetworkUrlInterceptor* urlIinterceptor();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QIcon desktopAwareIcon() const;
|
||||||
|
|
||||||
QString tempFolder() const;
|
QString tempFolder() const;
|
||||||
QString documentsFolder() const;
|
QString documentsFolder() const;
|
||||||
QString homeFolder() const;
|
QString homeFolder() const;
|
||||||
|
|
|
@ -69,7 +69,7 @@ int main(int argc, char* argv[]) {
|
||||||
Application::setApplicationName(APP_NAME);
|
Application::setApplicationName(APP_NAME);
|
||||||
Application::setApplicationVersion(APP_VERSION);
|
Application::setApplicationVersion(APP_VERSION);
|
||||||
Application::setOrganizationDomain(APP_URL);
|
Application::setOrganizationDomain(APP_URL);
|
||||||
Application::setWindowIcon(QIcon(APP_ICON_PATH));
|
Application::setWindowIcon(qApp->desktopAwareIcon());
|
||||||
|
|
||||||
qApp->reactOnForeignNotifications();
|
qApp->reactOnForeignNotifications();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue