mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-04-20 03:24:52 +00:00
fix: restore profile selection on startup
This commit is contained in:
parent
fca04f5e11
commit
5630091179
1 changed files with 6 additions and 2 deletions
|
@ -26,6 +26,7 @@ pub enum MainViewMsg {
|
|||
MonadoActiveChanged(bool),
|
||||
EnableDebugViewChanged(bool),
|
||||
UpdateProfileNames(Vec<String>, Config),
|
||||
SetSelectedProfile(u32),
|
||||
ProfileSelected(u32),
|
||||
SteamLaunchOptionsChanged(String),
|
||||
CopySteamLaunchOptions,
|
||||
|
@ -245,14 +246,17 @@ impl SimpleComponent for MainView {
|
|||
}
|
||||
MainViewMsg::UpdateProfileNames(names, config) => {
|
||||
self.set_profile_names(names);
|
||||
self.profiles_dropdown.as_ref().unwrap().clone().set_selected({
|
||||
sender.input(MainViewMsg::SetSelectedProfile({
|
||||
let pos = self.profile_names.iter()
|
||||
.position(|p| p.clone() == config.selected_profile_name);
|
||||
match pos {
|
||||
Some(idx) => idx as u32,
|
||||
None => 0,
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
MainViewMsg::SetSelectedProfile(index) => {
|
||||
self.profiles_dropdown.as_ref().unwrap().clone().set_selected(index);
|
||||
}
|
||||
MainViewMsg::SteamLaunchOptionsChanged(lo) => self.set_steam_launch_options(lo),
|
||||
MainViewMsg::CopySteamLaunchOptions => gtk::gdk::Display::default()
|
||||
|
|
Loading…
Add table
Reference in a new issue