[gnome-tour] Use ParamSpecBuilder



commit cc92041efd7cf96066f6da44e80855c31fddd7d3
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Sun Aug 7 11:54:35 2022 +0200

    Use ParamSpecBuilder

 src/widgets/image_page.rs | 30 +++++++++---------------------
 1 file changed, 9 insertions(+), 21 deletions(-)
---
diff --git a/src/widgets/image_page.rs b/src/widgets/image_page.rs
index d49d97d..88a9610 100644
--- a/src/widgets/image_page.rs
+++ b/src/widgets/image_page.rs
@@ -87,27 +87,15 @@ mod imp {
         fn properties() -> &'static [ParamSpec] {
             static PROPERTIES: Lazy<Vec<ParamSpec>> = Lazy::new(|| {
                 vec![
-                    ParamSpecString::new(
-                        "resource-uri",
-                        "Resource URI",
-                        "Resource URI of the image",
-                        None,
-                        ParamFlags::READWRITE | ParamFlags::CONSTRUCT_ONLY,
-                    ),
-                    ParamSpecString::new(
-                        "head",
-                        "Head",
-                        "The title of the page",
-                        None,
-                        ParamFlags::READWRITE | ParamFlags::CONSTRUCT_ONLY,
-                    ),
-                    ParamSpecString::new(
-                        "body",
-                        "Body",
-                        "The body of the page",
-                        None,
-                        ParamFlags::READWRITE | ParamFlags::CONSTRUCT,
-                    ),
+                    ParamSpecString::builder("resource-uri")
+                        .flags(ParamFlags::READWRITE | ParamFlags::CONSTRUCT_ONLY)
+                        .build(),
+                    ParamSpecString::builder("head")
+                        .flags(ParamFlags::READWRITE | ParamFlags::CONSTRUCT_ONLY)
+                        .build(),
+                    ParamSpecString::builder("body")
+                        .flags(ParamFlags::READWRITE | ParamFlags::CONSTRUCT)
+                        .build(),
                 ]
             });
             PROPERTIES.as_ref()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]