| 373 | } |
| 374 | |
| 375 | bool buttonUnique( const char* label, int* value, int ownValue, const Vector2f& size /*= Vector2f( 0, 0 )*/, ImGuiKey key /*= ImGuiKey_None*/ ) |
| 376 | { |
| 377 | Color clearBlue = ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::SelectedObjectFrame ); |
| 378 | Color bgColor = ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::BackgroundSecStyle ); |
| 379 | Color textColor = ColorTheme::getRibbonColor( ColorTheme::RibbonColorsType::Text ); |
| 380 | |
| 381 | StyleParamHolder sh; |
| 382 | sh.addVar( ImGuiStyleVar_FramePadding, { ( cButtonPadding + 1 ) * UI::scale(), cButtonPadding * UI::scale() } ); |
| 383 | sh.addVar( ImGuiStyleVar_ItemSpacing, { ImGui::GetStyle().ItemSpacing.x * 0.7f, cDefaultItemSpacing * 2 * UI::scale() } ); |
| 384 | |
| 385 | sh.addColor( ImGuiCol_Button, *value == ownValue ? clearBlue : bgColor ); |
| 386 | sh.addColor( ImGuiCol_Text, *value == ownValue ? Color::white() : textColor ); |
| 387 | |
| 388 | ButtonCustomizationParams params; |
| 389 | params.forceImGuiBackground = true; |
| 390 | params.forceImguiTextColor = true; |
| 391 | params.underlineFirstLetter = std::string_view( ImGui::GetKeyName( key ) ) == std::string_view( label, 1 ); |
| 392 | |
| 393 | auto res = buttonEx( label, ImVec2( size.x, size.y ), params ) || checkKey( key ); |
| 394 | if ( res ) |
| 395 | value[0] = ownValue; |
| 396 | |
| 397 | return res; |
| 398 | } |
| 399 | |
| 400 | void drawPoltHorizontalAxis( const PlotAxis& plotAxis ) |
| 401 | { |