MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / HighlightSelection

Method HighlightSelection

lib/utils/temp-variable.cpp:629–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627}
628
629void TempVariableSelection::HighlightSelection(const TempVariableRef &var)
630{
631 const auto segment = var._segment.lock();
632 if (!segment) {
633 return;
634 }
635
636 const auto macro = segment->GetMacro();
637 if (!macro) {
638 return;
639 }
640
641 const MacroEdit *macroEdit = getMacroEditFromMacro(_macroEdits, macro);
642 if (!macroEdit) {
643 return;
644 }
645
646 const auto color = GetThemeTypeName() == "Dark" ? Qt::white : Qt::blue;
647
648 auto type = var.GetType();
649 switch (type) {
650 case TempVariableRef::SegmentType::NONE:
651 return;
652 case TempVariableRef::SegmentType::CONDITION:
653 macroEdit->HighlightCondition(var.GetIdx(), color);
654 return;
655 case TempVariableRef::SegmentType::ACTION:
656 macroEdit->HighlightAction(var.GetIdx(), color);
657 return;
658 case TempVariableRef::SegmentType::ELSEACTION:
659 macroEdit->HighlightElseAction(var.GetIdx(), color);
660 return;
661 default:
662 break;
663 }
664}
665
666QString TempVariableSelection::SetupInfoLabel()
667{

Callers

nothing calls this directly

Calls 8

getMacroEditFromMacroFunction · 0.85
GetIdxMethod · 0.80
GetThemeTypeNameFunction · 0.70
GetMacroMethod · 0.45
GetTypeMethod · 0.45
HighlightConditionMethod · 0.45
HighlightActionMethod · 0.45
HighlightElseActionMethod · 0.45

Tested by

no test coverage detected