| 1151 | } |
| 1152 | |
| 1153 | int CUi::DoButton_FontIcon(CButtonContainer *pButtonContainer, const char *pText, int Checked, const CUIRect *pRect, const unsigned Flags, int Corners, bool Enabled, const std::optional<ColorRGBA> ButtonColor) |
| 1154 | { |
| 1155 | pRect->Draw(ButtonColor.value_or(ColorRGBA(1.0f, 1.0f, 1.0f, (Checked ? 0.1f : 0.5f) * ButtonColorMul(pButtonContainer))), Corners, 5.0f); |
| 1156 | |
| 1157 | TextRender()->SetFontPreset(EFontPreset::ICON_FONT); |
| 1158 | TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING); |
| 1159 | TextRender()->TextOutlineColor(TextRender()->DefaultTextOutlineColor()); |
| 1160 | TextRender()->TextColor(TextRender()->DefaultTextColor()); |
| 1161 | |
| 1162 | CUIRect Label; |
| 1163 | pRect->HMargin(2.0f, &Label); |
| 1164 | DoLabel(&Label, pText, Label.h * ms_FontmodHeight, TEXTALIGN_MC); |
| 1165 | |
| 1166 | if(!Enabled) |
| 1167 | { |
| 1168 | TextRender()->TextColor(ColorRGBA(1.0f, 0.0f, 0.0f, 1.0f)); |
| 1169 | TextRender()->TextOutlineColor(ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f)); |
| 1170 | DoLabel(&Label, FontIcon::SLASH, Label.h * ms_FontmodHeight, TEXTALIGN_MC); |
| 1171 | TextRender()->TextOutlineColor(TextRender()->DefaultTextOutlineColor()); |
| 1172 | TextRender()->TextColor(TextRender()->DefaultTextColor()); |
| 1173 | } |
| 1174 | |
| 1175 | TextRender()->SetRenderFlags(0); |
| 1176 | TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); |
| 1177 | |
| 1178 | return DoButtonLogic(pButtonContainer, Checked, pRect, Flags); |
| 1179 | } |
| 1180 | |
| 1181 | int CUi::DoButton_PopupMenu(CButtonContainer *pButtonContainer, const char *pText, const CUIRect *pRect, float Size, int Align, float Padding, bool TransparentInactive, bool Enabled, const std::optional<ColorRGBA> ButtonColor) |
| 1182 | { |
no test coverage detected