Page MenuHomePhabricator

Switching the icon theme on an installed MITK does not do anything
Closed, ResolvedPublic

Description

Compare these two workflows:

  1. Build MITK yourself
  2. Run Workbench
  3. Open Preferences->Themes
  4. Switch icon theme to "awesome"

-> Result: MITK now uses the awesome icons

  1. Install MITK (even the same machine that build the installer)
  2. Run Workbench
  3. Open Preferences->Themes
  4. Switch icon theme to "awesome"

-> Result: Icons do not change

This worked in MITK 2014-10, I can not test it on MITK-2015-05 as the preference dialog is broken there.

It does however work on linux and mac, so I assume it was broken by (in order of estimated likelihood)

  1. Blueberry changes
  2. CTK changes
  3. The Qt5 migration

Revisions and Commits

rMITK MITK

Event Timeline

What does "broken" mean here? How did you work through steps 1. - 4. with a broken preferences dialog?

"Broken" was fixed in T19097. Child preference pages were sometimes not added to the treelist. The above is the workflow after fixing that bug. It just means I can not test it on the binaries of the release directly, but I am going to assume the behaviour has not changed much from 2015.05.0 to the current state of 2015.05.2

It seems the themes can just not be found in the installed version.
While the icons themselves are indeed compiled into
liborg_mitk_gui_qt_ext.dll

if I add the lines

bool doesThemeHaveOpen = QIcon::hasThemeIcon("document-open");
if (doesThemeHaveOpen)
{
  std::cout << "\n\n\n\n Theme " << QIcon::themeName().toStdString() << " has icon \n\n\n\n" << std::endl;
  std::cout << "\n\n\n\n Themesearchpaths: " << QIcon::themeSearchPaths().join(";").toStdString() << "\n\n\n\n" << std::endl;
}
else
{
  std::cout << "\n\n\n\n Theme " << QIcon::themeName().toStdString() << " does not have icon \n\n\n\n" << std::endl;
  std::cout << "\n\n\n\n Themesearchpaths: " << QIcon::themeSearchPaths().join(";").toStdString() << "\n\n\n\n" << std::endl;
}

to the QmitkExtWorkbenchWindowAdvisor, I get the first output when starting from the bin directory and the second one when starting from the _CPack_Packages.
The tange icons seem to be shown because they are the default, as the tango theme cannot be found either.

Using QDir it is also possible to see that all required files are actually present in the qt resource system:

:/org_mitk_icons/icons/awesome/ contents: index.theme;scalable
:/org_mitk_icons/icons/awesome/scalable/actions/ contents: document-open.svg;document-print.svg;document-save.svg;edit-delete.svg;edit-redo.svg;edit-undo.svg;go-down.svg;go-home.svg;go-next.svg;go-previous.svg;go-up.svg;system-log-out.svg;view-list-details.svg;view-list-icons.svg;view-refresh.svg

Potentially related bug:
https://codereview.qt-project.org/#/c/114415/
however, that one should have been fixed by now. This makes the Qt5 migration a more likely cause.

It seems I have found the issue. We are currently not installing the icon engines, which results in the icons not being created and only the fallbacks being used, even though all the resources are there.

I can fix the issue by manually copying qsvgicon.dll to plugins/iconengines/