Resolve warnings in gm-control-panel

This commit is contained in:
Savanni D'Gerinel 2023-10-05 11:25:01 -04:00
parent e87589705d
commit b07e55f126
2 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,7 @@ impl ApplicationWindow {
] ]
.into_iter() .into_iter()
.map(|name| { .map(|name| {
let playlist = PlaylistCard::new(); let playlist = PlaylistCard::default();
playlist.set_name(name); playlist.set_name(name);
playlist playlist
}) })

View File

@ -31,8 +31,8 @@ glib::wrapper! {
pub struct PlaylistCard(ObjectSubclass<PlaylistCardPrivate>) @extends gtk::Box, gtk::Widget, @implements gtk::Orientable; pub struct PlaylistCard(ObjectSubclass<PlaylistCardPrivate>) @extends gtk::Box, gtk::Widget, @implements gtk::Orientable;
} }
impl PlaylistCard { impl Default for PlaylistCard {
pub fn new() -> Self { fn default() -> Self {
let s: Self = Object::builder().build(); let s: Self = Object::builder().build();
s.set_orientation(gtk::Orientation::Vertical); s.set_orientation(gtk::Orientation::Vertical);
s.add_css_class("playlist-card"); s.add_css_class("playlist-card");
@ -43,7 +43,9 @@ impl PlaylistCard {
s s
} }
}
impl PlaylistCard {
pub fn set_name(&self, s: &str) { pub fn set_name(&self, s: &str) {
self.imp().name.set_text(s); self.imp().name.set_text(s);
} }