summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-16 15:45:14 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-16 15:45:14 -0700
commit89fe2c723f10649d2d98a88b385bd4733e5acbc4 (patch)
tree5f005b1e30a8814d92ffc76986a34e341f210230 /info.c
parentff0a601cc300f11a3e5a31236cb9a884ad82ceec (diff)
downloadsubsurface-89fe2c723f10649d2d98a88b385bd4733e5acbc4.tar.gz
Show tank / nitrox / air consumption information in the info_frame
Even though we go down to an 8pt font the info_frame changes size when the air info is added. I don't like this but want to see how Linus would like this resolved before going overboard. Minor tweaks to the formating (we don't need two decimals when printing the liters of air consumed). This patch does NOT remove the plot of the air information in the profile graph. I think we want to remove that once we like the text where it is, but I wanted to do one thing at a time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/info.c b/info.c
index e9ecc9f50..d303a1137 100644
--- a/info.c
+++ b/info.c
@@ -8,7 +8,7 @@
#include "divelist.h"
static GtkWidget *info_frame;
-static GtkWidget *depth, *duration, *temperature;
+static GtkWidget *depth, *duration, *temperature, *airconsumption;
static GtkEntry *location, *buddy, *divemaster;
static GtkTextBuffer *notes;
static int location_changed = 1, notes_changed = 1;
@@ -67,6 +67,7 @@ void show_dive_info(struct dive *dive)
if (!dive) {
gtk_label_set_text(GTK_LABEL(depth), "");
gtk_label_set_text(GTK_LABEL(duration), "");
+ gtk_label_set_text(GTK_LABEL(airconsumption), "");
return;
}
/* dive number and location (or lacking that, the date) go in the window title */
@@ -181,10 +182,19 @@ GtkWidget *dive_info_frame(void)
depth = info_label(hbox, "depth", GTK_JUSTIFY_RIGHT);
duration = info_label(hbox, "duration", GTK_JUSTIFY_RIGHT);
temperature = info_label(hbox, "temperature", GTK_JUSTIFY_RIGHT);
+ airconsumption = info_label(hbox, "air", GTK_JUSTIFY_RIGHT);
return frame;
}
+void update_air_info(char *buffer)
+{
+ char markup[120];
+
+ snprintf(markup, sizeof(markup), "<span font=\"8\">%s</span>",buffer);
+ gtk_label_set_markup(GTK_LABEL(airconsumption), markup);
+}
+
static GtkEntry *text_entry(GtkWidget *box, const char *label)
{
GtkWidget *entry;