views/month-view-row: Add offset when allocating event widgets

The SEPARATOR_OFFSET constant is for the box shadow property
defined in month cells' CSS. Since the box-shadow property does
not contribute to layout, so these offsets need to be set manually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/676>
This commit is contained in:
Hari Rana
2025-12-28 17:04:32 +00:00
committed by Marge Bot
parent b0a5ff18d5
commit 6d47fc1db8
+4 -2
View File
@@ -30,6 +30,8 @@
#include "gcal-range-tree.h"
#include "gcal-utils.h"
#define SEPARATOR_OFFSET -1
typedef struct
{
GtkWidget *event_widget;
@@ -582,9 +584,9 @@ gcal_month_view_row_size_allocate (GtkWidget *widget,
start_cell = is_ltr ? block->cell : 7 - block->cell - block->length;
end_cell = start_cell + block->length;
allocation.x = round (start_cell * cell_width);
allocation.x = round (start_cell * cell_width - (is_ltr ? 0 : SEPARATOR_OFFSET));
allocation.y = cell_y[block->cell];
allocation.width = round (end_cell * cell_width);
allocation.width = round (end_cell * cell_width) - allocation.x + (is_ltr ? SEPARATOR_OFFSET : 0);
allocation.height = block->height;
gtk_widget_set_child_visible (block->event_widget, block->visible);