Size of animation controller editor is now adjustable

This commit is contained in:
Kah Wei 2023-03-06 11:47:30 +08:00
parent 066d060b29
commit f8cc1fe2dc
1 changed files with 6 additions and 4 deletions

View File

@ -69,16 +69,18 @@ namespace SHADE
if (controllerData.has_value()) if (controllerData.has_value())
{ {
// Calculate size of each portion // Calculate size of each portion
const float MAIN_PANEL_COLUMN_WIDTH = ImGui::GetWindowSize().x * 0.7f; const float WINDOW_WIDTH = ImGui::GetWindowSize().x;
const float MAIN_PANEL_COLUMN_WIDTH = WINDOW_WIDTH * 0.7f;
const float SIDE_PANELS_COLUMN_WIDTH = (WINDOW_WIDTH - MAIN_PANEL_COLUMN_WIDTH) * 0.5f;
// Draw // Draw
drawActiveMenuBar(); drawActiveMenuBar();
ImGui::BeginTable("base_table", 3); ImGui::BeginTable("base_table", 3, ImGuiTableFlags_Resizable);
{ {
// Set up Columns // Set up Columns
ImGui::TableSetupColumn("params_panel", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("params_panel", ImGuiTableColumnFlags_WidthStretch, SIDE_PANELS_COLUMN_WIDTH);
ImGui::TableSetupColumn("main_panel", ImGuiTableColumnFlags_WidthFixed, MAIN_PANEL_COLUMN_WIDTH); ImGui::TableSetupColumn("main_panel", ImGuiTableColumnFlags_WidthFixed, MAIN_PANEL_COLUMN_WIDTH);
ImGui::TableSetupColumn("prop_panel", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("prop_panel", ImGuiTableColumnFlags_WidthStretch, SIDE_PANELS_COLUMN_WIDTH);
// Render contents // Render contents
ImGui::TableNextRow(); ImGui::TableNextRow();