Skip to content

Commit

Permalink
Minor fix in layers list padding
Browse files Browse the repository at this point in the history
Without this the padding was slightly larger in layers compared with
other lists.
  • Loading branch information
guillaumechereau committed Mar 20, 2024
1 parent ca1c61d commit afa4f38
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,7 @@ bool gui_layer_item(int idx, int icons_count, const int *icons,
int i;
ImVec2 center;
ImVec2 uv0, uv1;
ImVec2 padding;
ImDrawList* draw_list = ImGui::GetWindowDrawList();
ImGuiStyle& style = ImGui::GetStyle();

Expand All @@ -1622,9 +1623,9 @@ bool gui_layer_item(int idx, int icons_count, const int *icons,

if (edit_name != name) {
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0.5));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
ImVec2(style.FramePadding.x +
GUI_ICON_HEIGHT * 0.75 * icons_count, 0));
padding = style.FramePadding;
padding.x += GUI_ICON_HEIGHT * 0.75 * icons_count;
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, padding);
if (ImGui::Button(name, ImVec2(-1, GUI_ICON_HEIGHT))) {
*selected = true;
ret = true;
Expand Down

0 comments on commit afa4f38

Please sign in to comment.