Skip to content

Commit

Permalink
fix(settings): Hide Primary Screen CheckBox and Position ComboBox whe…
Browse files Browse the repository at this point in the history
…n Banner Position not selected
  • Loading branch information
XangelMusic committed Apr 5, 2024
1 parent 95575f9 commit c775eb5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
68 changes: 34 additions & 34 deletions SoundSwitch/UI/Forms/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions SoundSwitch/UI/Forms/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,21 @@ public SettingsForm(IAudioDeviceLister audioDeviceLister)
// Settings - Notification
var notificationFactory = new NotificationFactory();
notificationFactory.ConfigureListControl(notificationComboBox);
notificationComboBox.SelectedValue = AppModel.Instance.NotificationSettings;
var notificationToolTip = new ToolTip();
notificationToolTip.SetToolTip(notificationComboBox, SettingsStrings.notificationTooltip);
notificationComboBox.SelectedValue = AppModel.Instance.NotificationSettings;

usePrimaryScreenCheckbox.Checked = AppModel.Instance.NotifyUsingPrimaryScreen;
usePrimaryScreenCheckbox.Enabled = AppModel.Instance.NotificationSettings == NotificationTypeEnum.BannerNotification;
var usePrimaryScreenTooltip = new ToolTip();
usePrimaryScreenTooltip.SetToolTip(usePrimaryScreenCheckbox, SettingsStrings.usePrimaryScreenTooltip);

var bannerPositionFactory = new BannerPositionFactory();
bannerPositionFactory.ConfigureListControl(positionComboBox);
positionComboBox.SelectedValue = AppModel.Instance.BannerPosition;
var positionToolTip = new ToolTip();
positionToolTip.SetToolTip(positionComboBox, SettingsStrings.positionTooltip);
positionComboBox.SelectedValue = AppModel.Instance.BannerPosition;

usePrimaryScreenCheckbox.Checked = AppModel.Instance.NotifyUsingPrimaryScreen;
var usePrimaryScreenTooltip = new ToolTip();
usePrimaryScreenTooltip.SetToolTip(usePrimaryScreenCheckbox, SettingsStrings.usePrimaryScreenTooltip);

usePrimaryScreenCheckbox.Visible = positionLabel.Visible = positionComboBox.Visible = AppModel.Instance.NotificationSettings == NotificationTypeEnum.BannerNotification;

selectSoundFileDialog.Filter = SettingsStrings.audioFiles + @" (*.wav;*.mp3)|*.wav;*.mp3;*.aiff";
selectSoundFileDialog.FileOk += SelectSoundFileDialogOnFileOk;
Expand Down Expand Up @@ -786,7 +787,7 @@ private void NotificationComboBox_SelectedValueChanged(object sender, EventArgs
selectSoundButton.Visible = supportCustomSound;
DeleteSoundButtonVisible(supportCustomSound);

usePrimaryScreenCheckbox.Enabled = positionComboBox.Enabled = notificationType == NotificationTypeEnum.BannerNotification;
usePrimaryScreenCheckbox.Visible = positionLabel.Visible = positionComboBox.Visible = notificationType == NotificationTypeEnum.BannerNotification;

AppModel.Instance.NotificationSettings = notificationType;
}
Expand Down

0 comments on commit c775eb5

Please sign in to comment.