MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / modifiersToString

Function modifiersToString

source/MRViewer/MRUIStyle.cpp:948–968  ·  view source on GitHub ↗

Helper function for `checkboxOrModifier` and `radioButtonOrModifier`

Source from the content-addressed store, hash-verified

946
947// Helper function for `checkboxOrModifier` and `radioButtonOrModifier`
948static std::string modifiersToString( int modifiers )
949{
950 std::string modsText;
951 for ( const auto& [bit, name] : {
952 std::pair( ImGuiMod_Ctrl, getImGuiPrimaryCtrlName() ),
953 std::pair( ImGuiMod_Super, getSuperModName() ),
954 std::pair( ImGuiMod_Shift, "Shift" ),
955 std::pair( ImGuiMod_Alt, getAltModName() ),
956 } )
957 {
958 if ( modifiers & bit )
959 {
960 modifiers &= ~bit;
961 if ( !modsText.empty() )
962 modsText += '+';
963 modsText += name;
964 }
965 }
966 assert( modifiers == 0 && "Don't know the name of this modifier!" );
967 return modsText;
968}
969
970bool checkboxOrModifier( const char* label, CheckboxOrModifierState& value, int modifiers, int respectedModifiers, std::optional<bool> valueOverride )
971{

Callers 2

checkboxOrModifierFunction · 0.85
radioButtonOrModifierFunction · 0.85

Calls 4

getImGuiPrimaryCtrlNameFunction · 0.85
getSuperModNameFunction · 0.85
getAltModNameFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected