general: Stop using get_allocated_width/height
gtk_widget_get_allocated_width and gtk_widget_get_allocated_height are deprecated, let's use the recommended functions.
This commit is contained in:
@@ -506,7 +506,7 @@ gcal_month_cell_get_content_space (GcalMonthCell *self)
|
||||
gtk_style_context_get_padding (context, &padding);
|
||||
gtk_style_context_get_border (context, &border);
|
||||
|
||||
return gtk_widget_get_allocated_height (GTK_WIDGET (self)) -
|
||||
return gtk_widget_get_height (GTK_WIDGET (self)) -
|
||||
gcal_month_cell_get_header_height (self) -
|
||||
padding.top - padding.bottom -
|
||||
border.top - border.bottom;
|
||||
@@ -525,7 +525,7 @@ gcal_month_cell_get_header_height (GcalMonthCell *self)
|
||||
gtk_style_context_get_padding (context, &padding);
|
||||
gtk_style_context_get_border (context, &border);
|
||||
|
||||
return gtk_widget_get_allocated_height (self->header_box) +
|
||||
return gtk_widget_get_height (self->header_box) +
|
||||
gtk_widget_get_margin_top (self->header_box) +
|
||||
gtk_widget_get_margin_bottom (self->header_box) +
|
||||
padding.top + padding.bottom +
|
||||
@@ -537,7 +537,7 @@ gcal_month_cell_get_overflow_height (GcalMonthCell *self)
|
||||
{
|
||||
g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1);
|
||||
|
||||
return gtk_widget_get_allocated_height (self->overflow_button);
|
||||
return gtk_widget_get_height (self->overflow_button);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
||||
@@ -240,8 +240,8 @@ emit_create_event (GcalMonthView *self)
|
||||
cell = g_date_time_get_day_of_month (self->end_mark_cell) + self->days_delay - 1;
|
||||
month_cell = self->month_cell[cell / 7][cell % 7];
|
||||
|
||||
x = gtk_widget_get_allocated_width (month_cell) / 2.0;
|
||||
y = gtk_widget_get_allocated_height (month_cell) / 2.0;
|
||||
x = gtk_widget_get_width (month_cell) / 2.0;
|
||||
y = gtk_widget_get_height (month_cell) / 2.0;
|
||||
|
||||
gtk_widget_translate_coordinates (month_cell,
|
||||
GTK_WIDGET (self),
|
||||
@@ -570,7 +570,7 @@ allocate_multiday_events (GcalMonthView *self,
|
||||
|
||||
is_rtl = gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL;
|
||||
month_range = gcal_timeline_subscriber_get_range (GCAL_TIMELINE_SUBSCRIBER (self));
|
||||
header_height = gtk_widget_get_allocated_height (self->header);
|
||||
header_height = gtk_widget_get_height (self->header);
|
||||
|
||||
for (l = self->multi_cell_children; l; l = g_list_next (l))
|
||||
{
|
||||
@@ -733,7 +733,7 @@ allocate_single_day_events (GcalMonthView *self,
|
||||
gint header_height;
|
||||
|
||||
month_range = gcal_timeline_subscriber_get_range (GCAL_TIMELINE_SUBSCRIBER (self));
|
||||
header_height = gtk_widget_get_allocated_height (self->header);
|
||||
header_height = gtk_widget_get_height (self->header);
|
||||
|
||||
g_hash_table_iter_init (&iter, self->single_cell_children);
|
||||
|
||||
@@ -842,7 +842,7 @@ allocate_overflow_popover (GcalMonthView *self,
|
||||
|
||||
g_assert (self->overflow.relative_to != NULL);
|
||||
|
||||
header_height = gtk_widget_get_allocated_height (self->header);
|
||||
header_height = gtk_widget_get_height (self->header);
|
||||
|
||||
gtk_widget_get_allocation (self->overflow.relative_to, &allocation);
|
||||
allocation.y += header_height;
|
||||
|
||||
@@ -1015,3 +1015,4 @@ gcal_week_grid_set_date (GcalWeekGrid *self,
|
||||
gtk_widget_queue_resize (GTK_WIDGET (self));
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ on_button_pressed (GtkGestureClick *click_gesture,
|
||||
gint width;
|
||||
|
||||
ltr = gtk_widget_get_direction (GTK_WIDGET (self)) != GTK_TEXT_DIR_RTL;
|
||||
width = gtk_widget_get_allocated_width (self->scrolledwindow);
|
||||
width = gtk_widget_get_width (self->scrolledwindow);
|
||||
column_width = width / 7.0;
|
||||
column = ltr ? (x / column_width) : (7 - x / column_width);
|
||||
|
||||
@@ -282,7 +282,7 @@ on_motion_notify (GtkEventControllerMotion *motion_event,
|
||||
gint width;
|
||||
|
||||
ltr = gtk_widget_get_direction (GTK_WIDGET (self)) != GTK_TEXT_DIR_RTL;
|
||||
width = gtk_widget_get_allocated_width (self->scrolledwindow);
|
||||
width = gtk_widget_get_width (self->scrolledwindow);
|
||||
column_width = width / 7.0;
|
||||
column = ltr ? (x / column_width) : (7 - x / column_width);
|
||||
|
||||
@@ -311,7 +311,7 @@ on_button_released (GtkGestureClick *click_gesture,
|
||||
gint end;
|
||||
|
||||
ltr = gtk_widget_get_direction (GTK_WIDGET (self)) != GTK_TEXT_DIR_RTL;
|
||||
width = gtk_widget_get_allocated_width (self->scrolledwindow);
|
||||
width = gtk_widget_get_width (self->scrolledwindow);
|
||||
column_width = width / 7.0;
|
||||
column = ltr ? (x / column_width) : (7 - x / column_width);
|
||||
|
||||
@@ -345,7 +345,7 @@ on_button_released (GtkGestureClick *click_gesture,
|
||||
gtk_widget_translate_coordinates (GTK_WIDGET (self),
|
||||
weekview,
|
||||
0,
|
||||
gtk_widget_get_allocated_height (GTK_WIDGET (self)),
|
||||
gtk_widget_get_height (GTK_WIDGET (self)),
|
||||
NULL,
|
||||
&out_y);
|
||||
|
||||
@@ -1106,7 +1106,7 @@ header_expand (GcalWeekHeader *self)
|
||||
|
||||
/* TODO: animate this transition */
|
||||
gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (self->scrolledwindow),
|
||||
gtk_widget_get_allocated_height (week_view) / 2);
|
||||
gtk_widget_get_height (week_view) / 2);
|
||||
|
||||
gtk_button_set_icon_name (self->expand_button, "go-up-symbolic");
|
||||
|
||||
@@ -1156,7 +1156,7 @@ get_dnd_cell (GcalWeekHeader *self,
|
||||
{
|
||||
gdouble column_width;
|
||||
|
||||
column_width = gtk_widget_get_allocated_width (GTK_WIDGET (self)) / 7.0;
|
||||
column_width = gtk_widget_get_width (GTK_WIDGET (self)) / 7.0;
|
||||
|
||||
return x / column_width;
|
||||
}
|
||||
@@ -1337,13 +1337,13 @@ gcal_week_header_snapshot (GtkWidget *widget,
|
||||
state = gtk_style_context_get_state (context);
|
||||
ltr = gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL;
|
||||
|
||||
start_x = ltr ? gtk_widget_get_allocated_width (self->expand_button_box) : 0;
|
||||
start_y = gtk_widget_get_allocated_height (self->header_labels_box);
|
||||
start_x = ltr ? gtk_widget_get_width (self->expand_button_box) : 0;
|
||||
start_y = gtk_widget_get_height (self->header_labels_box);
|
||||
|
||||
gtk_widget_get_allocation (widget, &alloc);
|
||||
|
||||
if (!ltr)
|
||||
alloc.width -= gtk_widget_get_allocated_width (self->expand_button_box);
|
||||
alloc.width -= gtk_widget_get_width (self->expand_button_box);
|
||||
|
||||
week_start = gcal_date_time_get_start_of_week (self->active_date);
|
||||
week_end = g_date_time_add_days (week_start, 6);
|
||||
|
||||
@@ -275,7 +275,7 @@ on_scroll_controller_scroll_begin_cb (GtkEventControllerScroll *controller,
|
||||
if (self->pointer_position_valid)
|
||||
view_center_y = self->pointer_position_y;
|
||||
else
|
||||
view_center_y = gtk_widget_get_allocated_height (self->scrolled_window) / 2.0;
|
||||
view_center_y = gtk_widget_get_height (self->scrolled_window) / 2.0;
|
||||
|
||||
begin_zoom (self, view_center_y);
|
||||
}
|
||||
@@ -318,7 +318,7 @@ on_scroll_controller_scroll_cb (GtkEventControllerScroll *controller,
|
||||
if (self->pointer_position_valid)
|
||||
view_center_y = self->pointer_position_y;
|
||||
else
|
||||
view_center_y = gtk_widget_get_allocated_height (self->scrolled_window) / 2.0;
|
||||
view_center_y = gtk_widget_get_height (self->scrolled_window) / 2.0;
|
||||
|
||||
if (discrete)
|
||||
begin_zoom (self, view_center_y);
|
||||
|
||||
Reference in New Issue
Block a user