display sudoku inner grids
All checks were successful
Linux arm64 / Build (push) Successful in 23m58s

This commit is contained in:
2025-01-24 22:42:23 +01:00
parent 4b4ed76eb8
commit e64fa97573

View File

@@ -67,6 +67,9 @@ public class SudokuView extends BaseView {
@Override
public void render() {
final Sudoku sudoku = doku.getSubGrid(0);
ImGui.pushStyleVar(ImGuiStyleVar.FrameBorderSize, 2.0f);
ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing, new ImVec2(0.0f, 0.0f));
ImGui.pushStyleColor(ImGuiCol.Border, new ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
for (int y = 0; y < sudoku.getSize(); y++) {
for (int x = 0; x < sudoku.getSize(); x++) {
if (x > 0)
@@ -76,11 +79,11 @@ public class SudokuView extends BaseView {
int symbol = cell.getSymbolIndex();
Color blockColor = colorPalette.get(cell.getBlock());
ImGui.pushStyleVar(ImGuiStyleVar.SelectableTextAlign, new ImVec2(0.5f, 0.5f));
ImGui.pushStyleColor(ImGuiCol.Header, new ImVec4(blockColor.r, blockColor.g, blockColor.b, 1.0f));
ImGui.pushStyleColor(ImGuiCol.Button, new ImVec4(blockColor.r, blockColor.g, blockColor.b, 1.0f));
String cellText = "";
if (symbol != -1)
cellText += Integer.toString(symbol + 1);
if (ImGui.selectable(cellText + "##" + index, true, 0, new ImVec2(50, 50))) {
if (ImGui.button(cellText + "##" + index, new ImVec2(50, 50))) {
ImGui.openPopup("editPopup");
currentIndex = index;
}
@@ -88,6 +91,8 @@ public class SudokuView extends BaseView {
ImGui.popStyleColor();
}
}
ImGui.popStyleVar(2);
ImGui.popStyleColor();
renderPopup();
if (resolveThread != null)
ImGui.beginDisabled();