views/week-grid: Port to gtk_widget_compute_point

`gtk_widget_translate_coordinates` is deprecated.
This commit is contained in:
Hari Rana
2025-05-21 01:21:38 -03:00
committed by Georges Basile Stavracas Neto
parent a25b129643
commit 2bfa881c2d
+7 -9
View File
@@ -261,13 +261,12 @@ on_click_gesture_released_cb (GtkGestureClick *click_gesture,
g_autoptr (GcalRange) range = NULL; g_autoptr (GcalRange) range = NULL;
g_autoptr (GDateTime) start = NULL; g_autoptr (GDateTime) start = NULL;
g_autoptr (GDateTime) end = NULL; g_autoptr (GDateTime) end = NULL;
graphene_point_t out;
GtkWidget *weekview; GtkWidget *weekview;
gboolean ltr; gboolean ltr;
gdouble minute_height; gdouble minute_height;
gdouble local_x; gdouble local_x;
gdouble local_y; gdouble local_y;
gdouble out_x;
gdouble out_y;
gint column; gint column;
gint minute; gint minute;
gint start_cell; gint start_cell;
@@ -319,15 +318,14 @@ on_click_gesture_released_cb (GtkGestureClick *click_gesture,
local_x = round ((column + 0.5) * (gtk_widget_get_width (GTK_WIDGET (self)) / 7.0)); local_x = round ((column + 0.5) * (gtk_widget_get_width (GTK_WIDGET (self)) / 7.0));
local_y = (minute + 15) * minute_height; local_y = (minute + 15) * minute_height;
gtk_widget_translate_coordinates (GTK_WIDGET (self), if (!gtk_widget_compute_point (GTK_WIDGET (self),
weekview, weekview,
local_x, &GRAPHENE_POINT_INIT (local_x, local_y),
local_y, &out))
&out_x, g_assert_not_reached ();
&out_y);
range = gcal_range_new (start, end, GCAL_RANGE_DEFAULT); range = gcal_range_new (start, end, GCAL_RANGE_DEFAULT);
gcal_view_create_event (GCAL_VIEW (weekview), range, out_x, out_y); gcal_view_create_event (GCAL_VIEW (weekview), range, out.x, out.y);
gtk_event_controller_set_propagation_phase (self->motion_controller, GTK_PHASE_NONE); gtk_event_controller_set_propagation_phase (self->motion_controller, GTK_PHASE_NONE);
} }