mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 14:20:21 +00:00
tetview: Stop using gtk_widget_get_allocation
This commit is contained in:
parent
37b2b3cb83
commit
79119e64f9
@ -5248,13 +5248,10 @@ gtk_text_view_show_magnifier (GtkTextView *text_view,
|
|||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
cairo_rectangle_int_t rect;
|
||||||
GtkTextViewPrivate *priv;
|
GtkTextViewPrivate *priv;
|
||||||
GtkAllocation allocation;
|
|
||||||
GtkRequisition req;
|
GtkRequisition req;
|
||||||
|
|
||||||
#define N_LINES 1
|
#define N_LINES 1
|
||||||
|
|
||||||
gtk_widget_get_allocation (GTK_WIDGET (text_view), &allocation);
|
|
||||||
|
|
||||||
priv = text_view->priv;
|
priv = text_view->priv;
|
||||||
_gtk_text_view_ensure_magnifier (text_view);
|
_gtk_text_view_ensure_magnifier (text_view);
|
||||||
|
|
||||||
@ -5273,11 +5270,10 @@ gtk_text_view_show_magnifier (GtkTextView *text_view,
|
|||||||
_gtk_magnifier_set_coords (GTK_MAGNIFIER (priv->magnifier),
|
_gtk_magnifier_set_coords (GTK_MAGNIFIER (priv->magnifier),
|
||||||
rect.x, rect.y + rect.height / 2);
|
rect.x, rect.y + rect.height / 2);
|
||||||
|
|
||||||
rect.x = CLAMP (rect.x, 0, allocation.width);
|
rect.x = CLAMP (rect.x, 0, gtk_widget_get_width (GTK_WIDGET (text_view)));
|
||||||
rect.y += rect.height / 4;
|
rect.y += rect.height / 4;
|
||||||
rect.height -= rect.height / 4;
|
rect.height -= rect.height / 4;
|
||||||
gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover),
|
gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover), &rect);
|
||||||
&rect);
|
|
||||||
|
|
||||||
gtk_popover_popup (GTK_POPOVER (priv->magnifier_popover));
|
gtk_popover_popup (GTK_POPOVER (priv->magnifier_popover));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user