You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
set GTK_OVERFLOW_HIDDEN again for WrapperWidgets with allocation
This is needed for RecyclerView, which will be allocated because of the onTouch() listener.
This commit is contained in:
@@ -185,6 +185,7 @@ void _setOnTouchListener(JNIEnv *env, jobject this, GtkWidget *widget, jobject o
|
|||||||
if (!wrapper->needs_allocation && (wrapper->layout_width || wrapper->layout_height))
|
if (!wrapper->needs_allocation && (wrapper->layout_width || wrapper->layout_height))
|
||||||
gtk_widget_size_allocate(GTK_WIDGET(wrapper), &(GtkAllocation){.x = 0, .y = 0, .width = wrapper->layout_width, .height = wrapper->layout_height}, 0);
|
gtk_widget_size_allocate(GTK_WIDGET(wrapper), &(GtkAllocation){.x = 0, .y = 0, .width = wrapper->layout_width, .height = wrapper->layout_height}, 0);
|
||||||
wrapper->needs_allocation = true;
|
wrapper->needs_allocation = true;
|
||||||
|
gtk_widget_set_overflow(GTK_WIDGET(wrapper), GTK_OVERFLOW_HIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_android_view_View_setOnTouchListener(JNIEnv *env, jobject this, jobject on_touch_listener)
|
JNIEXPORT void JNICALL Java_android_view_View_setOnTouchListener(JNIEnv *env, jobject this, jobject on_touch_listener)
|
||||||
@@ -371,9 +372,6 @@ JNIEXPORT jlong JNICALL Java_android_view_View_native_1constructor(JNIEnv *env,
|
|||||||
gtk_widget_set_name(widget, name);
|
gtk_widget_set_name(widget, name);
|
||||||
(*env)->ReleaseStringUTFChars(env, nameObj, name);
|
(*env)->ReleaseStringUTFChars(env, nameObj, name);
|
||||||
|
|
||||||
/* this should better match default android behavior */
|
|
||||||
gtk_widget_set_overflow(wrapper, GTK_OVERFLOW_VISIBLE);
|
|
||||||
|
|
||||||
if (_METHOD(_CLASS(this), "onGenericMotionEvent", "(Landroid/view/MotionEvent;)Z") != handle_cache.view.onGenericMotionEvent) {
|
if (_METHOD(_CLASS(this), "onGenericMotionEvent", "(Landroid/view/MotionEvent;)Z") != handle_cache.view.onGenericMotionEvent) {
|
||||||
GtkEventController *controller = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_VERTICAL);
|
GtkEventController *controller = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_VERTICAL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user