Slight cleanage after dropdown binding

pull/45/head
Miepee 4 years ago
parent 2b4f4b2b7e
commit ad34ef8d51

@ -353,15 +353,9 @@ public partial class MainForm
}
// Update stored profiles in the Profile Settings tab
// TODO: For some reason this is needed, because if its removed, the selected index goes bonkers
modSettingsProfileDropDown.SelectedIndex = profileDropDown.DataStore.Any() ? 0 : -1;
// Refresh the author and version label on the main tab
if (profileList.Count > 0)
{
profileAuthorLabel.Text = Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author;
profileVersionLabel.Text = Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version;
}
log.Info("Reloading UI components after loading successful.");
UpdateStateMachine();

@ -221,7 +221,7 @@ public partial class MainForm : Form
if (OS.IsLinux)
profileDropDown = new DropDown();
profileDropDown.DataStore = (profileList);
profileDropDown.DataStore = profileList;
centerInterface.AddRow(profileDropDown);
@ -546,7 +546,7 @@ public partial class MainForm : Form
modSettingsProfileDropDown = new DropDown();
modSettingsProfileDropDown.DataStore = profileDropDown.DataStore;
modSettingsProfileDropDown.Bind(m => m.SelectedIndex, profileDropDown, p => p.SelectedIndex);
modSettingsProfileDropDown.SelectedIndexBinding.Bind(profileDropDown, p => p.SelectedIndex);
desktopShortcutButton = new SmallColorButton(Text.CreateShortcut);
profileButton = new SmallColorButton(Text.OpenProfileFolder);

Loading…
Cancel
Save