Compare commits

..

No commits in common. "3c7652efc205cb3acdb993d7eeb1e2c2d894c2cb" and "e4ae23e1147fd72f7ba50b0643307bfb7195de52" have entirely different histories.

2 changed files with 16 additions and 18 deletions

View File

@ -154,24 +154,22 @@ void PaletteEditorImGui::drawColorsEditor() noexcept {
ImGui::TableSetupColumn("Blue", ImGuiTableColumnFlags_WidthFixed, 40); ImGui::TableSetupColumn("Blue", ImGuiTableColumnFlags_WidthFixed, 40);
ImGui::TableSetupColumn("Preview", ImGuiTableColumnFlags_NoHide); ImGui::TableSetupColumn("Preview", ImGuiTableColumnFlags_NoHide);
ImGui::TableHeadersRow(); ImGui::TableHeadersRow();
if (m_page < m_pal.pages.size()) { for (auto i = 0u; auto const&c : m_pal.pages[m_page].colors) {
for (auto i = 0u; auto const &c: m_pal.pages[m_page].colors) { ig::IDStackItem const idStackItem(static_cast<int>(i));
ig::IDStackItem const idStackItem(static_cast<int>(i)); ImGui::TableNextRow();
ImGui::TableNextRow(); drawColumn(i + 1);
drawColumn(i + 1); drawColumnLeftAlign(m_pal.colorNames[i]);
drawColumnLeftAlign(m_pal.colorNames[i]); drawColumn(red16(c));
drawColumn(red16(c)); drawColumn(green16(c));
drawColumn(green16(c)); drawColumn(blue16(c));
drawColumn(blue16(c)); ImGui::TableNextColumn();
ImGui::TableNextColumn(); auto const ic = ImGui::GetColorU32({redf(c), greenf(c), bluef(c), 1});
auto const ic = ImGui::GetColorU32({redf(c), greenf(c), bluef(c), 1}); ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ic);
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ic); if (ImGui::Selectable(
if (ImGui::Selectable( "##ColorRow", i == m_selectedColorRow, ImGuiSelectableFlags_SpanAllColumns)) {
"##ColorRow", i == m_selectedColorRow, ImGuiSelectableFlags_SpanAllColumns)) { m_selectedColorRow = i;
m_selectedColorRow = i;
}
++i;
} }
++i;
} }
} }
ImGui::EndTable(); ImGui::EndTable();

View File

@ -77,7 +77,7 @@ void NewMenu::drawNewItemName(studio::StudioContext &sctx) noexcept {
drawWindow(sctx.tctx, &m_open, [this, &sctx] { drawWindow(sctx.tctx, &m_open, [this, &sctx] {
auto const typeIdx = static_cast<std::size_t>(m_selectedType); auto const typeIdx = static_cast<std::size_t>(m_selectedType);
if (typeIdx < m_types.size()) { if (typeIdx < m_types.size()) {
ig::InputText("Name", m_itemName); ImGui::InputText("Name", m_itemName.data(), m_itemName.cap());
} }
drawLastPageButtons(sctx); drawLastPageButtons(sctx);
}); });