summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-28 05:44:09 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-28 05:48:03 -0800
commit11a3f3f7f72811df00cdeb703d44c31fcd1500da (patch)
tree9c333d48577a8acc64bd45359bfccef85678cb77 /info.c
parent834dc9f5cb509789bf34b566c1974da93d78c7da (diff)
downloadsubsurface-11a3f3f7f72811df00cdeb703d44c31fcd1500da.tar.gz
Change layout of dive editing dialog
We had a report that on small screen systems like netbooks with a vertical screen resolution of only 600 pixels Subsurface has usability issues, as the dive editing dialog is taller than the screen. While on some OSs the dialog can at least be moved around so the user can fill it out and click OK or Cancel, on others (Windows XP) that does not appear to be the case. This small change simply takes the equipment part of this dialog and positions it next to the dive info part instead of below it. This appears to solve the immediate issue - but by adding the maximum number of tanks and weight systems the dialog can still grow beyond 600 pixels vertically, so we may have to add a scroll widget in here as well. But for now this should be a nice improvement (and I find it reasonably pleasing on a large display as well). Fixes #67 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/info.c b/info.c
index 9a5c3a1a2..614bfdbf6 100644
--- a/info.c
+++ b/info.c
@@ -754,9 +754,9 @@ static void location_entry_change_cb(GtkComboBox *location, gpointer *userdata)
update_gps_entry(0, 0);
}
-static void dive_info_widget(GtkWidget *box, struct dive *dive, struct dive_info *info, gboolean multi)
+static void dive_info_widget(GtkWidget *obox, struct dive *dive, struct dive_info *info, gboolean multi)
{
- GtkWidget *hbox, *label, *frame, *equipment;
+ GtkWidget *hbox, *label, *frame, *equipment, *ibox, *box;
#if HAVE_OSM_GPS_MAP
GtkWidget *image;
#endif
@@ -766,11 +766,16 @@ static void dive_info_widget(GtkWidget *box, struct dive *dive, struct dive_info
double value;
snprintf(buffer, sizeof(buffer), "%s", _("Edit multiple dives"));
-
if (!multi)
divename(buffer, sizeof(buffer), dive);
label = gtk_label_new(buffer);
- gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(obox), label, FALSE, TRUE, 0);
+
+ /* two column layout (inner hbox ibox) within the outer vbox (obox) we are given */
+ ibox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(obox), ibox, FALSE, FALSE, 0);
+ box = gtk_vbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(ibox), box, FALSE, FALSE, 0);
info->location = text_entry(box, _("Location"), location_list, dive->location);
g_signal_connect(G_OBJECT(info->location), "changed", G_CALLBACK(location_entry_change_cb), NULL);
@@ -830,7 +835,7 @@ static void dive_info_widget(GtkWidget *box, struct dive *dive, struct dive_info
gtk_text_buffer_set_text(gtk_text_view_get_buffer(info->notes), dive->notes, -1);
}
hbox = gtk_hbox_new(FALSE, 3);
- gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(ibox), hbox, FALSE, TRUE, 0);
/* create a secondary Equipment widget */
frame = gtk_frame_new(_("Equipment"));