mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2025-03-15 14:38:29 +03:00
appearance settings: added initial "download background" option support
- added translations for appearance section
This commit is contained in:
parent
5870316724
commit
76538fbf7d
5 changed files with 39 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
appearance = Внешний вид
|
||||
modern = Современный
|
||||
classic = Стандартный
|
||||
update-background = Обновлять фоновое изображение
|
||||
update-background-description = Скачивать фоновое изображение для лаунчера. Вы можете отключить это чтобы использовать ваше собственное изображение
|
||||
|
||||
launcher-language = Язык лаунчера
|
||||
launcher-language-description = Применяется после перезапуска
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
@ -53,17 +55,17 @@ impl WidgetTemplate for General {
|
|||
#[name(classic_style_button)]
|
||||
gtk::ToggleButton {
|
||||
add_css_class: "card",
|
||||
|
||||
|
||||
set_width_request: 180,
|
||||
set_height_request: 120,
|
||||
|
||||
|
||||
gtk::Image {
|
||||
set_from_resource: Some("/org/app/images/classic.svg")
|
||||
}
|
||||
},
|
||||
|
||||
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 = >k::Switch {
|
||||
set_valign: gtk::Align::Center
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
add = &adw::PreferencesGroup {
|
||||
set_title: &tr("general"),
|
||||
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Add table
Reference in a new issue