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

Method loadConfig

src/frontend/widgets/LabelWidget.cpp:1566–1596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1564}
1565
1566void LabelWidget::loadConfig(KConfigGroup& group) {
1567 if (!m_label)
1568 return;
1569
1570 // Text
1571 ui.cbMode->setCurrentIndex(group.readEntry("Mode", static_cast<int>(m_label->text().mode)));
1572 this->modeChanged(ui.cbMode->currentIndex());
1573 // load font (only included in label text)
1574 ui.kfontRequester->setFont(group.readEntry("Font", ui.teLabel->currentFont()));
1575 ui.kcbFontColor->setColor(group.readEntry("FontColor", m_label->fontColor()));
1576 ui.kcbBackgroundColor->setColor(group.readEntry("BackgroundColor", m_label->backgroundColor()));
1577 ui.kfontRequesterTeX->setFont(group.readEntry("TeXFont", m_label->teXFont()));
1578 ui.sbFontSize->setValue(group.readEntry("TeXFontSize", m_label->teXFont().pointSize()));
1579
1580 // Geometry
1581 ui.cbPositionX->setCurrentIndex(group.readEntry("PositionX", (int)m_label->position().horizontalPosition));
1582 ui.sbPositionX->setValue(Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry("PositionXValue", m_label->position().point.x()), m_units), m_worksheetUnit));
1583 ui.cbPositionY->setCurrentIndex(group.readEntry("PositionY", (int)m_label->position().verticalPosition));
1584 ui.sbPositionY->setValue(Worksheet::convertFromSceneUnits(roundSceneValue(group.readEntry("PositionYValue", m_label->position().point.y()), m_units), m_worksheetUnit));
1585
1586 if (!m_axesList.isEmpty()) {
1587 ui.sbOffsetX->setValue(std::round(Worksheet::convertFromSceneUnits(group.readEntry("OffsetX", m_axesList.first()->titleOffsetX()), Worksheet::Unit::Point)));
1588 ui.sbOffsetY->setValue(std::round(Worksheet::convertFromSceneUnits(group.readEntry("OffsetY", m_axesList.first()->titleOffsetY()), Worksheet::Unit::Point)));
1589 }
1590 ui.cbHorizontalAlignment->setCurrentIndex(group.readEntry("HorizontalAlignment", (int)m_label->horizontalAlignment()));
1591 ui.cbVerticalAlignment->setCurrentIndex(group.readEntry("VerticalAlignment", (int)m_label->verticalAlignment()));
1592 ui.sbRotation->setValue(group.readEntry("Rotation", m_label->rotationAngle()));
1593
1594 // Border
1595 ui.cbBorderShape->setCurrentIndex(ui.cbBorderShape->findData(group.readEntry("BorderShape").toInt()));
1596}
1597
1598void LabelWidget::saveConfig(KConfigGroup& group) {
1599 // Text

Callers

nothing calls this directly

Calls 15

modeChangedMethod · 0.95
fontColorMethod · 0.80
backgroundColorMethod · 0.80
positionMethod · 0.80
xMethod · 0.80
horizontalAlignmentMethod · 0.80
verticalAlignmentMethod · 0.80
setCurrentIndexMethod · 0.45
textMethod · 0.45
currentIndexMethod · 0.45
setFontMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected