General settings: added wine & dxvk selection UI

This commit is contained in:
Observer KRypt0n_ 2023-01-19 14:03:11 +02:00
parent a3c760bbce
commit d38d098882
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
4 changed files with 55 additions and 2 deletions

View file

@ -13,3 +13,12 @@ status = Status
game-version = Game version
patch-version = Patch version
selected-version = Selected version
recommended-only = Recommended only
wine-version = Wine version
wine-recommended-description = Show only recommended wine versions
dxvk-version = DXVK version
dxvk-recommended-description = Show only recommended dxvk versions

View file

@ -13,3 +13,12 @@ status = Статус
game-version = Версия игры
patch-version = Версия патча
selected-version = Выбранная версия
recommended-only = Только рекомендуемое
wine-version = Версия Wine
wine-recommended-description = Показывать только рекомендуемые версии Wine
dxvk-version = Версия DXVK
dxvk-recommended-description = Показывать только рекомендуемые версии DXVK

View file

@ -10,10 +10,11 @@ fluent_templates::static_loader! {
pub static mut LANG: LanguageIdentifier = langid!("en");
#[allow(clippy::expect_fun_call)]
pub fn tr(id: &str) -> String {
unsafe {
LOCALES
.lookup(&LANG, id)
.expect("Failed to get message with given id")
.expect(&format!("Failed to find message with a given id: {id}"))
}
}

View file

@ -129,7 +129,41 @@ impl WidgetTemplate for General {
add_css_class: "success"
}
}
}
},
add = &adw::PreferencesGroup {
set_title: &tr("wine-version"),
adw::ComboRow {
set_title: &tr("selected-version")
},
adw::ActionRow {
set_title: &tr("recommended-only"),
set_subtitle: &tr("wine-recommended-description"),
add_suffix = &gtk::Switch {
set_valign: gtk::Align::Center
}
}
},
add = &adw::PreferencesGroup {
set_title: &tr("dxvk-version"),
adw::ComboRow {
set_title: &tr("selected-version")
},
adw::ActionRow {
set_title: &tr("recommended-only"),
set_subtitle: &tr("dxvk-recommended-description"),
add_suffix = &gtk::Switch {
set_valign: gtk::Align::Center
}
}
},
}
}
}