impr: Further cleanup hex editor footer

This commit is contained in:
WerWolv
2024-06-25 21:19:59 +02:00
parent c56667b0dd
commit 95166ccfb8
4 changed files with 60 additions and 64 deletions

View File

@@ -573,8 +573,13 @@ namespace ImGuiExt {
bool result = false;
if (IsItemHovered() && (currTime - lastMoveTime) >= 0.5 && hoveredID == lastHoveredID) {
if (!std::string_view(text).empty()) {
const auto width = 300 * hex::ImHexApi::System::getGlobalScale();
ImGui::SetNextWindowSizeConstraints(ImVec2(width / 2, 0), ImVec2(width, FLT_MAX));
const auto textWidth = CalcTextSize(text).x;
auto width = 150 * hex::ImHexApi::System::getGlobalScale();
if (textWidth < width)
width = textWidth;
ImGui::SetNextWindowSizeConstraints(ImVec2(width, 0), ImVec2(width * 2, FLT_MAX));
if (BeginTooltip()) {
if (isSeparator)
SeparatorText(text);