Skip to content

Commit

Permalink
Another attempt to fix Touchpad panel display. Preemptive gyro panel …
Browse files Browse the repository at this point in the history
…display change
  • Loading branch information
Ryochan7 committed Mar 13, 2020
1 parent c727dcc commit 605f2e8
Showing 1 changed file with 46 additions and 32 deletions.
78 changes: 46 additions & 32 deletions DS4Windows/DS4Forms/ProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,39 +65,9 @@ public ProfileEditor(int device)
profileSettingsVM = new ProfileSettingsViewModel(device);
picBoxHover.Visibility = Visibility.Hidden;
picBoxHover2.Visibility = Visibility.Hidden;
bool touchMouse = profileSettingsVM.UseTouchMouse;
if (!touchMouse)
{
useMousePanel.Visibility = Visibility.Collapsed;
useControlsPanel.Visibility = Visibility.Visible;
useTouchControlsRadio.IsChecked = true;
}
else
{
useTouchMouseRadio.IsChecked = true;
}

//useControlsPanel.Visibility = !touchMouse ? Visibility.Visible : Visibility.Collapsed;
activeTouchPanel = touchMouse ? useMousePanel : useControlsPanel;
//activeTouchPanel = useMousePanel;

switch (profileSettingsVM.GyroOutModeIndex)
{
case 0:
activeGyroModePanel = gyroControlsPanel; break;
case 1:
activeGyroModePanel = gyroMousePanel; break;
case 2:
activeGyroModePanel = gyroMouseJoystickPanel; break;
default:
activeGyroModePanel = gyroControlsPanel; break;
}

//activeGyroModePanel = gyroControlsPanel;
gyroControlsPanel.Visibility = Visibility.Collapsed;
gyroMousePanel.Visibility = Visibility.Collapsed;
gyroMouseJoystickPanel.Visibility = Visibility.Collapsed;
activeGyroModePanel.Visibility = Visibility.Visible;
//SetTouchpadPanel();
//SetupGyroPanel();

mappingListVM = new MappingListViewModel(deviceNum, profileSettingsVM.ContType);
specialActionsVM = new SpecialActionsListViewModel(device);
Expand Down Expand Up @@ -131,6 +101,48 @@ private void SetupEvents()
profileSettingsVM.SZDeadZoneChanged += UpdateReadingsSZDeadZone;
}

private void SetTouchpadPanel()
{
bool touchMouse = profileSettingsVM.UseTouchMouse;
if (!touchMouse)
{
useMousePanel.Visibility = Visibility.Collapsed;
useControlsPanel.Visibility = Visibility.Visible;
useTouchControlsRadio.IsChecked = true;
}
else
{
useMousePanel.Visibility = Visibility.Visible;
useControlsPanel.Visibility = Visibility.Collapsed;
useTouchMouseRadio.IsChecked = true;
}

//useControlsPanel.Visibility = !touchMouse ? Visibility.Visible : Visibility.Collapsed;
activeTouchPanel = touchMouse? useMousePanel : useControlsPanel;
//activeTouchPanel = useMousePanel;
}

private void SetupGyroPanel()
{
switch (profileSettingsVM.GyroOutModeIndex)
{
case 0:
activeGyroModePanel = gyroControlsPanel; break;
case 1:
activeGyroModePanel = gyroMousePanel; break;
case 2:
activeGyroModePanel = gyroMouseJoystickPanel; break;
default:
activeGyroModePanel = gyroControlsPanel; break;
}

//activeGyroModePanel = gyroControlsPanel;
gyroControlsPanel.Visibility = Visibility.Collapsed;
gyroMousePanel.Visibility = Visibility.Collapsed;
gyroMouseJoystickPanel.Visibility = Visibility.Collapsed;
activeGyroModePanel.Visibility = Visibility.Visible;
}

private void UpdateReadingsSZDeadZone(object sender, EventArgs e)
{
conReadingsUserCon.SixAxisZDead = profileSettingsVM.SZDeadZone;
Expand Down Expand Up @@ -547,6 +559,8 @@ public void Reload(int device, ProfileEntity profile = null)
mappingListBox.DataContext = mappingListVM;
specialActionsTab.DataContext = specialActionsVM;
lightbarRect.DataContext = profileSettingsVM;
SetTouchpadPanel();
SetupGyroPanel();

conReadingsUserCon.LsDead = profileSettingsVM.LSDeadZone;
conReadingsUserCon.RsDead = profileSettingsVM.RSDeadZone;
Expand Down

0 comments on commit 605f2e8

Please sign in to comment.