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

Function buttonUniqueIcon

source/MRViewer/MRUIStyle.cpp:679–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677}
678
679bool buttonUniqueIcon(
680 const std::string& iconName,
681 const Vector2f& iconSize,
682 const std::string& text,
683 const ImVec2& buttonSize,
684 int* value,
685 int ownValue,
686 bool textUnderIcon /*= true*/,
687 ImGuiKey key /*= ImGuiKey_None*/ )
688{
689 StyleParamHolder sh;
690 if ( *value == ownValue )
691 {
692 sh.addColor( ImGuiCol_Text, Color::white() );
693 sh.addColor( ImGuiCol_Button, ColorTheme::instance().getRibbonColor( ColorTheme::RibbonColorsType::SelectedObjectFrame ) );
694 }
695 else
696 {
697 sh.addColor( ImGuiCol_Text, ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::Text ) );
698 sh.addColor( ImGuiCol_Button, ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::BackgroundSecStyle ) );
699 }
700 auto res = UI::buttonIconFlatBG( iconName, iconSize, text, buttonSize, textUnderIcon, key ) || checkKey( key );
701 if ( res )
702 value[0] = ownValue;
703
704 return res;
705}
706
707bool toggle( const char* label, bool* value )
708{

Callers

nothing calls this directly

Calls 4

instanceFunction · 0.85
buttonIconFlatBGFunction · 0.85
checkKeyFunction · 0.85
addColorMethod · 0.80

Tested by

no test coverage detected