summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-16 20:13:57 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-16 20:16:52 -0700
commit4564d67953af9bfa8086c457b26e3b66f1c2718d (patch)
tree3f0fff2ac25dbf53c5de8c998ef49873432cdec9 /info.c
parent1937df188a2928478a9012a382ba1360d5e309b7 (diff)
downloadsubsurface-4564d67953af9bfa8086c457b26e3b66f1c2718d.tar.gz
More fixes to positioning of gas / consumption information in info_frame
This gives the airconsumption label a fixed size and changes its alignment so it is anchored to the right. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/info.c b/info.c
index d303a1137..5cfe7286c 100644
--- a/info.c
+++ b/info.c
@@ -14,6 +14,9 @@ static GtkTextBuffer *notes;
static int location_changed = 1, notes_changed = 1;
static int divemaster_changed = 1, buddy_changed = 1;
+#define EMPTY_AIRCONSUMPTION " \n "
+#define AIRCON_WIDTH 20
+
static const char *weekday(int wday)
{
static const char wday_array[7][4] = {
@@ -67,7 +70,8 @@ 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), "");
+ gtk_label_set_text(GTK_LABEL(airconsumption), EMPTY_AIRCONSUMPTION);
+ gtk_label_set_width_chars(GTK_LABEL(airconsumption), AIRCON_WIDTH);
return;
}
/* dive number and location (or lacking that, the date) go in the window title */
@@ -183,6 +187,8 @@ GtkWidget *dive_info_frame(void)
duration = info_label(hbox, "duration", GTK_JUSTIFY_RIGHT);
temperature = info_label(hbox, "temperature", GTK_JUSTIFY_RIGHT);
airconsumption = info_label(hbox, "air", GTK_JUSTIFY_RIGHT);
+ gtk_misc_set_alignment(GTK_MISC(airconsumption), 1.0, 0.5);
+ gtk_label_set_width_chars(GTK_LABEL(airconsumption), AIRCON_WIDTH);
return frame;
}