appearance settings: added initial "download background" option support

- added translations for appearance section
This commit is contained in:
Observer KRypt0n_ 2023-02-22 18:43:35 +02:00
parent 5870316724
commit 76538fbf7d
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
5 changed files with 39 additions and 5 deletions

View file

@ -1,3 +1,9 @@
appearance = Appearance
modern = Modern
classic = Classic
update-background = Update background picture
update-background-description = Download official background picture for the launcher. You can disable it to use your custom image instead
launcher-language = Launcher language
launcher-language-description = Applies after restart

View file

@ -1,3 +1,9 @@
appearance = Внешний вид
modern = Современный
classic = Стандартный
update-background = Обновлять фоновое изображение
update-background-description = Скачивать фоновое изображение для лаунчера. Вы можете отключить это чтобы использовать ваше собственное изображение
launcher-language = Язык лаунчера
launcher-language-description = Применяется после перезапуска

View file

@ -8,6 +8,8 @@ use anime_launcher_sdk::config::prelude::*;
use crate::i18n::tr;
use crate::*;
// TODO: change to relm4::SimpleComponent
#[relm4::widget_template(pub)]
impl WidgetTemplate for Enhancements {
view! {

View file

@ -9,6 +9,8 @@ use anime_launcher_sdk::anime_game_core::prelude::*;
use crate::i18n::*;
use crate::*;
// TODO: change to relm4::SimpleComponent
#[relm4::widget_template(pub)]
impl WidgetTemplate for General {
view! {
@ -17,7 +19,7 @@ impl WidgetTemplate for General {
set_icon_name: Some("applications-system-symbolic"),
add = &adw::PreferencesGroup {
set_title: "Appearance",
set_title: &tr("appearance"),
gtk::Box {
set_orientation: gtk::Orientation::Horizontal,
@ -41,7 +43,7 @@ impl WidgetTemplate for General {
},
gtk::Label {
set_text: "Modern",
set_text: &tr("modern"),
set_margin_top: 16
}
@ -63,7 +65,7 @@ impl WidgetTemplate for General {
},
gtk::Label {
set_text: "Classic",
set_text: &tr("classic"),
set_margin_top: 16
}
@ -71,6 +73,18 @@ impl WidgetTemplate for General {
}
},
#[name(classic_appearance_params)]
add = &adw::PreferencesGroup {
adw::ActionRow {
set_title: &tr("update-background"),
set_subtitle: &tr("update-background-description"),
add_suffix = &gtk::Switch {
set_valign: gtk::Align::Center
}
}
},
add = &adw::PreferencesGroup {
set_title: &tr("general"),

View file

@ -85,6 +85,12 @@ impl SimpleAsyncComponent for App {
connect_clicked => AppMsg::UpdateLauncherStyle(LauncherStyle::Classic)
},
#[template_child]
classic_appearance_params {
#[watch]
set_visible: model.style == LauncherStyle::Classic
},
#[template_child]
wine_versions {
add = model.wine_components.widget(),