Skip to content

Commit

Permalink
Disable HMD Pointer keyboard settings if HMD Pointer itself is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
elvissteinjr committed Jul 15, 2024
1 parent 1393559 commit 0930995
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/DesktopPlusUI/WindowSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1734,16 +1734,19 @@ void WindowSettings::UpdatePageMainCatInput()
{
ImGui::Indent();

bool& hmd_pointer = ConfigManager::GetRef(configid_bool_input_laser_pointer_hmd_device);
if (ImGui::Checkbox(TranslationManager::GetString(tstr_SettingsLaserPointerHMDPointer), &hmd_pointer))
bool& hmd_pointer_enabled = ConfigManager::GetRef(configid_bool_input_laser_pointer_hmd_device);
if (ImGui::Checkbox(TranslationManager::GetString(tstr_SettingsLaserPointerHMDPointer), &hmd_pointer_enabled))
{
IPCManager::Get().PostConfigMessageToDashboardApp(configid_bool_input_laser_pointer_hmd_device, hmd_pointer);
IPCManager::Get().PostConfigMessageToDashboardApp(configid_bool_input_laser_pointer_hmd_device, hmd_pointer_enabled);
}

ImGui::PushID("HMDPointer");

ImGui::Indent(ImGui::GetFrameHeightWithSpacing());

if (!hmd_pointer_enabled)
ImGui::PushItemDisabled();

ImGui::PushID("HMDPointer");

const ImVec2 table_size(-style.IndentSpacing - 1.0f, 0.0f); //Replicate padding from columns
const float table_column_width = m_Column0Width - style.IndentSpacing - ImGui::GetFrameHeightWithSpacing(); //Align with width of other columns

Expand Down Expand Up @@ -1790,6 +1793,9 @@ void WindowSettings::UpdatePageMainCatInput()

ImGui::PopID();

if (!hmd_pointer_enabled)
ImGui::PopItemDisabled();

ImGui::Unindent(ImGui::GetFrameHeightWithSpacing());
ImGui::Unindent();
}
Expand Down

0 comments on commit 0930995

Please sign in to comment.