From 7c6a559f81a0cab63922033e6d1a44d66fafb219 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 5 Mar 2023 15:39:44 +0200 Subject: [PATCH] fix(ui): fixed titlebar behavior on some DEs https://github.com/an-anime-team/an-anime-game-launcher/issues/80 --- CHANGELOG.md | 2 ++ src/ui/main.rs | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 489793a..07dc1b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added game repairing function +- Added french translations (#81) ### Fixed @@ -18,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Changed default language from en to en-us +- Moved integer scaling, fsr and nis into separate group in gamescope settings ## 3.0.1 diff --git a/src/ui/main.rs b/src/ui/main.rs index d8dd26a..3373f8a 100644 --- a/src/ui/main.rs +++ b/src/ui/main.rs @@ -33,7 +33,7 @@ relm4::new_stateless_action!(DebugFile, WindowActionGroup, "debug_file"); relm4::new_stateless_action!(About, WindowActionGroup, "about"); -static mut MAIN_WINDOW: Option = None; +static mut MAIN_WINDOW: Option = None; static mut PREFERENCES_WINDOW: Option> = None; static mut ABOUT_DIALOG: Option> = None; @@ -116,12 +116,8 @@ impl SimpleComponent for App { } view! { - main_window = adw::Window { - #[watch] - set_title: match model.style { - LauncherStyle::Modern => Some("An Anime Game Launcher"), - LauncherStyle::Classic => Some("") - }, + main_window = adw::ApplicationWindow { + set_icon_name: Some(APP_ID), #[watch] set_default_size: ( @@ -167,6 +163,15 @@ impl SimpleComponent for App { LauncherStyle::Classic => &["flat"] }, + #[wrap(Some)] + set_title_widget = &adw::WindowTitle { + #[watch] + set_title: match model.style { + LauncherStyle::Modern => "An Anime Game Launcher", + LauncherStyle::Classic => "" + } + }, + pack_end = >k::MenuButton { set_icon_name: "open-menu-symbolic", set_menu_model: Some(&main_menu)