From e23516ee430232580b23d627b3cbaa36dfd33339 Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Sat, 28 Oct 2023 22:53:00 +0200 Subject: [PATCH] fix invalid cast warning when calling setTextColor() on EditText the implementation works fine for all kind of GtkWidgets no need to cast to GtkLabel class --- src/api-impl-jni/widgets/android_widget_TextView.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api-impl-jni/widgets/android_widget_TextView.c b/src/api-impl-jni/widgets/android_widget_TextView.c index 86a7e6e2..171e28bb 100644 --- a/src/api-impl-jni/widgets/android_widget_TextView.c +++ b/src/api-impl-jni/widgets/android_widget_TextView.c @@ -32,7 +32,7 @@ JNIEXPORT void JNICALL Java_android_widget_TextView_native_1setText(JNIEnv *env, // FIXME: this will probably behave unfortunately if called multiple times JNIEXPORT void JNICALL Java_android_widget_TextView_native_1setTextColor(JNIEnv *env, jobject this, jint color) { - GtkLabel *label = GTK_LABEL(_PTR(_GET_LONG_FIELD(this, "widget"))); + GtkWidget *widget = GTK_WIDGET(_PTR(_GET_LONG_FIELD(this, "widget"))); GtkCssProvider *css_provider = gtk_css_provider_new(); @@ -40,7 +40,7 @@ JNIEXPORT void JNICALL Java_android_widget_TextView_native_1setTextColor(JNIEnv gtk_css_provider_load_from_string(css_provider, css_string); g_free(css_string); - gtk_style_context_add_provider(gtk_widget_get_style_context(GTK_WIDGET(label)), GTK_STYLE_PROVIDER(css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider(gtk_widget_get_style_context(widget), GTK_STYLE_PROVIDER(css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } JNIEXPORT void JNICALL Java_android_widget_TextView_setTextSize(JNIEnv *env, jobject this, jfloat size)