mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-29 06:51:10 +00:00
Don't export _gtk_cell_renderer_calc_offset
This is just a private convenience function, and exporting _-prefixed functions doesn't work with our libtool setup. Just do the 3 line calculation in gail.
This commit is contained in:
parent
e7c4ede64c
commit
0a015f1bdb
@ -602,7 +602,6 @@ gtk_cell_renderer_set_sensitive
|
||||
gtk_cell_renderer_set_visible
|
||||
gtk_cell_renderer_start_editing
|
||||
gtk_cell_renderer_stop_editing
|
||||
_gtk_cell_renderer_calc_offset
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -646,7 +646,7 @@ gtk_cell_renderer_get_size (GtkCellRenderer *cell,
|
||||
|
||||
if (cell_area)
|
||||
_gtk_cell_renderer_calc_offset (cell, cell_area, gtk_widget_get_direction (widget),
|
||||
request.width, request.height, x_offset, y_offset);
|
||||
request.width, request.height, x_offset, y_offset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -244,12 +244,12 @@ void gtk_cell_renderer_stop_editing (GtkCellRenderer *cell,
|
||||
|
||||
|
||||
void _gtk_cell_renderer_calc_offset (GtkCellRenderer *cell,
|
||||
const GdkRectangle *cell_area,
|
||||
GtkTextDirection direction,
|
||||
gint width,
|
||||
gint height,
|
||||
gint *x_offset,
|
||||
gint *y_offset);
|
||||
const GdkRectangle *cell_area,
|
||||
GtkTextDirection direction,
|
||||
gint width,
|
||||
gint height,
|
||||
gint *x_offset,
|
||||
gint *y_offset);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -609,10 +609,10 @@ gail_text_cell_get_character_extents (AtkText *text,
|
||||
widget,
|
||||
&min_size, NULL);
|
||||
|
||||
_gtk_cell_renderer_calc_offset (GTK_CELL_RENDERER (gtk_renderer), &rendered_rect,
|
||||
gtk_widget_get_direction (widget),
|
||||
min_size.width, min_size.height,
|
||||
&x_offset, &y_offset);
|
||||
gtk_cell_renderer_calc_offset (GTK_CELL_RENDERER (gtk_renderer), &rendered_rect,
|
||||
gtk_widget_get_direction (widget),
|
||||
min_size.width, min_size.height,
|
||||
&x_offset, &y_offset);
|
||||
|
||||
layout = create_pango_layout (gtk_renderer, widget);
|
||||
|
||||
@ -646,6 +646,8 @@ gail_text_cell_get_offset_at_point (AtkText *text,
|
||||
GdkRectangle rendered_rect;
|
||||
PangoLayout *layout;
|
||||
gchar *renderer_text;
|
||||
gint width, height;
|
||||
gfloat xalign, yalign;
|
||||
gint x_offset, y_offset, index;
|
||||
gint xpad, ypad;
|
||||
|
||||
@ -675,10 +677,12 @@ gail_text_cell_get_offset_at_point (AtkText *text,
|
||||
gtk_cell_renderer_get_preferred_size (GTK_CELL_RENDERER (gtk_renderer),
|
||||
widget,
|
||||
&min_size, NULL);
|
||||
_gtk_cell_renderer_calc_offset (GTK_CELL_RENDERER (gtk_renderer), &rendered_rect,
|
||||
gtk_widget_get_direction (widget),
|
||||
min_size.width, min_size.height,
|
||||
&x_offset, &y_offset);
|
||||
gtk_cell_renderer_get_fixed_size (GTK_CELL_RENDERER (gtk_renderer), &width, &height);
|
||||
gtk_cell_renderer_get_alignment (GTK_CELL_RENDERER (gtk_renderer), &xalign, &yalign);
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
xalign = 1.0 - xalign;
|
||||
x_offset = MAX (0, xalign * (width - min_size.width));
|
||||
y_offset = MAX (0, yalign * (height - min_size.height));
|
||||
|
||||
layout = create_pango_layout (gtk_renderer, widget);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user