mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-06 08:09:01 +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),
|
MonadoActiveChanged(bool),
|
||||||
EnableDebugViewChanged(bool),
|
EnableDebugViewChanged(bool),
|
||||||
UpdateProfileNames(Vec<String>, Config),
|
UpdateProfileNames(Vec<String>, Config),
|
||||||
|
SetSelectedProfile(u32),
|
||||||
ProfileSelected(u32),
|
ProfileSelected(u32),
|
||||||
SteamLaunchOptionsChanged(String),
|
SteamLaunchOptionsChanged(String),
|
||||||
CopySteamLaunchOptions,
|
CopySteamLaunchOptions,
|
||||||
|
@ -245,14 +246,17 @@ impl SimpleComponent for MainView {
|
||||||
}
|
}
|
||||||
MainViewMsg::UpdateProfileNames(names, config) => {
|
MainViewMsg::UpdateProfileNames(names, config) => {
|
||||||
self.set_profile_names(names);
|
self.set_profile_names(names);
|
||||||
self.profiles_dropdown.as_ref().unwrap().clone().set_selected({
|
sender.input(MainViewMsg::SetSelectedProfile({
|
||||||
let pos = self.profile_names.iter()
|
let pos = self.profile_names.iter()
|
||||||
.position(|p| p.clone() == config.selected_profile_name);
|
.position(|p| p.clone() == config.selected_profile_name);
|
||||||
match pos {
|
match pos {
|
||||||
Some(idx) => idx as u32,
|
Some(idx) => idx as u32,
|
||||||
None => 0,
|
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::SteamLaunchOptionsChanged(lo) => self.set_steam_launch_options(lo),
|
||||||
MainViewMsg::CopySteamLaunchOptions => gtk::gdk::Display::default()
|
MainViewMsg::CopySteamLaunchOptions => gtk::gdk::Display::default()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue