Tables: Moved border colors to the Style (maybe temporarily?) instead of hardcoding them.
diff --git a/imgui.cpp b/imgui.cpp
index 660e2b5..90ff9ef 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -2550,6 +2550,8 @@
case ImGuiCol_PlotHistogram: return "PlotHistogram";
case ImGuiCol_PlotHistogramHovered: return "PlotHistogramHovered";
case ImGuiCol_TableHeaderBg: return "TableHeaderBg";
+ case ImGuiCol_TableBorderStrong: return "TableBorderStrong";
+ case ImGuiCol_TableBorderLight: return "TableBorderLight";
case ImGuiCol_TableRowBg: return "TableRowBg";
case ImGuiCol_TableRowBgAlt: return "TableRowBgAlt";
case ImGuiCol_TextSelectedBg: return "TextSelectedBg";
diff --git a/imgui.h b/imgui.h
index c992086..006f4ee 100644
--- a/imgui.h
+++ b/imgui.h
@@ -1324,6 +1324,8 @@
ImGuiCol_PlotHistogram,
ImGuiCol_PlotHistogramHovered,
ImGuiCol_TableHeaderBg, // Table header background
+ ImGuiCol_TableBorderStrong, // Table outer and header borders (prefer using Alpha=1.0 here)
+ ImGuiCol_TableBorderLight, // Table inner borders (prefer using Alpha=1.0 here)
ImGuiCol_TableRowBg, // Table row background (even rows)
ImGuiCol_TableRowBgAlt, // Table row background (odd rows)
ImGuiCol_TextSelectedBg,
diff --git a/imgui_demo.cpp b/imgui_demo.cpp
index d4c8f64..10c67cb 100644
--- a/imgui_demo.cpp
+++ b/imgui_demo.cpp
@@ -3313,10 +3313,12 @@
// About Styling of tables
// Most settings are configured on a per-table basis via the flags passed to BeginTable() and TableSetupColumns APIs.
// There are however a few settings that a shared and part of the ImGuiStyle structure:
- // style.CellPadding // Padding within each cell
- // style.Colors[ImGuiCol_TableHeaderBg] // Table header background
- // style.Colors[ImGuiCol_TableRowBg] // Table row background when ImGuiTableFlags_RowBg is enabled (even rows)
- // style.Colors[ImGuiCol_TableRowBgAlt] // Table row background when ImGuiTableFlags_RowBg is enabled (odds rows)
+ // style.CellPadding // Padding within each cell
+ // style.Colors[ImGuiCol_TableHeaderBg] // Table header background
+ // style.Colors[ImGuiCol_TableBorderStrong] // Table outer and header borders
+ // style.Colors[ImGuiCol_TableBorderLight] // Table inner borders
+ // style.Colors[ImGuiCol_TableRowBg] // Table row background when ImGuiTableFlags_RowBg is enabled (even rows)
+ // style.Colors[ImGuiCol_TableRowBgAlt] // Table row background when ImGuiTableFlags_RowBg is enabled (odds rows)
// Demos
if (open_action != -1)
diff --git a/imgui_draw.cpp b/imgui_draw.cpp
index e915dd7..dfe11f4 100644
--- a/imgui_draw.cpp
+++ b/imgui_draw.cpp
@@ -223,6 +223,8 @@
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
colors[ImGuiCol_TableHeaderBg] = ImVec4(0.19f, 0.19f, 0.20f, 1.00f);
+ colors[ImGuiCol_TableBorderStrong] = ImVec4(0.31f, 0.31f, 0.35f, 1.00f); // Prefer using Alpha=1.0 here
+ colors[ImGuiCol_TableBorderLight] = ImVec4(0.23f, 0.23f, 0.25f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.07f);
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
@@ -281,6 +283,8 @@
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
colors[ImGuiCol_TableHeaderBg] = ImVec4(0.27f, 0.27f, 0.38f, 1.00f);
+ colors[ImGuiCol_TableBorderStrong] = ImVec4(0.31f, 0.31f, 0.45f, 1.00f); // Prefer using Alpha=1.0 here
+ colors[ImGuiCol_TableBorderLight] = ImVec4(0.26f, 0.26f, 0.28f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.07f);
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
@@ -340,6 +344,8 @@
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.45f, 0.00f, 1.00f);
colors[ImGuiCol_TableHeaderBg] = ImVec4(0.78f, 0.87f, 0.98f, 1.00f);
+ colors[ImGuiCol_TableBorderStrong] = ImVec4(0.57f, 0.57f, 0.64f, 1.00f); // Prefer using Alpha=1.0 here
+ colors[ImGuiCol_TableBorderLight] = ImVec4(0.68f, 0.68f, 0.74f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(0.30f, 0.30f, 0.30f, 0.07f);
colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
diff --git a/imgui_tables.cpp b/imgui_tables.cpp
index f36eccd..2bac115 100644
--- a/imgui_tables.cpp
+++ b/imgui_tables.cpp
@@ -267,13 +267,9 @@
table->HoveredColumnBorder = -1;
table->RightMostActiveColumn = -1;
- // FIXME-TABLE FIXME-STYLE: Using opaque colors facilitate overlapping elements of the grid
- //table->BorderOuterColor = GetColorU32(ImGuiCol_Separator, 1.00f);
- //table->BorderInnerColor = GetColorU32(ImGuiCol_Separator, 0.60f);
- table->BorderColorStrong = GetColorU32(ImVec4(0.31f, 0.31f, 0.35f, 1.00f));
- table->BorderColorLight = GetColorU32(ImVec4(0.23f, 0.23f, 0.25f, 1.00f));
- //table->BorderOuterColor = IM_COL32(255, 0, 0, 255);
- //table->BorderInnerColor = IM_COL32(255, 255, 0, 255);
+ // Using opaque colors facilitate overlapping elements of the grid
+ table->BorderColorStrong = GetColorU32(ImGuiCol_TableBorderStrong);
+ table->BorderColorLight = GetColorU32(ImGuiCol_TableBorderLight);
table->BorderX1 = table->InnerClipRect.Min.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : -1.0f);
table->BorderX2 = table->InnerClipRect.Max.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : +1.0f);