132 /* |
132 /* |
133 * loadQuickColorList |
133 * loadQuickColorList |
134 * |
134 * |
135 * Returns a list of contents for the color toolbar, based on configuration. |
135 * Returns a list of contents for the color toolbar, based on configuration. |
136 */ |
136 */ |
137 QVector<ColorToolbarItem> GuiUtilities::loadQuickColorList() |
137 QVector<LDColor> GuiUtilities::loadQuickColorList() |
138 { |
138 { |
139 QVector<ColorToolbarItem> colors; |
139 return config::quickColorToolbar(); |
140 |
|
141 for (QString colorName : config::quickColorToolbar().split(":")) |
|
142 { |
|
143 if (colorName == "|") |
|
144 { |
|
145 colors << ColorToolbarItem::makeSeparator(); |
|
146 } |
|
147 else |
|
148 { |
|
149 LDColor color {colorName.toInt()}; |
|
150 |
|
151 if (color.isValid()) |
|
152 colors.append(ColorToolbarItem {color}); |
|
153 } |
|
154 } |
|
155 |
|
156 return colors; |
|
157 } |
140 } |
158 |
141 |
159 |
142 |
160 void setColorButton(QPushButton* button, LDColor color) |
143 void setColorButton(QPushButton* button, LDColor color) |
161 { |
144 { |