feat: get rid of deprecated libadwaita functions calls

This commit is contained in:
Observer KRypt0n_ 2024-03-24 10:10:14 +02:00
parent a1d1950ce8
commit 9914072c77
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
6 changed files with 496 additions and 484 deletions

View file

@ -71,7 +71,9 @@ impl SimpleAsyncComponent for EnvironmentPage {
type Output = EnhancementsAppMsg; type Output = EnhancementsAppMsg;
view! { view! {
gtk::Box { adw::NavigationPage {
#[wrap(Some)]
set_child = &gtk::Box {
set_orientation: gtk::Orientation::Vertical, set_orientation: gtk::Orientation::Vertical,
adw::HeaderBar { adw::HeaderBar {
@ -150,6 +152,7 @@ impl SimpleAsyncComponent for EnvironmentPage {
} }
} }
} }
}
async fn init(_init: Self::Init, root: Self::Root, sender: AsyncComponentSender<Self>) -> AsyncComponentParts<Self> { async fn init(_init: Self::Init, root: Self::Root, sender: AsyncComponentSender<Self>) -> AsyncComponentParts<Self> {
tracing::info!("Initializing environment settings"); tracing::info!("Initializing environment settings");

View file

@ -105,7 +105,9 @@ impl SimpleAsyncComponent for GamePage {
type Output = EnhancementsAppMsg; type Output = EnhancementsAppMsg;
view! { view! {
gtk::Box { adw::NavigationPage {
#[wrap(Some)]
set_child = &gtk::Box {
set_orientation: gtk::Orientation::Vertical, set_orientation: gtk::Orientation::Vertical,
adw::HeaderBar { adw::HeaderBar {
@ -150,6 +152,7 @@ impl SimpleAsyncComponent for GamePage {
} }
} }
} }
}
async fn init( async fn init(
_init: Self::Init, _init: Self::Init,

View file

@ -627,13 +627,13 @@ impl SimpleAsyncComponent for EnhancementsApp {
}, },
#[local_ref] #[local_ref]
game_page -> gtk::Box {}, game_page -> adw::NavigationPage,
#[local_ref] #[local_ref]
sandbox_page -> gtk::Box {}, sandbox_page -> adw::NavigationPage,
#[local_ref] #[local_ref]
environment_page -> gtk::Box {} environment_page -> adw::NavigationPage,
} }
async fn init( async fn init(
@ -769,28 +769,28 @@ impl SimpleAsyncComponent for EnhancementsApp {
PREFERENCES_WINDOW.as_ref() PREFERENCES_WINDOW.as_ref()
.unwrap_unchecked() .unwrap_unchecked()
.widget() .widget()
.close_subpage(); .pop_subpage();
} }
EnhancementsAppMsg::OpenGameSettingsPage => unsafe { EnhancementsAppMsg::OpenGameSettingsPage => unsafe {
PREFERENCES_WINDOW.as_ref() PREFERENCES_WINDOW.as_ref()
.unwrap_unchecked() .unwrap_unchecked()
.widget() .widget()
.present_subpage(self.game_page.widget()); .push_subpage(self.game_page.widget());
} }
EnhancementsAppMsg::OpenSandboxSettingsPage => unsafe { EnhancementsAppMsg::OpenSandboxSettingsPage => unsafe {
PREFERENCES_WINDOW.as_ref() PREFERENCES_WINDOW.as_ref()
.unwrap_unchecked() .unwrap_unchecked()
.widget() .widget()
.present_subpage(self.sandbox_page.widget()); .push_subpage(self.sandbox_page.widget());
} }
EnhancementsAppMsg::OpenEnvironmentSettingsPage => unsafe { EnhancementsAppMsg::OpenEnvironmentSettingsPage => unsafe {
PREFERENCES_WINDOW.as_ref() PREFERENCES_WINDOW.as_ref()
.unwrap_unchecked() .unwrap_unchecked()
.widget() .widget()
.present_subpage(self.environment_page.widget()); .push_subpage(self.environment_page.widget());
} }
EnhancementsAppMsg::Toast { title, description } => { EnhancementsAppMsg::Toast { title, description } => {

View file

@ -98,7 +98,9 @@ impl SimpleAsyncComponent for SandboxPage {
type Output = EnhancementsAppMsg; type Output = EnhancementsAppMsg;
view! { view! {
gtk::Box { adw::NavigationPage {
#[wrap(Some)]
set_child = &gtk::Box {
set_orientation: gtk::Orientation::Vertical, set_orientation: gtk::Orientation::Vertical,
adw::HeaderBar { adw::HeaderBar {
@ -321,6 +323,7 @@ impl SimpleAsyncComponent for SandboxPage {
} }
} }
} }
}
async fn init(_init: Self::Init, root: Self::Root, sender: AsyncComponentSender<Self>) -> AsyncComponentParts<Self> { async fn init(_init: Self::Init, root: Self::Root, sender: AsyncComponentSender<Self>) -> AsyncComponentParts<Self> {
tracing::info!("Initializing sandbox settings"); tracing::info!("Initializing sandbox settings");

View file

@ -49,7 +49,9 @@ impl SimpleAsyncComponent for ComponentsPage {
type Output = GeneralAppMsg; type Output = GeneralAppMsg;
view! { view! {
gtk::Box { adw::NavigationPage {
#[wrap(Some)]
set_child = &gtk::Box {
set_orientation: gtk::Orientation::Vertical, set_orientation: gtk::Orientation::Vertical,
adw::HeaderBar { adw::HeaderBar {
@ -239,6 +241,7 @@ impl SimpleAsyncComponent for ComponentsPage {
} }
} }
} }
}
async fn init(_init: Self::Init, root: Self::Root, sender: AsyncComponentSender<Self>) -> AsyncComponentParts<Self> { async fn init(_init: Self::Init, root: Self::Root, sender: AsyncComponentSender<Self>) -> AsyncComponentParts<Self> {
tracing::info!("Initializing general settings -> components page"); tracing::info!("Initializing general settings -> components page");

View file

@ -528,7 +528,7 @@ impl SimpleAsyncComponent for GeneralApp {
}, },
#[local_ref] #[local_ref]
components_page -> gtk::Box {} components_page -> adw::NavigationPage,
} }
async fn init( async fn init(
@ -664,14 +664,14 @@ impl SimpleAsyncComponent for GeneralApp {
PREFERENCES_WINDOW.as_ref() PREFERENCES_WINDOW.as_ref()
.unwrap_unchecked() .unwrap_unchecked()
.widget() .widget()
.close_subpage(); .pop_subpage();
} }
GeneralAppMsg::OpenComponentsPage => unsafe { GeneralAppMsg::OpenComponentsPage => unsafe {
PREFERENCES_WINDOW.as_ref() PREFERENCES_WINDOW.as_ref()
.unwrap_unchecked() .unwrap_unchecked()
.widget() .widget()
.present_subpage(self.components_page.widget()); .push_subpage(self.components_page.widget());
} }
#[allow(unused_must_use)] #[allow(unused_must_use)]