Skip to content

Commit 0930995

Browse files
committed
Disable HMD Pointer keyboard settings if HMD Pointer itself is disabled
1 parent 1393559 commit 0930995

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/DesktopPlusUI/WindowSettings.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,16 +1734,19 @@ void WindowSettings::UpdatePageMainCatInput()
17341734
{
17351735
ImGui::Indent();
17361736

1737-
bool& hmd_pointer = ConfigManager::GetRef(configid_bool_input_laser_pointer_hmd_device);
1738-
if (ImGui::Checkbox(TranslationManager::GetString(tstr_SettingsLaserPointerHMDPointer), &hmd_pointer))
1737+
bool& hmd_pointer_enabled = ConfigManager::GetRef(configid_bool_input_laser_pointer_hmd_device);
1738+
if (ImGui::Checkbox(TranslationManager::GetString(tstr_SettingsLaserPointerHMDPointer), &hmd_pointer_enabled))
17391739
{
1740-
IPCManager::Get().PostConfigMessageToDashboardApp(configid_bool_input_laser_pointer_hmd_device, hmd_pointer);
1740+
IPCManager::Get().PostConfigMessageToDashboardApp(configid_bool_input_laser_pointer_hmd_device, hmd_pointer_enabled);
17411741
}
17421742

1743-
ImGui::PushID("HMDPointer");
1744-
17451743
ImGui::Indent(ImGui::GetFrameHeightWithSpacing());
17461744

1745+
if (!hmd_pointer_enabled)
1746+
ImGui::PushItemDisabled();
1747+
1748+
ImGui::PushID("HMDPointer");
1749+
17471750
const ImVec2 table_size(-style.IndentSpacing - 1.0f, 0.0f); //Replicate padding from columns
17481751
const float table_column_width = m_Column0Width - style.IndentSpacing - ImGui::GetFrameHeightWithSpacing(); //Align with width of other columns
17491752

@@ -1790,6 +1793,9 @@ void WindowSettings::UpdatePageMainCatInput()
17901793

17911794
ImGui::PopID();
17921795

1796+
if (!hmd_pointer_enabled)
1797+
ImGui::PopItemDisabled();
1798+
17931799
ImGui::Unindent(ImGui::GetFrameHeightWithSpacing());
17941800
ImGui::Unindent();
17951801
}

0 commit comments

Comments
 (0)