Small UI changes

This commit is contained in:
Observer KRypt0n_ 2022-07-04 07:33:55 +02:00
parent edf5e69d8e
commit d26c75c726
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
3 changed files with 80 additions and 50 deletions

View file

@ -21,24 +21,6 @@ Adw.PreferencesPage enhanced_page {
};
}
Adw.ComboRow fsr_combo {
title: "FSR";
subtitle: "AMD FSR scales game resolution while rendering the game with the lower one";
model: Gtk.StringList {
strings [
"Ultra Quality",
"Quality",
"Balanced",
"Performance"
]
};
Gtk.Switch fsr_switcher {
valign: center;
}
}
Adw.ComboRow wine_lang {
title: "Language";
subtitle: "Choose the language to use in wine environment. Can fix keyboard layout detection in-game";
@ -75,6 +57,24 @@ Adw.PreferencesPage enhanced_page {
};
}
Adw.ComboRow fsr_combo {
title: "FSR";
subtitle: "AMD FSR scales game resolution while rendering the game with the lower one";
model: Gtk.StringList {
strings [
"Ultra Quality",
"Quality",
"Balanced",
"Performance"
]
};
Gtk.Switch fsr_switcher {
valign: center;
}
}
Adw.ActionRow {
title: "Gamemode";
subtitle: "This prioritizes the game over the rest of the processes";

View file

@ -29,6 +29,7 @@ Adw.PreferencesPage general_page {
Gtk.Button {
icon-name: "document-save-symbolic";
valign: center;
styles ["flat"]
}
}
@ -38,6 +39,7 @@ Adw.PreferencesPage general_page {
Gtk.Button {
icon-name: "user-trash-symbolic";
valign: center;
styles ["flat"]
}
}
@ -47,6 +49,7 @@ Adw.PreferencesPage general_page {
Gtk.Button {
icon-name: "document-save-symbolic";
valign: center;
styles ["flat"]
}
}
@ -56,6 +59,7 @@ Adw.PreferencesPage general_page {
Gtk.Button {
icon-name: "document-save-symbolic";
valign: center;
styles ["flat"]
}
}
}
@ -102,6 +106,19 @@ Adw.PreferencesPage general_page {
Adw.PreferencesGroup {
title: "Wine version";
Adw.ComboRow {
title: "Selected version";
model: Gtk.StringList {
strings [
"Wine-GE 7-16",
"Wine-GE 7-15",
"Proton-GE 7-15",
"Lutris 7-14"
]
};
}
Adw.ExpanderRow {
title: "Wine-GE";
@ -191,6 +208,19 @@ Adw.PreferencesPage general_page {
Adw.PreferencesGroup {
title: "DXVK version";
Adw.ComboRow {
title: "Selected version";
model: Gtk.StringList {
strings [
"Vanilla 1.10.1",
"Vanilla 1.10",
"Vanilla 1.9.4",
"Async 1.10.1"
]
};
}
Adw.ExpanderRow {
title: "Vanilla";

View file

@ -11,11 +11,11 @@ pub struct Page {
pub page: adw::PreferencesPage,
pub sync_combo: adw::ComboRow,
pub fsr_combo: adw::ComboRow,
pub fsr_switcher: gtk::Switch,
pub wine_lang: adw::ComboRow,
pub hud_combo: adw::ComboRow,
pub fsr_combo: adw::ComboRow,
pub fsr_switcher: gtk::Switch,
pub gamemode_switcher: gtk::Switch
}
@ -27,12 +27,12 @@ impl Page {
page: get_object(&builder, "enhanced_page")?,
sync_combo: get_object(&builder, "sync_combo")?,
fsr_combo: get_object(&builder, "fsr_combo")?,
fsr_switcher: get_object(&builder, "fsr_switcher")?,
wine_lang: get_object(&builder, "wine_lang")?,
hud_combo: get_object(&builder, "hud_combo")?,
gamemode_switcher: get_object(&builder, "gamemode_switcher")?,
wine_lang: get_object(&builder, "wine_lang")?
fsr_combo: get_object(&builder, "fsr_combo")?,
fsr_switcher: get_object(&builder, "fsr_switcher")?,
gamemode_switcher: get_object(&builder, "gamemode_switcher")?
};
// Wine sync selection
@ -45,6 +45,26 @@ impl Page {
}
});
// Wine language selection
result.wine_lang.connect_selected_notify(|hud| {
if let Ok(mut config) = config::get() {
// TODO: show toast
config.game.wine.language = config::WineLang::try_from(hud.selected()).unwrap();
config::update(config).unwrap();
}
});
// HUD selection
result.hud_combo.connect_selected_notify(|hud| {
if let Ok(mut config) = config::get() {
// TODO: show toast
config.game.enhancements.hud = config::HUD::try_from(hud.selected()).unwrap();
config::update(config).unwrap();
}
});
// FSR strength selection
result.fsr_combo.connect_selected_notify(|hud| {
if let Ok(mut config) = config::get() {
@ -71,26 +91,6 @@ impl Page {
config::update(config).unwrap();
}
});
// Wine language selection
result.wine_lang.connect_selected_notify(|hud| {
if let Ok(mut config) = config::get() {
// TODO: show toast
config.game.wine.language = config::WineLang::try_from(hud.selected()).unwrap();
config::update(config).unwrap();
}
});
// HUD selection
result.hud_combo.connect_selected_notify(|hud| {
if let Ok(mut config) = config::get() {
// TODO: show toast
config.game.enhancements.hud = config::HUD::try_from(hud.selected()).unwrap();
config::update(config).unwrap();
}
});
// Gamemode switching
result.gamemode_switcher.connect_state_notify(|switcher| {
@ -118,18 +118,18 @@ impl Page {
// Update Wine sync
self.sync_combo.set_selected(config.game.wine.sync.into());
// FSR strength selection
self.fsr_combo.set_selected(5 - config.game.enhancements.fsr.strength);
// FSR switching
self.fsr_switcher.set_state(config.game.enhancements.fsr.enabled);
// Update wine language
self.wine_lang.set_selected(config.game.wine.language.into());
// Update HUD
self.hud_combo.set_selected(config.game.enhancements.hud.into());
// FSR strength selection
self.fsr_combo.set_selected(5 - config.game.enhancements.fsr.strength);
// FSR switching
self.fsr_switcher.set_state(config.game.enhancements.fsr.enabled);
// Gamemode switching
self.fsr_switcher.set_state(config.game.enhancements.gamemode);