From f8c457b6995d1e4dabbe1a7ccf9d8cdc0f448297 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 5 Mar 2023 12:52:17 +0200 Subject: [PATCH] feat(ui): moved integer scaling, fsr and nis into separate group in gamescope settings FSR, NIS and Integer scaling got separate "upscaling" section in gamescope settings. As well were added descriptions so users can actually know what e.g. integer scaling is --- assets/locales/de/gamescope.ftl | 9 ++- assets/locales/en/gamescope.ftl | 9 ++- assets/locales/ru/gamescope.ftl | 9 ++- src/ui/preferences/gamescope.rs | 121 +++++++++++++++++--------------- 4 files changed, 88 insertions(+), 60 deletions(-) diff --git a/assets/locales/de/gamescope.ftl b/assets/locales/de/gamescope.ftl index 1e29710..e7ec5bf 100644 --- a/assets/locales/de/gamescope.ftl +++ b/assets/locales/de/gamescope.ftl @@ -1,6 +1,13 @@ game-resolution = Spiel-Auflösung gamescope-resolution = Gamescope-Auflösung + +upscaling = Upscaling + +integer-scaling = Integer-Skalierung +integer-scaling-description = Turns each pixel into a square or rectangular group of integer number of same-color pixels. Prevents sharpness loss when scaling Full HD to 4K +gamescope-fsr-description = An open-source upscaling technique developed by AMD for better upscaling quality +nis-description = An open source upscaling technique developed by Nvidia as a cross-vendor, low-overhead alternative to their proprietary DLSS solution, meaning it works on AMD and Intel GPUs as well as Nvidia GPUs + other-settings = Andere Einstellungen framerate-limit = Framerate-Limit unfocused-framerate-limit = Unfokussiert Framerate-Limit -integer-scaling = Integer-Skalierung diff --git a/assets/locales/en/gamescope.ftl b/assets/locales/en/gamescope.ftl index c5d96fe..6fbb639 100644 --- a/assets/locales/en/gamescope.ftl +++ b/assets/locales/en/gamescope.ftl @@ -1,6 +1,13 @@ game-resolution = Game resolution gamescope-resolution = Gamescope resolution + +upscaling = Upscaling + +integer-scaling = Integer scaling +integer-scaling-description = Turns each pixel into a square or rectangular group of integer number of same-color pixels. Prevents sharpness loss when scaling Full HD to 4K +gamescope-fsr-description = An open-source upscaling technique developed by AMD for better upscaling quality +nis-description = An open source upscaling technique developed by Nvidia as a cross-vendor, low-overhead alternative to their proprietary DLSS solution, meaning it works on AMD and Intel GPUs as well as Nvidia GPUs + other-settings = Other settings framerate-limit = Framerate limit unfocused-framerate-limit = Unfocused framerate limit -integer-scaling = Integer scaling diff --git a/assets/locales/ru/gamescope.ftl b/assets/locales/ru/gamescope.ftl index 95d6ee3..478608e 100644 --- a/assets/locales/ru/gamescope.ftl +++ b/assets/locales/ru/gamescope.ftl @@ -1,6 +1,13 @@ game-resolution = Разрешение игры gamescope-resolution = Разрешение Gamescope + +upscaling = Масштабирование + +integer-scaling = Целочисленное масштабирование +integer-scaling-description = Переводит каждый пиксель в квадрат или прямоугольник из целого числа пикселей одного цвета. Предотвращает потерю резкости при масштабировании Full HD до 4K +gamescope-fsr-description = Открытая техника масштабирования с сохранением хорошего качества изображения, разработанная AMD +nis-description = Открытая техника масштабирования с сохранением хорошего качества изображения, разработанная Nvidia для замены DLSS и работающая на видеокартах AMD, Intel и Nvidia + other-settings = Другие настройки framerate-limit = Лимит числа кадров unfocused-framerate-limit = Лимит числа кадров вне фокуса -integer-scaling = Целочисленное масштабирование diff --git a/src/ui/preferences/gamescope.rs b/src/ui/preferences/gamescope.rs index 520d517..9770c27 100644 --- a/src/ui/preferences/gamescope.rs +++ b/src/ui/preferences/gamescope.rs @@ -120,6 +120,70 @@ impl SimpleAsyncComponent for GamescopeApp { } }, + add = &adw::PreferencesGroup { + set_title: &tr("upscaling"), + + adw::ActionRow { + set_title: &tr("integer-scaling"), + set_subtitle: &tr("integer-scaling-description"), + + add_suffix = >k::Switch { + set_valign: gtk::Align::Center, + set_state: CONFIG.game.enhancements.gamescope.integer_scaling, + + connect_state_notify => |switch| { + if is_ready() { + if let Ok(mut config) = config::get() { + config.game.enhancements.gamescope.integer_scaling = switch.state(); + + config::update(config); + } + } + } + } + }, + + adw::ActionRow { + set_title: "FSR", + set_subtitle: &tr("gamescope-fsr-description"), + + add_suffix = >k::Switch { + set_valign: gtk::Align::Center, + set_state: CONFIG.game.enhancements.gamescope.fsr, + + connect_state_notify => |switch| { + if is_ready() { + if let Ok(mut config) = config::get() { + config.game.enhancements.gamescope.fsr = switch.state(); + + config::update(config); + } + } + } + } + }, + + adw::ActionRow { + set_title: "Nvidia Image Scaling", + set_subtitle: &tr("nis-description"), + + add_suffix = >k::Switch { + set_valign: gtk::Align::Center, + set_state: CONFIG.game.enhancements.gamescope.nis, + + connect_state_notify => |switch| { + if is_ready() { + if let Ok(mut config) = config::get() { + config.game.enhancements.gamescope.nis = switch.state(); + + config::update(config); + } + } + } + } + } + }, + add = &adw::PreferencesGroup { set_title: &tr("other-settings"), @@ -167,63 +231,6 @@ impl SimpleAsyncComponent for GamescopeApp { } }, - adw::ActionRow { - set_title: &tr("integer-scaling"), - - add_suffix = >k::Switch { - set_valign: gtk::Align::Center, - set_state: CONFIG.game.enhancements.gamescope.integer_scaling, - - connect_state_notify => |switch| { - if is_ready() { - if let Ok(mut config) = config::get() { - config.game.enhancements.gamescope.integer_scaling = switch.state(); - - config::update(config); - } - } - } - } - }, - - adw::ActionRow { - set_title: "FSR", - - add_suffix = >k::Switch { - set_valign: gtk::Align::Center, - set_state: CONFIG.game.enhancements.gamescope.fsr, - - connect_state_notify => |switch| { - if is_ready() { - if let Ok(mut config) = config::get() { - config.game.enhancements.gamescope.fsr = switch.state(); - - config::update(config); - } - } - } - } - }, - - adw::ActionRow { - set_title: "Nvidia Image Scaling", - - add_suffix = >k::Switch { - set_valign: gtk::Align::Center, - set_state: CONFIG.game.enhancements.gamescope.nis, - - connect_state_notify => |switch| { - if is_ready() { - if let Ok(mut config) = config::get() { - config.game.enhancements.gamescope.nis = switch.state(); - - config::update(config); - } - } - } - } - }, - adw::ComboRow { set_title: &tr("window-mode"),