]> git.lyx.org Git - features.git/commitdiff
Color Preferences: Disable colors rather than hide them (#10483)
authorDaniel Ramöller <d.lyx@web.de>
Sun, 6 Nov 2016 07:45:09 +0000 (08:45 +0100)
committerGuillaume MM <gm@lyx.org>
Sun, 7 May 2017 12:17:54 +0000 (14:17 +0200)
src/frontends/qt4/GuiPrefs.cpp

index 69877e38daff72356fe0fbddd29e4431baca1133..bacf17ac57de7ce9e0b97c2d2689614673588c5d 100644 (file)
@@ -1294,12 +1294,17 @@ void PrefColors::changeSysColor()
 {
        for (int row = 0 ; row < lyxObjectsLW->count() ; ++row) {
                // skip colors that are taken from system palette
-               bool const hide = syscolorsCB->isChecked()
+               bool const disable = syscolorsCB->isChecked()
                        && guiApp->colorCache().isSystem(lcolors_[row]);
 
-               lyxObjectsLW->item(row)->setHidden(hide);
-       }
+               QListWidgetItem * const item = lyxObjectsLW->item(row);
+               Qt::ItemFlags const flags = item->flags();
 
+               if (disable)
+                       item->setFlags(flags & ~Qt::ItemIsEnabled);
+               else
+                       item->setFlags(flags | Qt::ItemIsEnabled);
+       }
 }
 
 void PrefColors::changeLyxObjectsSelection()