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

Method drawActiveListButton_

source/MRViewer/MRRibbonMenu.cpp:827–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827void RibbonMenu::drawActiveListButton_( float btnSize )
828{
829 auto activeListIt = RibbonSchemaHolder::schema().items.find( "Active Plugins List" );
830 if ( activeListIt != RibbonSchemaHolder::schema().items.end() )
831 {
832 setActiveListPos( ImGui::GetCursorScreenPos() );
833 CustomButtonParameters cParams;
834 cParams.iconType = RibbonIcons::IconType::RibbonItemIcon;
835 cParams.pushColorsCb = [] ( bool enabled, bool )->int
836 {
837 if ( !enabled )
838 {
839 ImGui::PushStyleColor( ImGuiCol_Text, ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::TextDisabled ).getUInt32() );
840 ImGui::PushStyleColor( ImGuiCol_Button, Color( 0, 0, 0, 0 ).getUInt32() );
841 ImGui::PushStyleColor( ImGuiCol_ButtonHovered, ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::ToolbarHovered ).getUInt32() );
842 ImGui::PushStyleColor( ImGuiCol_ButtonActive, ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::ToolbarClicked ).getUInt32() );
843 }
844 else
845 {
846 ImGui::PushStyleColor( ImGuiCol_Text, Color::white().getUInt32() );
847 ImGui::PushStyleColor( ImGuiCol_Button, Color( 60, 169, 20, 255 ).getUInt32() );
848 ImGui::PushStyleColor( ImGuiCol_ButtonHovered, Color( 60, 169, 20, 200 ).getUInt32() );
849 ImGui::PushStyleColor( ImGuiCol_ButtonActive, Color( 60, 169, 20, 255 ).getUInt32() );
850 }
851 return 4;
852 };
853 const ImVec2 itemSize = { btnSize, btnSize };
854 DrawButtonParams params{ DrawButtonParams::SizeType::Small, itemSize, cMiddleIconSize,DrawButtonParams::RootType::Toolbar };
855 buttonDrawer_.drawCustomButtonItem( activeListIt->second, cParams, params );
856 }
857}
858
859
860void RibbonMenu::drawActiveList_()

Callers

nothing calls this directly

Calls 6

setActiveListPosFunction · 0.85
ColorClass · 0.85
getUInt32Method · 0.80
drawCustomButtonItemMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected