Compare commits
2 Commits
bc8d241592
...
0f2f5973fb
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0f2f5973fb | ||
![]() |
6657606e81 |
@ -73,7 +73,7 @@ struct DataTableColumn
|
||||
using renderer_t = std::function<void(const CellRendererArgs&)>;
|
||||
using comparator_t = std::function<bool(const TObject&, const TObject&)>;
|
||||
|
||||
std::string header;
|
||||
const char* header;
|
||||
renderer_t renderer;
|
||||
comparator_t comparator;
|
||||
};
|
||||
@ -85,7 +85,7 @@ struct DataTableOptions
|
||||
ImGuiTableFlags tableFlags = ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Sortable | ImGuiTableFlags_ScrollY;
|
||||
};
|
||||
|
||||
template<typename TData, typename TObject>
|
||||
template<typename TObject,typename TData>
|
||||
inline void DataTable(const char* strId, const DataTableOptions<TObject>& options, const TData& data, DataTableState& state, ImVec2 outerSize = {})
|
||||
{
|
||||
if (outerSize.y <= 0.f) {
|
||||
@ -103,7 +103,7 @@ inline void DataTable(const char* strId, const DataTableOptions<TObject>& option
|
||||
if (!column.comparator) {
|
||||
flags |= ImGuiTableColumnFlags_NoSort;
|
||||
}
|
||||
ImGui::TableSetupColumn(column.header.c_str(), flags);
|
||||
ImGui::TableSetupColumn(column.header, flags);
|
||||
}
|
||||
ImGui::TableSetupScrollFreeze(0, 1);
|
||||
ImGui::TableHeadersRow();
|
||||
|
Loading…
x
Reference in New Issue
Block a user