comparison src/layout_image.c @ 129:89fc00ffbce2

started relative scroll, keep scroll position
author nadvornik
date Wed, 11 Jul 2007 20:00:07 +0000
parents 98e2632b5d3d
children 7ea9fbcff664
comparison
equal deleted inserted replaced
128:98e2632b5d3d 129:89fc00ffbce2
1128 *---------------------------------------------------------------------------- 1128 *----------------------------------------------------------------------------
1129 */ 1129 */
1130 1130
1131 void layout_image_set_path(LayoutWindow *lw, const gchar *path) 1131 void layout_image_set_path(LayoutWindow *lw, const gchar *path)
1132 { 1132 {
1133 if (!layout_valid(&lw)) return; 1133 gfloat sx, sy;
1134 if (!layout_valid(&lw)) return;
1135
1136 image_get_scroll_center(lw->image, &sx, &sy);
1134 1137
1135 image_change_path(lw->image, path, image_zoom_get_default(lw->image, zoom_mode)); 1138 image_change_path(lw->image, path, image_zoom_get_default(lw->image, zoom_mode));
1139
1140 image_set_scroll_center(lw->image, sx, sy);
1136 1141
1137 layout_list_sync_path(lw, path); 1142 layout_list_sync_path(lw, path);
1138 layout_image_slideshow_continue_check(lw); 1143 layout_image_slideshow_continue_check(lw);
1139 layout_bars_new_image(lw); 1144 layout_bars_new_image(lw);
1140 } 1145 }
1534 1539
1535 1540
1536 for (i=0; i < MAX_SPLIT_IMAGES; i++) 1541 for (i=0; i < MAX_SPLIT_IMAGES; i++)
1537 { 1542 {
1538 if (lw->split_images[i] && lw->split_images[i] != imd) 1543 if (lw->split_images[i] && lw->split_images[i] != imd)
1539 // if (lw->connect_zoom) 1544 if (lw->connect_scroll)
1540 // image_sync_zoom_from_image(lw->split_images[i], imd); 1545 {
1541 if (lw->connect_scroll) 1546 gfloat sx, sy;
1542 image_sync_scroll_from_image_absolute(lw->split_images[i], imd); 1547 if (!(state & GDK_CONTROL_MASK))
1548 {
1549 image_get_scroll_center(imd, &sx, &sy);
1550 }
1551 else
1552 {
1553 image_get_scroll_center(lw->split_images[i], &sx, &sy);
1554 sx += dx;
1555 sy += dy;
1556 }
1557 image_set_scroll_center(lw->split_images[i], sx, sy);
1558 }
1543 } 1559 }
1544 } 1560 }
1545 1561
1546 static gint layout_image_mouse_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) 1562 static gint layout_image_mouse_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
1547 { 1563 {
1584 { 1600 {
1585 LayoutWindow *lw = data; 1601 LayoutWindow *lw = data;
1586 1602
1587 gint i = image_idx(lw, imd); 1603 gint i = image_idx(lw, imd);
1588 1604
1605 printf("drag inacive\n");
1589 if (i != -1) 1606 if (i != -1)
1590 { 1607 {
1591 printf("image activate %d\n", i); 1608 printf("image activate %d\n", i);
1592 layout_image_activate(lw, i); 1609 layout_image_activate(lw, i);
1593 } 1610 }
1594 1611
1595 1612
1596 for (i=0; i < MAX_SPLIT_IMAGES; i++) 1613 /* continue as with active image */
1597 { 1614 layout_image_drag_cb(imd, button, time, x, y, state, dx, dy, data);
1598 if (lw->split_images[i] && lw->split_images[i] != imd)
1599 // if (lw->connect_zoom)
1600 // image_sync_zoom_from_image(lw->split_images[i], imd);
1601 if (lw->connect_scroll)
1602 image_sync_scroll_from_image_absolute(lw->split_images[i], imd);
1603 }
1604 } 1615 }
1605 1616
1606 1617
1607 static void layout_image_set_buttons(LayoutWindow *lw) 1618 static void layout_image_set_buttons(LayoutWindow *lw)
1608 { 1619 {
1658 { 1669 {
1659 1670
1660 if (!lw->split_images[i]) return; 1671 if (!lw->split_images[i]) return;
1661 image_set_update_func(lw->split_images[i], NULL, NULL); 1672 image_set_update_func(lw->split_images[i], NULL, NULL);
1662 layout_image_set_buttons_inactive(lw, i); 1673 layout_image_set_buttons_inactive(lw, i);
1663 image_set_drag_func(lw->image, layout_image_drag_inactive_cb, lw); 1674 image_set_drag_func(lw->split_images[i], layout_image_drag_inactive_cb, lw);
1664 1675
1665 image_attach_window(lw->split_images[i], NULL, NULL, NULL, FALSE); 1676 image_attach_window(lw->split_images[i], NULL, NULL, NULL, FALSE);
1666 image_select(lw->split_images[i], FALSE); 1677 image_select(lw->split_images[i], FALSE);
1667 } 1678 }
1668 1679