From 2470c3dfb9a58f00ee22381a2c85f30443fce7ee Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 24 Dec 2018 16:57:50 +0000 Subject: [PATCH] For dark theme also rewrite Standard library color to dark blue This changes the background colour for the Standard library to dark blue, even when loading from file. Potentially this could check for the standard #d4f8ff value before doing this in case someone had manually customised their `objects_init.xml` template but I think that would be better to wait for a proper theming solution. --- src/libgui/ProjectPanel_file_ops.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libgui/ProjectPanel_file_ops.cpp b/src/libgui/ProjectPanel_file_ops.cpp index 7b1cb79f2..984326f62 100644 --- a/src/libgui/ProjectPanel_file_ops.cpp +++ b/src/libgui/ProjectPanel_file_ops.cpp @@ -1048,6 +1048,12 @@ bool ProjectPanel::loadFromRCS(RCS *_rcs) objdb->load( Constants::getStandardObjectsFilePath(), &upgrade_predicate, Constants::getDTDDirectory()); objdb->setFileName(""); + if ( qGray(palette().color(QPalette::Window).rgba()) < 100) { + FWObject *stdLib = objdb->findObjectByName(Library::TYPENAME, "Standard"); + stdLib->setReadOnly(false); + stdLib->setStr("color", "#0a0f1f"); + objdb->setDirty(false); + } // objects from a data file are in database ndb