| 1137 | } |
| 1138 | |
| 1139 | void BrowserWindow::processShortenedText(std::string const& text, bool bold) { |
| 1140 | auto substrings = splitString(text); |
| 1141 | if (substrings.empty()) { |
| 1142 | return; |
| 1143 | } |
| 1144 | auto& styleRepository = StyleRepository::get(); |
| 1145 | auto textSize = ImGui::CalcTextSize(substrings.at(0).c_str()); |
| 1146 | auto needDetailButton = textSize.x > ImGui::GetContentRegionAvail().x || substrings.size() > 1; |
| 1147 | auto cursorPos = ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - styleRepository.scale(15.0f); |
| 1148 | if (bold) { |
| 1149 | ImGui::PushFont(styleRepository.getSmallBoldFont()); |
| 1150 | } |
| 1151 | AlienImGui::Text(substrings.at(0)); |
| 1152 | if (bold) { |
| 1153 | ImGui::PopFont(); |
| 1154 | } |
| 1155 | if (needDetailButton) { |
| 1156 | ImGui::SameLine(); |
| 1157 | ImGui::SetCursorPosX(cursorPos); |
| 1158 | |
| 1159 | processDetailButton(); |
| 1160 | AlienImGui::Tooltip(text.c_str(), false); |
| 1161 | } |
| 1162 | } |
| 1163 | |
| 1164 | bool BrowserWindow::processActionButton(std::string const& text) |
| 1165 | { |
nothing calls this directly
no test coverage detected