-
I'm trying to have this widget overlay in view! macro. Example.blp (GTK Blueprint):
But I couldn't figure it out how to do it with WidgetTemplate. I separated content of StackPages in blueprint example to different WidgetTemplates: #[relm4::widget_template(pub)]
impl WidgetTemplate for SettingsPage {
view! {
gtk::Box {
set_orientation: gtk::Orientation::Vertical,
set_spacing: 3,
}
}
}
#[relm4::widget_template(pub)]
impl WidgetTemplate for MainPage {
view! {
gtk::Box {
set_orientation: gtk::Orientation::Vertical,
set_spacing: 3,
}
}
} My first try( it doesn't work :)) view! {
gtk::Box {
set_orientation: gtk::Orientation::Vertical,
adw::ToastOverlay {
#[wrap(Some)]
set_child = >k::Stack{
set_margin_all: 11,
set_margin_top: 7,
#[template]
add_child = &MainPage {} -> {
// Set the title of the stack page
set_name: "main",
},
#[template]
add_child = &SettingsPage {} -> {
// Set the title of the stack page
set_name: "settings",
},
}
}
}
} How can I create this widget overlay and how can I use template widget as stack page? |
Beta Was this translation helpful? Give feedback.
Answered by
eminfedar
Aug 12, 2023
Replies: 1 comment
-
Actually it is working (my error was something else): adw::ToastOverlay {
#[wrap(Some)]
set_child = >k::Stack{
set_margin_all: 11,
set_margin_top: 7,
#[template]
add_child = &SettingsPage {} -> {
set_name: "settings",
},
#[template]
add_child = &MainPage {} -> {
set_name: "main",
},
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
eminfedar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually it is working (my error was something else):