Skip to content

Commit 72cf243

Browse files
committed
Force width on character name column. #37
1 parent bd478e4 commit 72cf243

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/SquadMgr/SquadMgr.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@ void CSquadMgr::Render()
496496
ImGui::TableNextColumn();
497497
RenderSpecIcon(sz, player.Member.Profession, player.Member.EliteSpecialization);
498498
ImGui::SameLine();
499+
float chnameWidth = ImGui::CalcTextSize(player.Member.CharacterName).x;
500+
ImGui::PushItemWidth(max(ImGui::CalcTextSize("## Subgroup ##").x, chnameWidth));
499501
ImGui::Text(player.Member.CharacterName);
500502
PlayerLeftTooltip(player.HasLeft, secondsSinceLeft);
501503

@@ -504,7 +506,7 @@ void CSquadMgr::Render()
504506
{
505507
ImGui::TableNextColumn();
506508
ImGui::SetNextItemWidth(sz * 5);
507-
ImGui::InputInt(("##Subgroup_" + std::string(player.Member.AccountName)).c_str(), &player.Member.Subgroup);
509+
ImGui::InputInt(("##Subgroup_" + std::string(player.Member.AccountName)).c_str(), (int*)&player.Member.Subgroup);
508510
player.Member.Subgroup = min(max(player.Member.Subgroup, 1), 15);
509511
}
510512

0 commit comments

Comments
 (0)