Line data Source code
1 : // DUNE DAQ modification notice:
2 : // This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3 : // Fork baseline commit: dbe-02-12-17 (2022-05-12).
4 : // Renamed since fork: no.
5 :
6 : /// Including DBE
7 : #include "dbe/StyleUtility.hpp"
8 :
9 : QColor dbe::StyleUtility::TableColorAttribute;
10 : QColor dbe::StyleUtility::TableAttributeBackground;
11 :
12 : QColor dbe::StyleUtility::FileReadOnlyForeground;
13 : QColor dbe::StyleUtility::FileReadOnlyBackground;
14 :
15 : QColor dbe::StyleUtility::TableColorRelationship;
16 : QColor dbe::StyleUtility::TableRelationshipBackground;
17 :
18 : QColor dbe::StyleUtility::ObjectForeground;
19 : QColor dbe::StyleUtility::ObjectBackground;
20 :
21 : QColor dbe::StyleUtility::DefaultValueBackground;
22 :
23 : QPalette dbe::StyleUtility::AlertStatusBarPallete;
24 : QPalette dbe::StyleUtility::AlertStatusBarPalleteWindow;
25 : QPalette dbe::StyleUtility::WarningStatusBarPallete;
26 : QPalette dbe::StyleUtility::WarningStatusBarPalleteWindow;
27 : QPalette dbe::StyleUtility::PaleGreenPalleteButton;
28 : QPalette dbe::StyleUtility::LoadedDefault;
29 :
30 : void
31 0 : dbe::StyleUtility::InitColorManagement()
32 : {
33 0 : QSettings settings;
34 :
35 0 : settings.beginGroup("attribute");
36 0 : if (!settings.contains("foreground")) {
37 0 : settings.setValue("foreground", QColor("#1B676B"));
38 : }
39 0 : if (!settings.contains("background")) {
40 0 : settings.setValue("background", QColor("#ffffff"));
41 : }
42 0 : if (!settings.contains("default-background")) {
43 0 : settings.setValue("default-background", QColor("#b8f4ff"));
44 : }
45 :
46 0 : DefaultValueBackground = settings.value("default-background").value<QColor>();
47 0 : TableColorAttribute = settings.value("foreground").value<QColor>();
48 0 : TableAttributeBackground = settings.value("background").value<QColor>();
49 0 : settings.endGroup();
50 :
51 0 : settings.beginGroup("relationship");
52 0 : if (!settings.contains("foreground")) {
53 0 : settings.setValue("foreground", QColor("#AD4713"));
54 : }
55 0 : if (!settings.contains("background")) {
56 0 : settings.setValue("background", QColor(Qt::white));
57 : }
58 0 : TableColorRelationship = settings.value("foreground").value<QColor>();
59 0 : TableRelationshipBackground = settings.value("background").value<QColor>();
60 0 : settings.endGroup();
61 :
62 0 : settings.beginGroup("readonly");
63 0 : if (!settings.contains("background")) {
64 0 : settings.setValue("background", QColor(Qt::lightGray));
65 : }
66 0 : if (!settings.contains("foreground")) {
67 0 : settings.setValue("foreground", QColor(Qt::darkRed));
68 : }
69 0 : FileReadOnlyForeground = settings.value("foreground").value<QColor>();
70 0 : FileReadOnlyBackground = settings.value("background").value<QColor>();
71 0 : settings.endGroup();
72 :
73 0 : settings.beginGroup("object");
74 0 : if (!settings.contains("foreground")) {
75 0 : settings.setValue("foreground", QColor(Qt::blue));
76 : }
77 0 : if (!settings.contains("background")) {
78 0 : settings.setValue("background", QColor(Qt::white));
79 : }
80 0 : ObjectForeground = settings.value("foreground").value<QColor>();
81 0 : ObjectBackground = settings.value("background").value<QColor>();
82 0 : settings.endGroup();
83 :
84 0 : AlertStatusBarPallete.setColor(QPalette::Active, QPalette::Base, QColor("red"));
85 0 : AlertStatusBarPallete.setColor(QPalette::Inactive, QPalette::Base, QColor("red"));
86 0 : WarningStatusBarPallete.setColor(QPalette::Active, QPalette::Base, QColor("yellow"));
87 0 : WarningStatusBarPallete.setColor(QPalette::Inactive, QPalette::Base, QColor("yellow"));
88 0 : AlertStatusBarPalleteWindow.setColor(QPalette::Active, QPalette::Window, QColor("red"));
89 0 : AlertStatusBarPalleteWindow.setColor(QPalette::Inactive, QPalette::Window, QColor("red"));
90 0 : WarningStatusBarPalleteWindow.setColor(QPalette::Active, QPalette::Window, QColor("yellow"));
91 0 : WarningStatusBarPalleteWindow.setColor(QPalette::Inactive, QPalette::Window, QColor("yellow"));
92 0 : LoadedDefault.setColor(QPalette::Active, QPalette::Base, DefaultValueBackground);
93 0 : LoadedDefault.setColor(QPalette::Inactive, QPalette::Base, DefaultValueBackground);
94 :
95 0 : PaleGreenPalleteButton.setColor(QPalette::Active, QPalette::Button, QColor::fromRgb(190, 238, 158));
96 0 : PaleGreenPalleteButton.setColor(QPalette::Inactive, QPalette::Button, QColor::fromRgb(190, 238, 158));
97 0 : }
|