summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-20 11:24:15 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-20 11:24:15 -0700
commit6ea513246363ba2df29b0dfa9bc752c7d40c0c38 (patch)
tree7ed53cde6e6ab60699846d99ebfa9ea4067aa9e7 /divelist.c
parent03b2e565503d383acc5f2867404cc39c0a2add80 (diff)
downloadsubsurface-6ea513246363ba2df29b0dfa9bc752c7d40c0c38.tar.gz
Make the divelist font configurable
Instead of the hardcoding to "Sans 8", allow people to set it in the preferences. Also, make the unit choice be a frame in the preferences dialog instead. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/divelist.c b/divelist.c
index 0a601c511..01ab1b11a 100644
--- a/divelist.c
+++ b/divelist.c
@@ -344,6 +344,13 @@ void flush_divelist(struct dive *dive)
gtk_tree_model_foreach(model, set_one_dive, dive);
}
+void set_divelist_font(const char *font)
+{
+ PangoFontDescription *font_desc = pango_font_description_from_string(font);
+ gtk_widget_modify_font(dive_list.tree_view, font_desc);
+ pango_font_description_free(font_desc);
+}
+
void update_dive_list_units(void)
{
const char *unit;
@@ -446,7 +453,6 @@ static GtkTreeViewColumn *divelist_column(struct DiveList *dl, int index, const
GtkWidget *dive_list_create(void)
{
GtkTreeSelection *selection;
- PangoFontDescription *font_desc = pango_font_description_from_string("sans 8");
dive_list.model = gtk_list_store_new(DIVELIST_COLUMNS,
G_TYPE_INT, /* index */
@@ -460,8 +466,7 @@ GtkWidget *dive_list_create(void)
G_TYPE_INT /* SAC */
);
dive_list.tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dive_list.model));
- gtk_widget_modify_font(dive_list.tree_view, font_desc);
- pango_font_description_free(font_desc);
+ set_divelist_font(divelist_font);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dive_list.tree_view));