diff options
author | Jens Finke <jens@triq.net> | 2003-09-21 11:42:47 +0000 |
---|---|---|
committer | Jens Finke <jens@src.gnome.org> | 2003-09-21 11:42:47 +0000 |
commit | 18f0ed7001d53eea1b875f213611526680c9531a (patch) | |
tree | fdfe1a68aaac5a35fa276543c55085f50074926f | |
parent | 313158dc603accbc64147cf1796b8ed3d9ed2db6 (diff) | |
download | eog-18f0ed7001d53eea1b875f213611526680c9531a.tar.gz |
Create horizontal splitter to hold info view only if libexif is available.
2003-09-21 Jens Finke <jens@triq.net>
* collection/eog-collection-view.c (create_user_interface): Create
horizontal splitter to hold info view only if libexif is
available. Otherwise put the image view directly into the vertical
pane.
* libeog/eog-scroll-view.c (paint_rectangle): Check if widget is
drawable (fixes crash on shutdown). Check if scaled image width
and height is > 1.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | collection/eog-collection-view.c | 34 | ||||
-rw-r--r-- | libeog/eog-scroll-view.c | 8 |
3 files changed, 42 insertions, 11 deletions
@@ -1,3 +1,14 @@ +2003-09-21 Jens Finke <jens@triq.net> + + * collection/eog-collection-view.c (create_user_interface): Create + horizontal splitter to hold info view only if libexif is + available. Otherwise put the image view directly into the vertical + pane. + + * libeog/eog-scroll-view.c (paint_rectangle): Check if widget is + drawable (fixes crash on shutdown). Check if scaled image width + and height is > 1. + 2003-09-21 Hidetoshi Tajima <hidetoshi.tajima@sun.com> * shell/main.c (show_nonexistent_files): Prepare non-ascii uris diff --git a/collection/eog-collection-view.c b/collection/eog-collection-view.c index c4e0e8d3..6460eb38 100644 --- a/collection/eog-collection-view.c +++ b/collection/eog-collection-view.c @@ -1121,13 +1121,20 @@ static GtkWidget* create_user_interface (EogCollectionView *list_view) { EogCollectionViewPrivate *priv; +#if HAVE_EXIF GtkWidget *hpaned; +#endif GtkWidget *vpaned; GtkWidget *sw; GtkWidget *frame; priv = list_view->priv; + /* the upper part contains the image view, the + * lower part contains the thumbnail list + */ + vpaned = eog_vertical_splitter_new (); + /* the image view for the full size image */ priv->scroll_view = eog_scroll_view_new (); g_object_set (G_OBJECT (priv->scroll_view), "height_request", 250, NULL); @@ -1139,23 +1146,34 @@ create_user_interface (EogCollectionView *list_view) gtk_container_add (GTK_CONTAINER (frame), priv->scroll_view); #if HAVE_EXIF - /* info view for additional image information */ + /* If we have additional information through libexif, we + * create an info view widget and put it to left of the + * image view. Using an eog_horizontal_splitter for this. + */ priv->info_view = gtk_widget_new (EOG_TYPE_INFO_VIEW, NULL); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (sw), priv->info_view); -#else - priv->info_view = NULL; - sw = NULL; -#endif - hpaned = gtk_hpaned_new (); /* FIXME: use specalised eog splitter */ + /* left side holds the image view, right side the info view */ + hpaned = eog_horizontal_splitter_new (); gtk_paned_pack1 (GTK_PANED (hpaned), frame, TRUE, TRUE); gtk_paned_pack2 (GTK_PANED (hpaned), sw, FALSE, TRUE); gtk_widget_show_all (hpaned); + gtk_paned_pack1 (GTK_PANED (vpaned), hpaned, TRUE, TRUE); + +#else + /* If libexif isn't available we put the image view (frame) + * directly into the vpaned created above. + */ + priv->info_view = NULL; + gtk_widget_show_all (frame); + gtk_paned_pack1 (GTK_PANED (vpaned), frame, TRUE, TRUE); +#endif + /* the wrap list for all the thumbnails */ priv->wraplist = eog_wrap_list_new (); g_object_set (G_OBJECT (priv->wraplist), @@ -1174,11 +1192,7 @@ create_user_interface (EogCollectionView *list_view) GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (sw), priv->wraplist); gtk_widget_show_all (sw); - - /* put it all together */ - vpaned = eog_vertical_splitter_new (); - gtk_paned_pack1 (GTK_PANED (vpaned), hpaned, TRUE, TRUE); gtk_paned_pack2 (GTK_PANED (vpaned), sw, TRUE, TRUE); /* by default make the wrap list keyboard active */ diff --git a/libeog/eog-scroll-view.c b/libeog/eog-scroll-view.c index 06c5535a..284900d0 100644 --- a/libeog/eog-scroll-view.c +++ b/libeog/eog-scroll-view.c @@ -474,8 +474,14 @@ paint_rectangle (EogScrollView *view, ArtIRect *rect, GdkInterpType interp_type) priv = view->priv; + if (!GTK_WIDGET_DRAWABLE (priv->display)) + return; + compute_scaled_size (view, priv->zoom, &scaled_width, &scaled_height); + if (scaled_width <= 1 || scaled_height <= 1) + return; + width = GTK_WIDGET (priv->display)->allocation.width; height = GTK_WIDGET (priv->display)->allocation.height; @@ -1805,7 +1811,7 @@ eog_scroll_view_dispose (GObject *object) view = EOG_SCROLL_VIEW (object); priv = view->priv; - + if (priv->uta != NULL) { art_uta_free (priv->uta); priv->uta = NULL; |