"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gtk/gtkscrolledwindow.c" between
gtk+-3.24.26.tar.xz and gtk+-3.24.27.tar.xz

About: GTK+ 3 (the GIMP Toolkit; version 3) is a library for creating graphical user interfaces for the X Window System.

gtkscrolledwindow.c  (gtk+-3.24.26.tar.xz):gtkscrolledwindow.c  (gtk+-3.24.27.tar.xz)
skipping to change at line 1006 skipping to change at line 1006
static void static void
scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window, scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window,
gdouble offset_x, gdouble offset_x,
gdouble offset_y, gdouble offset_y,
GtkGesture *gesture) GtkGesture *gesture)
{ {
GtkScrolledWindowPrivate *priv = scrolled_window->priv; GtkScrolledWindowPrivate *priv = scrolled_window->priv;
GtkAdjustment *hadjustment; GtkAdjustment *hadjustment;
GtkAdjustment *vadjustment; GtkAdjustment *vadjustment;
GtkScrollable *child; gdouble dx, dy;
GtkBorder border;
double dx, dy, scale, size;
gtk_scrolled_window_invalidate_overshoot (scrolled_window); gtk_scrolled_window_invalidate_overshoot (scrolled_window);
if (!priv->capture_button_press) if (!priv->capture_button_press)
{ {
GdkEventSequence *sequence; GdkEventSequence *sequence;
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (ge sture)); sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (ge sture));
gtk_gesture_set_sequence_state (gesture, sequence, gtk_gesture_set_sequence_state (gesture, sequence,
GTK_EVENT_SEQUENCE_CLAIMED); GTK_EVENT_SEQUENCE_CLAIMED);
} }
child = GTK_SCROLLABLE (gtk_bin_get_child (GTK_BIN (scrolled_window)));
hadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)); hadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar));
if (hadjustment && may_hscroll (scrolled_window)) if (hadjustment && may_hscroll (scrolled_window))
{ {
if (child && gtk_widget_get_visible (child)) dx = priv->drag_start_x - offset_x;
{
size = gtk_widget_get_allocated_width (GTK_WIDGET (child));
if (gtk_scrollable_get_border (child, &border))
size -= border.left + border.right;
scale = gtk_adjustment_get_page_size (hadjustment) / size;
}
else
{
scale = 1.0;
}
dx = priv->drag_start_x - offset_x * scale;
_gtk_scrolled_window_set_adjustment_value (scrolled_window, _gtk_scrolled_window_set_adjustment_value (scrolled_window,
hadjustment, dx); hadjustment, dx);
} }
vadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)); vadjustment = gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar));
if (vadjustment && may_vscroll (scrolled_window)) if (vadjustment && may_vscroll (scrolled_window))
{ {
if (child && gtk_widget_get_visible (child)) dy = priv->drag_start_y - offset_y;
{
size = gtk_widget_get_allocated_height (GTK_WIDGET (child));
if (gtk_scrollable_get_border (child, &border))
size -= border.top + border.bottom;
scale = gtk_adjustment_get_page_size (vadjustment) / size;
}
else
{
scale = 1.0;
}
dy = priv->drag_start_y - offset_y * scale;
_gtk_scrolled_window_set_adjustment_value (scrolled_window, _gtk_scrolled_window_set_adjustment_value (scrolled_window,
vadjustment, dy); vadjustment, dy);
} }
gtk_scrolled_window_invalidate_overshoot (scrolled_window); gtk_scrolled_window_invalidate_overshoot (scrolled_window);
} }
static void static void
scrolled_window_drag_end_cb (GtkScrolledWindow *scrolled_window, scrolled_window_drag_end_cb (GtkScrolledWindow *scrolled_window,
GdkEventSequence *sequence, GdkEventSequence *sequence,
 End of changes. 4 change blocks. 
33 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)