From 09dae4ee0b8b0f0270e7edceafaeb776ef8636f2 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Thu, 2 Nov 2017 09:08:47 +0100 Subject: [PATCH] UI item spacing on Android --- base/vulkanexamplebase.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index a063ae69..1ecc7e97 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -557,17 +557,22 @@ void VulkanExampleBase::updateOverlay() ImGui::SetNextWindowPos(ImVec2(10, 10)); ImGui::SetNextWindowSize(ImVec2(0, 0), ImGuiSetCond_FirstUseEver); ImGui::Begin("Vulkan Example", nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove); - ImGui::Text(title.c_str()); - ImGui::Text(deviceProperties.deviceName); + ImGui::TextUnformatted(title.c_str()); + ImGui::TextUnformatted(deviceProperties.deviceName); ImGui::Text("%.2f ms/frame (%.1d fps)", (frameTimer * 1000.0f), lastFPS); - ImGui::PushItemWidth(110.0f); +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 5.0f * UIOverlay->scale)); +#endif + ImGui::PushItemWidth(110.0f * UIOverlay->scale); OnUpdateUIOverlay(UIOverlay); ImGui::PopItemWidth(); +#if defined(VK_USE_PLATFORM_ANDROID_KHR) + ImGui::PopStyleVar(); +#endif ImGui::End(); ImGui::PopStyleVar(); - ImGui::Render(); UIOverlay->update();