Repository: gtk-rs/gtk3-rs (language: rust)

Issue:
Multiple traits with a `fn property()`: `glib::ObjectExt` and `gtk::StyleContextExt`
This should probably be resolved by renaming the second one to `style_property()`.

Same probably applies to gtk4 too.

CC @bilelmoussaoui 


Discussion / hints:
That was removed from gtk4 in favour of specific APIs to get the margin/padding/color/border. It's a gtk3 issue only 

Fix patch:
diff --git a/gtk/Gir.toml b/gtk/Gir.toml
index ec2442b71025..602eddff43ab 100644
--- a/gtk/Gir.toml
+++ b/gtk/Gir.toml
@@ -2102,6 +2102,9 @@ manual_traits = ["StyleContextExtManual"]
     [[object.property]]
     name = "paint-clock"
     version = "3.8"
+    [[object.function]]
+    name = "get_property"
+    rename = "style_property_for_state" # avoid collision with ObjectExt::property
 
 [[object]]
 name = "Gtk.StyleContextPrintFlags"
diff --git a/gtk/src/auto/style_context.rs b/gtk/src/auto/style_context.rs
index 18f84209dda7..657b413c2c9d 100644
--- a/gtk/src/auto/style_context.rs
+++ b/gtk/src/auto/style_context.rs
@@ -177,7 +177,7 @@ pub trait StyleContextExt: 'static {
     fn path(&self) -> Option<WidgetPath>;
 
     #[doc(alias = "gtk_style_context_get_property")]
-    fn property(&self, property: &str, state: StateFlags) -> glib::Value;
+    fn style_property_for_state(&self, property: &str, state: StateFlags) -> glib::Value;
 
     #[doc(alias = "gtk_style_context_get_scale")]
     fn scale(&self) -> i32;
@@ -405,7 +405,7 @@ impl<O: IsA<StyleContext>> StyleContextExt for O {
         }
     }
 
-    fn property(&self, property: &str, state: StateFlags) -> glib::Value {
+    fn style_property_for_state(&self, property: &str, state: StateFlags) -> glib::Value {
         unsafe {
             let mut value = glib::Value::uninitialized();
             ffi::gtk_style_context_get_property(
diff --git a/gtk/src/style_context.rs b/gtk/src/style_context.rs
index 60c5eba5c27d..2b34d23c5ba5 100644
--- a/gtk/src/style_context.rs
+++ b/gtk/src/style_context.rs
@@ -1,8 +1,8 @@
 // Take a look at the license at the top of the repository in the LICENSE file.
 
+use crate::prelude::*;
 use crate::StateFlags;
 use crate::StyleContext;
-use glib::prelude::*;
 use pango::FontDescription;
 
 pub trait StyleContextExtManual: 'static {
@@ -11,7 +11,7 @@ pub trait StyleContextExtManual: 'static {
 
 impl<O: IsA<StyleContext>> StyleContextExtManual for O {
     fn font(&self, state: StateFlags) -> FontDescription {
-        <Self as crate::prelude::StyleContextExt>::property(self, "font", state)
+        self.style_property_for_state("font", state)
             .get()
             .expect("font property is not pango::FontDescription")
     }


Test patch: