MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / setLegendStatus

Method setLegendStatus

pj_app/src/MainWindow.cpp:2010–2024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2008} // namespace
2009
2010void MainWindow::setLegendStatus(LegendStatus position) {
2011 legend_status_ = position;
2012 // Track the "current position" used by the icon while hidden, so
2013 // right-click → show restores the user's last corner.
2014 if (position != LegendStatus::kHidden) {
2015 previous_legend_corner_ = position;
2016 }
2017 QSettings().setValue(QStringLiteral("MainWindow.legendStatus"), static_cast<int>(legend_status_));
2018 if (button_legend_ != nullptr) {
2019 const bool visible = (position != LegendStatus::kHidden);
2020 button_legend_->setChecked(visible);
2021 button_legend_->setIconPath(legendCornerIcon(visible ? position : previous_legend_corner_));
2022 }
2023 forEachPlot([this](PlotWidget* plot) { applyLegendStatus(plot); });
2024}
2025
2026void MainWindow::applyLegendStatus(PlotWidget* plot) {
2027 if (plot == nullptr) {

Callers

nothing calls this directly

Calls 5

legendCornerIconFunction · 0.85
setIconPathMethod · 0.80
QSettingsClass · 0.70
setValueMethod · 0.45
setCheckedMethod · 0.45

Tested by

no test coverage detected