general: Use glib::Object::builder for objects w/ props
Builders are more idiomatic rust code than the old pattern.
This commit is contained in:
parent
d1d53e4f4a
commit
583794a3ec
2 changed files with 6 additions and 6 deletions
|
|
@ -99,11 +99,11 @@ glib::wrapper! {
|
|||
#[allow(clippy::new_without_default)]
|
||||
impl LpApplication {
|
||||
pub fn new() -> Self {
|
||||
glib::Object::new(&[
|
||||
("application-id", &config::APP_ID.to_string()),
|
||||
("flags", &gio::ApplicationFlags::HANDLES_OPEN),
|
||||
("resource-base-path", &"/org/gnome/Loupe/".to_string()),
|
||||
])
|
||||
glib::Object::builder()
|
||||
.property("application-id", config::APP_ID)
|
||||
.property("flags", gio::ApplicationFlags::HANDLES_OPEN)
|
||||
.property("resource-base-path", "/org/gnome/Loupe")
|
||||
.build()
|
||||
}
|
||||
|
||||
pub fn setup_actions(&self) {
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ glib::wrapper! {
|
|||
#[gtk::template_callbacks]
|
||||
impl LpWindow {
|
||||
pub fn new<A: IsA<gtk::Application>>(app: &A) -> Self {
|
||||
glib::Object::new(&[("application", app)])
|
||||
glib::Object::builder().property("application", app).build()
|
||||
}
|
||||
|
||||
fn toggle_fullscreen(&self, fullscreen: bool) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue