Merge branch 'matthiasc/for-main' into 'main'

range: Fix a copy-paste error

See merge request GNOME/gtk!5803
This commit is contained in:
Matthias Clasen 2023-04-09 12:37:44 +00:00
commit 61a0d06310
3 changed files with 9 additions and 13 deletions

View File

@ -273,8 +273,6 @@ get_child_position (GtkOverlay *overlay,
GtkColorEditor *editor)
{
GtkRequisition req;
GtkAllocation alloc;
int s, e;
graphene_point_t p;
gtk_widget_get_preferred_size (widget, &req, NULL);
@ -298,22 +296,20 @@ get_child_position (GtkOverlay *overlay,
}
else if (widget == editor->h_popup)
{
gtk_widget_get_allocation (editor->h_slider, &alloc);
gtk_range_get_slider_range (GTK_RANGE (editor->h_slider), &s, &e);
int slider_width;
slider_width = gtk_widget_get_width (editor->h_slider);
if (!gtk_widget_compute_point (editor->h_slider,
gtk_widget_get_parent (editor->grid),
gtk_widget_get_direction (GTK_WIDGET (overlay)) == GTK_TEXT_DIR_RTL
? &GRAPHENE_POINT_INIT (- req.width - 6, editor->popup_position - req.height / 2)
: &GRAPHENE_POINT_INIT (alloc.width + 6, editor->popup_position - req.height / 2),
: &GRAPHENE_POINT_INIT (slider_width + 6, editor->popup_position - req.height / 2),
&p))
return FALSE;
}
else if (widget == editor->a_popup)
{
gtk_widget_get_allocation (editor->a_slider, &alloc);
gtk_range_get_slider_range (GTK_RANGE (editor->a_slider), &s, &e);
if (!gtk_widget_compute_point (editor->a_slider,
gtk_widget_get_parent (editor->grid),
&GRAPHENE_POINT_INIT (editor->popup_position - req.width / 2, - req.height - 6),

View File

@ -3484,7 +3484,6 @@ on_row_dragged (GtkGestureDrag *gesture,
GdkContentProvider *content;
GdkSurface *surface;
GdkDevice *device;
GtkAllocation allocation;
GtkWidget *drag_widget;
GdkDrag *drag;
@ -3509,12 +3508,13 @@ on_row_dragged (GtkGestureDrag *gesture,
g_signal_connect (drag, "dnd-finished", G_CALLBACK (dnd_finished_cb), sidebar);
g_signal_connect (drag, "cancel", G_CALLBACK (dnd_cancel_cb), sidebar);
gtk_widget_get_allocation (sidebar->drag_row, &allocation);
gtk_widget_set_visible (sidebar->drag_row, FALSE);
drag_widget = GTK_WIDGET (gtk_sidebar_row_clone (GTK_SIDEBAR_ROW (sidebar->drag_row)));
sidebar->drag_row_height = allocation.height;
gtk_widget_set_size_request (drag_widget, allocation.width, allocation.height);
sidebar->drag_row_height = gtk_widget_get_height (sidebar->drag_row);
gtk_widget_set_size_request (drag_widget,
gtk_widget_get_width (sidebar->drag_row),
gtk_widget_get_height (sidebar->drag_row));
gtk_widget_set_opacity (drag_widget, 0.8);
gtk_drag_icon_set_child (GTK_DRAG_ICON (gtk_drag_icon_get_for_drag (drag)), drag_widget);

View File

@ -1010,7 +1010,7 @@ gtk_range_get_slider_range (GtkRange *range,
else
{
if (slider_start)
*slider_start = slider_bounds.origin.y;
*slider_start = slider_bounds.origin.x;
if (slider_end)
*slider_end = slider_bounds.origin.x + slider_bounds.size.width;
}