mirror of https://github.com/WerWolv/ImHex.git
ui: Limit window title length
This commit is contained in:
parent
48e9d3b4e9
commit
291da649c1
|
@ -1,3 +1 @@
|
|||
lib/external/** linguist-vendored
|
||||
lib/libimhex-rs/imgui-rs/** linguist-vendored
|
||||
lib/libimhex-rs/imgui-sys/** linguist-vendored
|
||||
lib/external/** linguist-vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit b2fba629663eab215f7a9bd4f5e1e944f0c4c36e
|
||||
Subproject commit 78b4e491e7c6033947e0d81e2361dc0881084e6d
|
|
@ -343,6 +343,8 @@ namespace hex {
|
|||
void Window::drawTitleBar() {
|
||||
if (!ImHexApi::System::isBorderlessWindowModeEnabled()) return;
|
||||
|
||||
auto startX = ImGui::GetCursorPosX();
|
||||
|
||||
auto buttonSize = ImVec2(g_titleBarHeight * 1.5F, g_titleBarHeight - 1);
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
|
||||
|
@ -382,7 +384,7 @@ namespace hex {
|
|||
ImGui::PopStyleColor(5);
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize(this->m_windowTitle.c_str()).x) / 2);
|
||||
ImGui::SetCursorPosX(std::max(startX, (ImGui::GetWindowWidth() - ImGui::CalcTextSize(this->m_windowTitle.c_str()).x) / 2));
|
||||
ImGui::TextUnformatted(this->m_windowTitle.c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace hex {
|
|||
if (ImHexApi::Provider::isValid()) {
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
if (!windowTitle.empty() && provider != nullptr) {
|
||||
title += " - " + windowTitle;
|
||||
title += " - " + hex::limitStringLength(windowTitle, 32);
|
||||
|
||||
if (provider->isDirty())
|
||||
title += " (*)";
|
||||
|
|
Loading…
Reference in New Issue