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

View file

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

View file

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

View file

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

View file

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

View file

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