MCPcopy Create free account
hub / github.com/KDE/labplot / colorStyleChanged

Method colorStyleChanged

src/frontend/widgets/BackgroundWidget.cpp:247–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void BackgroundWidget::colorStyleChanged(int index) {
248 if (index == -1)
249 return;
250
251 auto style = (Background::ColorStyle)index;
252 if (style == Background::ColorStyle::SingleColor) {
253 ui.lFirstColor->setText(i18n("Color:"));
254 ui.lSecondColor->hide();
255 ui.kcbSecondColor->hide();
256 } else {
257 ui.lFirstColor->setText(i18n("First color:"));
258 ui.lSecondColor->show();
259 ui.kcbSecondColor->show();
260 }
261
262 CONDITIONAL_LOCK_RETURN;
263
264 int size = m_backgrounds.size();
265 if (size > 1) {
266 m_background->beginMacro(i18n("%1 elements: background color style changed", size));
267 for (auto* background : m_backgrounds)
268 background->setColorStyle(style);
269 m_background->endMacro();
270 } else
271 m_background->setColorStyle(style);
272}
273
274void BackgroundWidget::imageStyleChanged(int index) {
275 CONDITIONAL_LOCK_RETURN;

Callers

nothing calls this directly

Calls 6

showMethod · 0.80
beginMacroMethod · 0.80
setColorStyleMethod · 0.80
endMacroMethod · 0.80
setTextMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected