Adding a relm widget
First, we'll need these new import statements:
use playlist::Playlist;
use playlist::Msg::{
AddSong,
LoadSong,
NextSong,
PlaySong,
PauseSong,
PreviousSong,
RemoveSong,
SaveSong,
SongStarted,
StopSong,
};And then, add the Playlist widget below the toolbar:
view! {
#[name="window"]
gtk::Window {
title: "Rusic",
gtk::Box {
orientation: Vertical,
#[name="toolbar"]
gtk::Toolbar {
// …
},
#[name="playlist"]
Playlist {
},
gtk::Image {
from_pixbuf: self.model.cover_pixbuf.as_ref(),
visible: self.model.cover_visible,
},
gtk::Box {
// …
},
},
delete_event(_, _) => (Quit, Inhibit(false)),
}
}There's something different with using relm widgets and gtk widgets. Relm widgets must not contain a module prefix...