35 QColor color = ldcolor.faceColor(); |
35 QColor color = ldcolor.faceColor(); |
36 |
36 |
37 if (ldcolor == MainColor) |
37 if (ldcolor == MainColor) |
38 { |
38 { |
39 // Use the user preferences for main color here |
39 // Use the user preferences for main color here |
40 color = Config->mainColor(); |
40 color = m_config->mainColor(); |
41 color.setAlphaF (Config->mainColorAlpha()); |
41 color.setAlphaF (m_config->mainColorAlpha()); |
42 } |
42 } |
43 |
43 |
44 // Paint the icon border |
44 // Paint the icon border |
45 painter.fillRect (QRect (0, 0, size, size), ldcolor.edgeColor()); |
45 painter.fillRect (QRect (0, 0, size, size), ldcolor.edgeColor()); |
46 |
46 |
82 } |
82 } |
83 } |
83 } |
84 |
84 |
85 QColor GuiUtilities::mainColorRepresentation() |
85 QColor GuiUtilities::mainColorRepresentation() |
86 { |
86 { |
87 QColor col (Config->mainColor()); |
87 QColor col (m_config->mainColor()); |
88 |
88 |
89 if (not col.isValid()) |
89 if (not col.isValid()) |
90 return QColor (0, 0, 0); |
90 return QColor (0, 0, 0); |
91 |
91 |
92 col.setAlpha (Config->mainColorAlpha() * 255.f); |
92 col.setAlpha (m_config->mainColorAlpha() * 255.f); |
93 return col; |
93 return col; |
94 } |
94 } |
|
95 |
|
96 // |
|
97 // Returns a list of quick colors based on the configuration entry. |
|
98 // |
|
99 QList<ColorToolbarItem> GuiUtilities::loadQuickColorList() |
|
100 { |
|
101 QList<ColorToolbarItem> colors; |
|
102 |
|
103 for (QString colorname : m_config->quickColorToolbar().split (":")) |
|
104 { |
|
105 if (colorname == "|") |
|
106 colors << ColorToolbarItem::makeSeparator(); |
|
107 else |
|
108 { |
|
109 LDColor color = colorname.toInt(); |
|
110 |
|
111 if (color.isValid()) |
|
112 colors << ColorToolbarItem (color, nullptr); |
|
113 } |
|
114 } |
|
115 |
|
116 return colors; |
|
117 } |