[gthumb] Bug 328138 – Vertical layout for EXIF info/comment pane
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb] Bug 328138 – Vertical layout for EXIF info/comment pane
- Date: Mon, 15 Jun 2009 09:19:08 -0400 (EDT)
commit 55784b11a1ac517dd37f5ae5a9e8a935e5e2f77d
Author: Marc Pavot <marc pavot gmail com>
Date: Mon Jun 15 09:18:33 2009 -0400
Bug 328138 â?? Vertical layout for EXIF info/comment pane
libgthumb/gtk-utils.c | 9 ---------
libgthumb/gtk-utils.h | 2 --
src/gth-browser.c | 14 ++++++++------
src/gth-viewer.c | 38 +++++++++++++++++++-------------------
4 files changed, 27 insertions(+), 36 deletions(-)
---
diff --git a/libgthumb/gtk-utils.c b/libgthumb/gtk-utils.c
index 1a371be..7f48913 100644
--- a/libgthumb/gtk-utils.c
+++ b/libgthumb/gtk-utils.c
@@ -789,15 +789,6 @@ exec_command (const char *application,
}
-int
-_gtk_widget_get_height (GtkWidget *widget)
-{
- int w, h;
- gdk_drawable_get_size (widget->window, &w, &h);
- return h;
-}
-
-
void
gth_get_screen_size (GtkWindow *window, int *width, int *height)
{
diff --git a/libgthumb/gtk-utils.h b/libgthumb/gtk-utils.h
index 3bdcc77..b633d56 100644
--- a/libgthumb/gtk-utils.h
+++ b/libgthumb/gtk-utils.h
@@ -107,8 +107,6 @@ GtkWidget * create_image (GtkIconTheme *icon_theme,
const char *icon_path,
int icon_size);
-int _gtk_widget_get_height (GtkWidget *widget);
-
void gth_get_screen_size (GtkWindow *window,
int *width,
int *height);
diff --git a/src/gth-browser.c b/src/gth-browser.c
index 8107de8..79465f1 100644
--- a/src/gth-browser.c
+++ b/src/gth-browser.c
@@ -6772,7 +6772,7 @@ gth_browser_construct (GthBrowser *browser,
/* image preview, comment, exif data. */
- priv->image_main_pane = image_pane_paned1 = gtk_vpaned_new ();
+ priv->image_main_pane = image_pane_paned1 = gtk_hpaned_new ();
gtk_widget_show (priv->image_main_pane);
gtk_box_pack_start (GTK_BOX (image_vbox), image_pane_paned1, TRUE, TRUE, 0);
@@ -6780,13 +6780,13 @@ gth_browser_construct (GthBrowser *browser,
/**/
priv->preview_widget_image = gth_nav_window_new (GTH_IVIEWER (priv->viewer));
- gtk_paned_pack1 (GTK_PANED (image_pane_paned1), priv->preview_widget_image, FALSE, FALSE);
+ gtk_paned_pack2 (GTK_PANED (image_pane_paned1), priv->preview_widget_image, TRUE, FALSE);
/**/
- priv->preview_widget_data_comment = image_pane_paned2 = gtk_hpaned_new ();
+ priv->preview_widget_data_comment = image_pane_paned2 = gtk_vpaned_new ();
gtk_widget_show (priv->preview_widget_data_comment);
- gtk_paned_pack2 (GTK_PANED (image_pane_paned1), image_pane_paned2, TRUE, FALSE);
+ gtk_paned_pack1 (GTK_PANED (image_pane_paned1), image_pane_paned2, FALSE, FALSE);
priv->preview_widget_comment = scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
@@ -6994,7 +6994,8 @@ gth_browser_construct (GthBrowser *browser,
set_mode_specific_ui_info (browser, GTH_SIDEBAR_DIR_LIST, TRUE);
- gtk_paned_set_position (GTK_PANED (browser->priv->image_main_pane), eel_gconf_get_integer (PREF_UI_WINDOW_HEIGHT, DEF_WIN_HEIGHT) - eel_gconf_get_integer (PREF_UI_COMMENT_PANE_SIZE, DEFAULT_COMMENT_PANE_SIZE));
+ gtk_paned_set_position (GTK_PANED (browser->priv->image_main_pane),
+ eel_gconf_get_integer (PREF_UI_COMMENT_PANE_SIZE, DEFAULT_COMMENT_PANE_SIZE));
gtk_paned_set_position (GTK_PANED (image_pane_paned2), eel_gconf_get_integer (PREF_UI_WINDOW_WIDTH, DEF_WIN_WIDTH) / 2);
/* Add notification callbacks. */
@@ -7236,7 +7237,8 @@ close__step6 (FileData *file,
else
eel_gconf_set_integer (PREF_UI_SIDEBAR_SIZE, priv->sidebar_width);
- eel_gconf_set_integer (PREF_UI_COMMENT_PANE_SIZE, _gtk_widget_get_height (GTK_WIDGET (browser)) - gtk_paned_get_position (GTK_PANED (priv->image_main_pane)));
+ eel_gconf_set_integer (PREF_UI_COMMENT_PANE_SIZE,
+ gtk_paned_get_position (GTK_PANED (priv->image_main_pane)));
if (last_window)
eel_gconf_set_boolean (PREF_SHOW_THUMBNAILS, priv->file_list->enable_thumbs);
diff --git a/src/gth-viewer.c b/src/gth-viewer.c
index bae6bd1..4a5eb18 100644
--- a/src/gth-viewer.c
+++ b/src/gth-viewer.c
@@ -83,7 +83,7 @@ struct _GthViewerPrivateData {
GtkWidget *statusbar;
GtkWidget *image_popup_menu;
GtkWidget *viewer;
- GtkWidget *image_data_hpaned;
+ GtkWidget *image_data_vpaned;
GtkWidget *image_comment;
GtkWidget *exif_data_viewer;
GtkWidget *image_info; /* statusbar widgets. */
@@ -473,7 +473,7 @@ gth_viewer_unrealize (GtkWidget *widget)
/* save ui preferences. */
save_window_size (viewer);
- eel_gconf_set_integer (PREF_UI_COMMENT_PANE_SIZE, _gtk_widget_get_height (widget) - gtk_paned_get_position (GTK_PANED (viewer->priv->image_main_pane)));
+ eel_gconf_set_integer (PREF_UI_COMMENT_PANE_SIZE, gtk_paned_get_position (GTK_PANED (viewer->priv->image_main_pane)));
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
}
@@ -1153,9 +1153,9 @@ comment_button_toggled_cb (GtkToggleButton *button,
set_action_active (viewer, "View_ShowMetadata", visible);
viewer->priv->image_data_visible = visible;
if (visible)
- gtk_widget_show (viewer->priv->image_data_hpaned);
+ gtk_widget_show (viewer->priv->image_data_vpaned);
else
- gtk_widget_hide (viewer->priv->image_data_hpaned);
+ gtk_widget_hide (viewer->priv->image_data_vpaned);
return TRUE;
}
@@ -1341,7 +1341,7 @@ gth_viewer_construct (GthViewer *viewer,
GtkWidget *image_vbox;
GtkWidget *button;
GtkWidget *image;
- GtkWidget *image_vpaned;
+ GtkWidget *image_hpaned;
GtkWidget *nav_window;
GtkWidget *scrolled_window;
GtkActionGroup *actions;
@@ -1530,13 +1530,13 @@ gth_viewer_construct (GthViewer *viewer,
image_vbox
|
- +- image_vpaned
+ +- image_hpaned
|
+- nav_window
| |
| +- priv->viewer
|
- +- priv->image_data_hpaned
+ +- priv->image_data_vpaned
|
+- scrolled_window
| |
@@ -1548,32 +1548,32 @@ gth_viewer_construct (GthViewer *viewer,
image_vbox = gtk_vbox_new (FALSE, 0);
- /* * image_vpaned */
+ /* * image_hpaned */
- priv->image_main_pane = image_vpaned = gtk_vpaned_new ();
- gtk_paned_set_position (GTK_PANED (viewer->priv->image_main_pane), eel_gconf_get_integer (PREF_UI_VIEWER_HEIGHT, DEFAULT_WIN_HEIGHT) - eel_gconf_get_integer (PREF_UI_COMMENT_PANE_SIZE, DEFAULT_COMMENT_PANE_SIZE));
+ priv->image_main_pane = image_hpaned = gtk_hpaned_new ();
+ gtk_paned_set_position (GTK_PANED (viewer->priv->image_main_pane), eel_gconf_get_integer (PREF_UI_COMMENT_PANE_SIZE, DEFAULT_COMMENT_PANE_SIZE));
- /* ** priv->image_data_hpaned */
+ /* ** priv->image_data_vpaned */
- priv->image_data_hpaned = gtk_hpaned_new ();
- gtk_paned_set_position (GTK_PANED (priv->image_data_hpaned), eel_gconf_get_integer (PREF_UI_VIEWER_WIDTH, DEFAULT_WIN_WIDTH) / 2);
+ priv->image_data_vpaned = gtk_vpaned_new ();
+ gtk_paned_set_position (GTK_PANED (priv->image_data_vpaned), eel_gconf_get_integer (PREF_UI_VIEWER_WIDTH, DEFAULT_WIN_WIDTH) / 2);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_ETCHED_IN);
gtk_container_add (GTK_CONTAINER (scrolled_window), priv->image_comment);
- gtk_paned_pack2 (GTK_PANED (priv->image_data_hpaned), scrolled_window, TRUE, FALSE);
- gtk_paned_pack1 (GTK_PANED (priv->image_data_hpaned), priv->exif_data_viewer, FALSE, FALSE);
+ gtk_paned_pack2 (GTK_PANED (priv->image_data_vpaned), scrolled_window, TRUE, FALSE);
+ gtk_paned_pack1 (GTK_PANED (priv->image_data_vpaned), priv->exif_data_viewer, FALSE, FALSE);
/**/
- gtk_paned_pack1 (GTK_PANED (image_vpaned), nav_window, FALSE, FALSE);
- gtk_paned_pack2 (GTK_PANED (image_vpaned), priv->image_data_hpaned, TRUE, FALSE);
+ gtk_paned_pack2 (GTK_PANED (image_hpaned), nav_window, TRUE, FALSE);
+ gtk_paned_pack1 (GTK_PANED (image_hpaned), priv->image_data_vpaned, FALSE, FALSE);
- gtk_box_pack_start (GTK_BOX (image_vbox), image_vpaned, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (image_vbox), image_hpaned, TRUE, TRUE, 0);
gtk_widget_show_all (image_vbox);
- gtk_widget_hide (priv->image_data_hpaned); /* FIXME */
+ gtk_widget_hide (priv->image_data_vpaned); /* FIXME */
gth_window_attach (GTH_WINDOW (viewer), image_vbox, GTH_WINDOW_CONTENTS);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]