QTfrontend/ui/widget/mapContainer.cpp
changeset 14828 8ed0c3761640
parent 14666 95b1b9ea505a
child 14836 b9437746bffb
--- a/QTfrontend/ui/widget/mapContainer.cpp	Tue Apr 23 13:22:12 2019 +0200
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Tue Apr 23 15:32:04 2019 +0200
@@ -1215,6 +1215,15 @@
     {
         if (!selectedTheme.isNull() && !selectedTheme.isEmpty())
         {
+            // Fall back to a default theme if current theme is a background theme or hidden
+            QModelIndexList mdl = m_themeModel->match(m_themeModel->index(0), ThemeModel::ActualNameRole, m_theme);
+            if (mdl.size() > 0)
+            {
+                if ((mdl.at(0).data(ThemeModel::Roles::IsBackgroundThemeRole).toBool() == true) || (mdl.at(0).data(ThemeModel::Roles::IsHiddenRole).toBool() == true))
+                {
+                    selectedTheme = "Nature";
+                }
+            }
             setTheme(selectedTheme);
             emit themeChanged(selectedTheme);
         }