diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp b/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp index 383cd61d..52bbd234 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp +++ b/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.cpp @@ -65,6 +65,11 @@ ox::Error PaletteEditorImGui::saveItem() noexcept { return m_sctx.project->writeObj(itemPath(), m_pal, ox::ClawFormat::Organic); } +void PaletteEditorImGui::drawColumnLeftAlign(ox::CStringView txt) noexcept { + ImGui::TableNextColumn(); + ImGui::Text("%s", txt.c_str()); +} + void PaletteEditorImGui::drawColumn(ox::CStringView txt) noexcept { ImGui::TableNextColumn(); ImGui::SetCursorPosX( @@ -119,20 +124,22 @@ void PaletteEditorImGui::drawColorsEditor() noexcept { * static_cast(colorEditor); ImGui::BeginTable( "Colors", - 5, + 6, tableFlags, ImVec2(tblWidth, colorsSz.y - (toolbarHeight + 5))); { ImGui::TableSetupColumn("Idx", ImGuiTableColumnFlags_WidthFixed, 25); - ImGui::TableSetupColumn("Red", ImGuiTableColumnFlags_WidthFixed, 50); - ImGui::TableSetupColumn("Green", ImGuiTableColumnFlags_WidthFixed, 50); - ImGui::TableSetupColumn("Blue", ImGuiTableColumnFlags_WidthFixed, 50); - ImGui::TableSetupColumn("Color Preview", ImGuiTableColumnFlags_NoHide); + ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, 100); + ImGui::TableSetupColumn("Red", ImGuiTableColumnFlags_WidthFixed, 40); + ImGui::TableSetupColumn("Green", ImGuiTableColumnFlags_WidthFixed, 40); + ImGui::TableSetupColumn("Blue", ImGuiTableColumnFlags_WidthFixed, 40); + ImGui::TableSetupColumn("Preview", ImGuiTableColumnFlags_NoHide); ImGui::TableHeadersRow(); for (auto i = 0u; auto const&c : m_pal.pages[m_page]) { ImGui::PushID(static_cast(i)); ImGui::TableNextRow(); drawColumn(i + 1); + drawColumnLeftAlign(m_pal.colorInfo[i].name); drawColumn(red16(c)); drawColumn(green16(c)); drawColumn(blue16(c)); diff --git a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.hpp b/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.hpp index 649f32ae..c448ec2a 100644 --- a/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.hpp +++ b/src/nostalgia/modules/core/src/studio/paletteeditor/paletteeditor-imgui.hpp @@ -31,6 +31,8 @@ class PaletteEditorImGui: public studio::Editor { ox::Error saveItem() noexcept final; private: + static void drawColumnLeftAlign(ox::CStringView txt) noexcept; + static void drawColumn(ox::CStringView txt) noexcept; static void drawColumn(ox::Integer_c auto i) noexcept {