MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / onThemeChanged

Method onThemeChanged

app/src/UI/Widgets/Plot3D.cpp:554–577  ·  view source on GitHub ↗

* @brief Updates plot colors based on the current theme. */

Source from the content-addressed store, hash-verified

552 * @brief Updates plot colors based on the current theme.
553 */
554void Widgets::Plot3D::onThemeChanged()
555{
556 const auto color = SerialStudio::getDatasetColor(m_index + 1);
557 m_lineHeadColor = color;
558
559 QColor midCurve(m_lineHeadColor);
560 m_lineHeadColor = midCurve.darker(130);
561 m_lineTailColor = midCurve.lighter(130);
562 m_lineTailColor.setAlpha(156);
563
564 // clang-format off
565 m_textColor = Misc::ThemeManager::instance().getColor("widget_text");
566 m_xAxisColor = Misc::ThemeManager::instance().getColor("plot3d_x_axis");
567 m_yAxisColor = Misc::ThemeManager::instance().getColor("plot3d_y_axis");
568 m_zAxisColor = Misc::ThemeManager::instance().getColor("plot3d_z_axis");
569 m_axisTextColor = Misc::ThemeManager::instance().getColor("plot3d_axis_text");
570 m_gridMinorColor = Misc::ThemeManager::instance().getColor("plot3d_grid_minor");
571 m_gridMajorColor = Misc::ThemeManager::instance().getColor("plot3d_grid_major");
572 m_innerBackgroundColor = Misc::ThemeManager::instance().getColor("widget_base");
573 m_outerBackgroundColor = Misc::ThemeManager::instance().getColor("widget_window");
574 // clang-format on
575
576 markDirty();
577}
578
579//--------------------------------------------------------------------------------------------------
580// State management

Callers

nothing calls this directly

Calls 1

getColorMethod · 0.80

Tested by

no test coverage detected