month-view-row: Implement RTL support

This was remarkably easy.
This commit is contained in:
Georges Basile Stavracas Neto
2023-08-11 15:13:44 -03:00
parent 5bc8fffc71
commit 7f7f55826c
+2 -3
View File
@@ -453,7 +453,7 @@ gcal_month_view_row_size_allocate (GtkWidget *widget,
allocation.width = round (cell_width * (i + 1)) - allocation.x;
allocation.height = height;
cell = is_ltr ? self->day_cells[i] : self->day_cells[7 - i + 1];
cell = is_ltr ? self->day_cells[i] : self->day_cells[7 - i - 1];
gtk_widget_size_allocate (cell, &allocation, baseline);
}
@@ -487,8 +487,7 @@ gcal_month_view_row_size_allocate (GtkWidget *widget,
block = g_ptr_array_index (blocks, block_index);
/* TODO: RTL */
allocation.x = block->cell * cell_width;
allocation.x = (is_ltr ? block->cell : 7 - block->cell - block->length) * cell_width;
allocation.y = cell_y[block->cell];
allocation.width = block->length * cell_width;
allocation.height = block->height;