mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fallback to loading theme icons from resources
Since not all platforms support theme icons, we need to pack them into resources and fallback to that resource theme. There seems to be a bug in Qt (https://bugreports.qt-project.org/browse/QTBUG-16697), thus default theme name (hicolor) does not work. So we test for 'window-close' theme icon on startup and if not found, set theme name to 'subsurface' Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c84b40664d
commit
22d56889bb
7 changed files with 17 additions and 3 deletions
|
@ -70,6 +70,9 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
m_Instance = this;
|
||||
ui.setupUi(this);
|
||||
setWindowIcon(QIcon(":subsurface-icon"));
|
||||
if (!QIcon::hasThemeIcon("window-close")) {
|
||||
QIcon::setThemeName("subsurface");
|
||||
}
|
||||
connect(ui.ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int)));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.ListWidget, SLOT(update()));
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-previous">
|
||||
<iconset theme="go-up">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
|
@ -98,7 +98,7 @@
|
|||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-next">
|
||||
<iconset theme="go-down">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue