diff --git a/src/ui/gui/about_page.slint b/src/ui/gui/about_page.slint index 990e348..85aff1e 100644 --- a/src/ui/gui/about_page.slint +++ b/src/ui/gui/about_page.slint @@ -9,6 +9,20 @@ export global AboutData { in property has_update; } +export component NewVersionButton { + callback newversion_button_clicked; + HorizontalBox { + alignment: center; + Button { + text: @tr("New version available! Click here to download"); + primary: true; + clicked => { + newversion_button_clicked(); + } + } + } +} + export component About inherits Page { callback wiki_button_clicked; callback discord_button_clicked; @@ -44,14 +58,9 @@ export component About inherits Page { } } - if AboutData.has_update:HorizontalBox { - alignment: center; - Button { - text: @tr("New version available! Click to download"); - primary: true; - clicked => { - newversion_button_clicked(); - } + if AboutData.has_update:NewVersionButton { + newversion_button_clicked => { + newversion_button_clicked(); } } } diff --git a/src/ui/gui/appwindow.slint b/src/ui/gui/appwindow.slint index 7719cd3..3d4a574 100644 --- a/src/ui/gui/appwindow.slint +++ b/src/ui/gui/appwindow.slint @@ -64,6 +64,9 @@ export component AppWindow inherits Window { saves_folder_button_clicked => { saves_folder_button_clicked(); } + newversion_button_clicked => { + newversion_button_clicked(); + } } if(side-bar.current-item == 1): ControllerConfig { input_profile_button_clicked => { diff --git a/src/ui/gui/localgame_page.slint b/src/ui/gui/localgame_page.slint index 3d253eb..bf8a9c5 100644 --- a/src/ui/gui/localgame_page.slint +++ b/src/ui/gui/localgame_page.slint @@ -3,6 +3,7 @@ import { Button, HorizontalBox, VerticalBox } from "std-widgets.slint"; import { Page } from "page.slint"; +import { AboutData, NewVersionButton } from "about_page.slint"; export global State { in-out property game_running; @@ -11,6 +12,7 @@ export global State { export component LocalGame inherits Page { callback open_rom_button_clicked; callback saves_folder_button_clicked; + callback newversion_button_clicked; title: @tr("Local Game"); VerticalBox { @@ -35,5 +37,11 @@ export component LocalGame inherits Page { } } } + + if AboutData.has_update:NewVersionButton { + newversion_button_clicked => { + newversion_button_clicked(); + } + } } }