Mercurial > geeqie
comparison src/layout.c @ 127:271afad04d07
implemented split windows
TODO: menus and hotkeys, connected zoom, activating on drag
author | nadvornik |
---|---|
date | Fri, 29 Jun 2007 15:16:46 +0000 |
parents | e2a8b7f2165b |
children | 661cd91e5a7e |
comparison
equal
deleted
inserted
replaced
126:021a4d0de67b | 127:271afad04d07 |
---|---|
1430 layout_location_compute(lw->file_location, lw->dir_location, files, tools, w1, w2); | 1430 layout_location_compute(lw->file_location, lw->dir_location, files, tools, w1, w2); |
1431 } | 1431 } |
1432 } | 1432 } |
1433 } | 1433 } |
1434 | 1434 |
1435 void layout_split_change(LayoutWindow *lw, ImageSplitMode mode) | |
1436 { | |
1437 GtkWidget *image; | |
1438 gint i; | |
1439 for (i=0; i < MAX_SPLIT_IMAGES; i++) | |
1440 { | |
1441 if (lw->split_images[i]) | |
1442 { | |
1443 gtk_widget_hide(lw->split_images[i]->widget); | |
1444 if (lw->split_images[i]->widget->parent != lw->utility_box) | |
1445 gtk_container_remove(GTK_CONTAINER(lw->split_images[i]->widget->parent), lw->split_images[i]->widget); | |
1446 } | |
1447 } | |
1448 gtk_container_remove(GTK_CONTAINER(lw->utility_box), lw->split_image_widget); | |
1449 | |
1450 image = layout_image_setup_split(lw, mode); | |
1451 | |
1452 gtk_box_pack_start(GTK_BOX(lw->utility_box), image, TRUE, TRUE, 0); | |
1453 gtk_box_reorder_child(GTK_BOX(lw->utility_box), image, 0); | |
1454 gtk_widget_show(image); | |
1455 } | |
1456 | |
1435 static void layout_grid_setup(LayoutWindow *lw) | 1457 static void layout_grid_setup(LayoutWindow *lw) |
1436 { | 1458 { |
1437 gint priority_location; | 1459 gint priority_location; |
1438 GtkWidget *h; | 1460 GtkWidget *h; |
1439 GtkWidget *v; | 1461 GtkWidget *v; |
1450 gtk_box_pack_start(GTK_BOX(lw->main_box), lw->group_box, TRUE, TRUE, 0); | 1472 gtk_box_pack_start(GTK_BOX(lw->main_box), lw->group_box, TRUE, TRUE, 0); |
1451 gtk_widget_show(lw->group_box); | 1473 gtk_widget_show(lw->group_box); |
1452 | 1474 |
1453 priority_location = layout_grid_compass(lw); | 1475 priority_location = layout_grid_compass(lw); |
1454 | 1476 |
1455 image = layout_image_new(lw, NULL); | 1477 image = layout_image_setup_split(lw, lw->split_mode); |
1478 | |
1479 | |
1456 tools = layout_tools_new(lw); | 1480 tools = layout_tools_new(lw); |
1457 files = layout_list_new(lw); | 1481 files = layout_list_new(lw); |
1458 | 1482 |
1459 image = layout_bars_prepare(lw, image); | 1483 image = layout_bars_prepare(lw, image); |
1460 | 1484 |
1536 } | 1560 } |
1537 | 1561 |
1538 void layout_style_set(LayoutWindow *lw, gint style, const gchar *order) | 1562 void layout_style_set(LayoutWindow *lw, gint style, const gchar *order) |
1539 { | 1563 { |
1540 gchar *path; | 1564 gchar *path; |
1541 ImageWindow *old_image; | 1565 gint i; |
1542 | 1566 |
1543 if (!layout_valid(&lw)) return; | 1567 if (!layout_valid(&lw)) return; |
1544 | 1568 |
1545 if (style != -1) | 1569 if (style != -1) |
1546 { | 1570 { |
1562 layout_image_slideshow_stop(lw); | 1586 layout_image_slideshow_stop(lw); |
1563 layout_image_full_screen_stop(lw); | 1587 layout_image_full_screen_stop(lw); |
1564 | 1588 |
1565 path = lw->path; | 1589 path = lw->path; |
1566 lw->path = NULL; | 1590 lw->path = NULL; |
1567 old_image = lw->image; | |
1568 lw->image = NULL; | 1591 lw->image = NULL; |
1569 lw->utility_box = NULL; | 1592 lw->utility_box = NULL; |
1570 | 1593 |
1571 layout_geometry_get_dividers(lw, &lw->div_h, &lw->div_v); | 1594 layout_geometry_get_dividers(lw, &lw->div_h, &lw->div_v); |
1572 | 1595 |
1573 /* clear it all */ | 1596 /* clear it all */ |
1574 | 1597 |
1575 gtk_widget_hide(old_image->widget); | 1598 for (i=0; i < MAX_SPLIT_IMAGES; i++) |
1576 gtk_widget_ref(old_image->widget); | 1599 { |
1577 gtk_container_remove(GTK_CONTAINER(old_image->widget->parent), old_image->widget); | 1600 if (lw->split_images[i]) |
1601 { | |
1602 gtk_widget_hide(lw->split_images[i]->widget); | |
1603 gtk_container_remove(GTK_CONTAINER(lw->split_images[i]->widget->parent), lw->split_images[i]->widget); | |
1604 } | |
1605 } | |
1578 | 1606 |
1579 lw->h_pane = NULL; | 1607 lw->h_pane = NULL; |
1580 lw->v_pane = NULL; | 1608 lw->v_pane = NULL; |
1581 | 1609 |
1582 lw->toolbar = NULL; | 1610 lw->toolbar = NULL; |
1614 layout_util_sync(lw); | 1642 layout_util_sync(lw); |
1615 layout_status_update_all(lw); | 1643 layout_status_update_all(lw); |
1616 | 1644 |
1617 /* sync */ | 1645 /* sync */ |
1618 | 1646 |
1619 if (image_get_path(old_image)) | 1647 if (image_get_path(lw->image)) |
1620 { | 1648 { |
1621 layout_set_path(lw, image_get_path(old_image)); | 1649 layout_set_path(lw, image_get_path(lw->image)); |
1622 } | 1650 } |
1623 else | 1651 else |
1624 { | 1652 { |
1625 layout_set_path(lw, path); | 1653 layout_set_path(lw, path); |
1626 } | 1654 } |
1627 image_change_from_image(lw->image, old_image); | |
1628 image_top_window_set_sync(lw->image, (lw->tools_float || lw->tools_hidden)); | 1655 image_top_window_set_sync(lw->image, (lw->tools_float || lw->tools_hidden)); |
1629 | 1656 |
1630 /* clean up */ | 1657 /* clean up */ |
1631 | 1658 |
1632 gtk_widget_unref(old_image->widget); | |
1633 g_free(path); | 1659 g_free(path); |
1634 } | 1660 } |
1635 | 1661 |
1636 void layout_styles_update(void) | 1662 void layout_styles_update(void) |
1637 { | 1663 { |