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

Function button

source/MRViewer/MRUIStyle.cpp:359–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359bool button( const char* label, bool active, const Vector2f& size /*= Vector2f( 0, 0 )*/, ImGuiKey key /*= ImGuiKey_None */ )
360{
361 const ImGuiStyle& style = ImGui::GetStyle();
362 StyleParamHolder sh;
363 sh.addVar( ImGuiStyleVar_FramePadding, ImVec2( style.FramePadding.x, cGradientButtonFramePadding * UI::scale() ) );
364
365 bool sameKey = std::string_view( ImGui::GetKeyName( key ) ) == std::string_view( label, 1 );
366 return buttonEx( label, size, { .enabled = active, .underlineFirstLetter = sameKey } ) || ( active && checkKey( key ) );
367}
368
369bool buttonCommonSize( const char* label, const Vector2f& size /*= Vector2f( 0, 0 )*/, ImGuiKey key /*= ImGuiKey_None */ )
370{

Callers 1

saveCustomConfigModalFunction · 0.70

Calls 5

ImVec2Class · 0.85
buttonExFunction · 0.85
checkKeyFunction · 0.85
addVarMethod · 0.80
scaleFunction · 0.70

Tested by

no test coverage detected