| 357 | } |
| 358 | |
| 359 | bool 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 | |
| 369 | bool buttonCommonSize( const char* label, const Vector2f& size /*= Vector2f( 0, 0 )*/, ImGuiKey key /*= ImGuiKey_None */ ) |
| 370 | { |