Skip to content

Commit 07cb8eb

Browse files
CompletionWindow: fix skills title layout for two checkboxes
Compute a local offset sized for both checkboxes (280px instead of 200px) and scale the button-to-checkbox gap with FontScale so layout stays consistent at non-default font sizes. Co-authored-by: Jon <3vcloud@users.noreply.github.com>
1 parent b0f635b commit 07cb8eb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

GWToolboxdll/Windows/CompletionWindow.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,19 +2374,20 @@ void CompletionWindow::Draw(IDirect3DDevice9* device)
23742374
}
23752375
}
23762376

2377-
auto skills_title = [&, checkbox_offset](const char* title) {
2377+
auto skills_title = [&](const char* title) {
23782378
ImGui::PushID(title);
23792379
ImGui::Text(title);
23802380
ImGui::ShowHelp("Guild Wars only shows skills learned for the current primary/secondary profession.\n\n"
23812381
"GWToolbox remembers skills learned for other professions,\nbut is only able to update this info when you switch to that profession.");
2382-
ImGui::SameLine(checkbox_offset - 100.f);
2382+
const float skills_checkbox_offset = ImGui::GetContentRegionAvail().x - 280.f * ImGui::FontScale();
2383+
ImGui::SameLine(skills_checkbox_offset - 100.f * ImGui::FontScale());
23832384
if (ImGui::Button("Check Now")) {
23842385
GW::GameThread::Enqueue(CheckAllSkills);
23852386
}
23862387
if (ImGui::IsItemHovered()) {
23872388
ImGui::SetTooltip("Will cycle through your available secondary professions to detect all unlocked skills");
23882389
}
2389-
ImGui::SameLine(checkbox_offset);
2390+
ImGui::SameLine(skills_checkbox_offset);
23902391
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0});
23912392
ImGui::Checkbox("Hide learnt skills", &hide_unlocked_skills);
23922393
ImGui::SameLine();

0 commit comments

Comments
 (0)