fix(ui): fixed titlebar behavior on some DEs

https://github.com/an-anime-team/an-anime-game-launcher/issues/80
This commit is contained in:
Observer KRypt0n_ 2023-03-05 15:39:44 +02:00
parent 1eff74489a
commit 7c6a559f81
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
2 changed files with 14 additions and 7 deletions

View file

@ -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

View file

@ -33,7 +33,7 @@ relm4::new_stateless_action!(DebugFile, WindowActionGroup, "debug_file");
relm4::new_stateless_action!(About, WindowActionGroup, "about");
static mut MAIN_WINDOW: Option<adw::Window> = None;
static mut MAIN_WINDOW: Option<adw::ApplicationWindow> = None;
static mut PREFERENCES_WINDOW: Option<AsyncController<PreferencesApp>> = None;
static mut ABOUT_DIALOG: Option<Controller<AboutDialog>> = 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 = &gtk::MenuButton {
set_icon_name: "open-menu-symbolic",
set_menu_model: Some(&main_menu)