From 749b0f39d0ab3364f822238ac6bee834dd5d25d6 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 14 Mar 2022 14:54:45 -0500 Subject: [PATCH] GUI: better order display - UNTESTED --- src/gui/orders.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/orders.cpp b/src/gui/orders.cpp index 22bd7e0d1..fc4972e9d 100644 --- a/src/gui/orders.cpp +++ b/src/gui/orders.cpp @@ -39,7 +39,10 @@ void FurnaceGUI::drawOrders() { for (int i=0; igetTotalChannelCount(); i++) { if (e->song.chanShow[i]) displayChans++; } - if (ImGui::BeginTable("OrdersTable",1+displayChans,ImGuiTableFlags_SizingStretchSame|ImGuiTableFlags_ScrollX|ImGuiTableFlags_ScrollY)) { + ImGui::PushFont(patFont); + bool tooSmall=(displayChans>((ImGui::GetWindowSize().x-24.0f*dpiScale)/ImGui::CalcTextSize("AAA").x)); + ImGui::PopFont(); + if (ImGui::BeginTable("OrdersTable",1+displayChans,(tooSmall?ImGuiTableFlags_SizingFixedFit:ImGuiTableFlags_SizingStretchSame)|ImGuiTableFlags_ScrollX|ImGuiTableFlags_ScrollY)) { ImGui::PushFont(patFont); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing,prevSpacing); ImGui::TableSetupScrollFreeze(1,1); @@ -246,4 +249,4 @@ void FurnaceGUI::drawOrders() { if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_ORDERS; oldOrder1=e->getOrder(); ImGui::End(); -} \ No newline at end of file +}