Skip to content

Commit c775eb5

Browse files
committed
fix(settings): Hide Primary Screen CheckBox and Position ComboBox when Banner Position not selected
1 parent 95575f9 commit c775eb5

File tree

2 files changed

+43
-42
lines changed

2 files changed

+43
-42
lines changed

SoundSwitch/UI/Forms/Settings.Designer.cs

+34-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SoundSwitch/UI/Forms/Settings.cs

+9-8
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,21 @@ public SettingsForm(IAudioDeviceLister audioDeviceLister)
118118
// Settings - Notification
119119
var notificationFactory = new NotificationFactory();
120120
notificationFactory.ConfigureListControl(notificationComboBox);
121+
notificationComboBox.SelectedValue = AppModel.Instance.NotificationSettings;
121122
var notificationToolTip = new ToolTip();
122123
notificationToolTip.SetToolTip(notificationComboBox, SettingsStrings.notificationTooltip);
123-
notificationComboBox.SelectedValue = AppModel.Instance.NotificationSettings;
124-
125-
usePrimaryScreenCheckbox.Checked = AppModel.Instance.NotifyUsingPrimaryScreen;
126-
usePrimaryScreenCheckbox.Enabled = AppModel.Instance.NotificationSettings == NotificationTypeEnum.BannerNotification;
127-
var usePrimaryScreenTooltip = new ToolTip();
128-
usePrimaryScreenTooltip.SetToolTip(usePrimaryScreenCheckbox, SettingsStrings.usePrimaryScreenTooltip);
129124

130125
var bannerPositionFactory = new BannerPositionFactory();
131126
bannerPositionFactory.ConfigureListControl(positionComboBox);
127+
positionComboBox.SelectedValue = AppModel.Instance.BannerPosition;
132128
var positionToolTip = new ToolTip();
133129
positionToolTip.SetToolTip(positionComboBox, SettingsStrings.positionTooltip);
134-
positionComboBox.SelectedValue = AppModel.Instance.BannerPosition;
130+
131+
usePrimaryScreenCheckbox.Checked = AppModel.Instance.NotifyUsingPrimaryScreen;
132+
var usePrimaryScreenTooltip = new ToolTip();
133+
usePrimaryScreenTooltip.SetToolTip(usePrimaryScreenCheckbox, SettingsStrings.usePrimaryScreenTooltip);
134+
135+
usePrimaryScreenCheckbox.Visible = positionLabel.Visible = positionComboBox.Visible = AppModel.Instance.NotificationSettings == NotificationTypeEnum.BannerNotification;
135136

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

789-
usePrimaryScreenCheckbox.Enabled = positionComboBox.Enabled = notificationType == NotificationTypeEnum.BannerNotification;
790+
usePrimaryScreenCheckbox.Visible = positionLabel.Visible = positionComboBox.Visible = notificationType == NotificationTypeEnum.BannerNotification;
790791

791792
AppModel.Instance.NotificationSettings = notificationType;
792793
}

0 commit comments

Comments
 (0)