Skip to content

Commit

Permalink
Center course selector items within column
Browse files Browse the repository at this point in the history
  • Loading branch information
ExplosBlue committed Nov 20, 2023
1 parent 1709a2b commit 4e966a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Fushigi/ui/widgets/CourseSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ void DrawCourses()
{
ImGui.PushID(course.Key);
ImGui.TableNextColumn();

// Offset cursor pos to center each item within the column
var posX = ImGui.GetCursorPosX() + (ImGui.GetColumnWidth() - thumbnailSize.X) / 2;
ImGui.SetCursorPosX(posX);

bool clicked = ImGui.Selectable(string.Empty, course.Key == selectedCourseName,
ImGuiSelectableFlags.None, new Vector2(thumbnailSize.X, thumbnailSize.Y + em * 1.8f));

Expand Down

0 comments on commit 4e966a6

Please sign in to comment.