summaryrefslogtreecommitdiff
path: root/src/trg-general-panel.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-03-08 23:28:26 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-03-08 23:28:26 +0000
commitce795861eeb1893e40e4476fea71986450658948 (patch)
tree4d0246b81e81a7a1e567af286c4a2bba9c1d65d8 /src/trg-general-panel.c
parent1390c1426d82cc1e1598e648235cd139b248fa5a (diff)
some missing files needed for i18n
Diffstat (limited to 'src/trg-general-panel.c')
-rw-r--r--src/trg-general-panel.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/trg-general-panel.c b/src/trg-general-panel.c
index c89f994..3c3b5a2 100644
--- a/src/trg-general-panel.c
+++ b/src/trg-general-panel.c
@@ -189,18 +189,18 @@ void trg_general_panel_update(TrgGeneralPanel * panel, JsonObject * t,
static GtkLabel *trg_general_panel_add_label_with_width(TrgGeneralPanel *gp,
char *key, guint col, guint row, gint width)
{
- GtkWidget *keyLabel;
- GtkWidget *value;
- GtkWidget *alignment;
- gchar *keyMarkup;
+ GtkWidget *value, *keyLabel, *alignment;
+
int startCol = (col == 0) ? 0 : col*2;
alignment = gtk_alignment_new(0, 0, 0, 0);
keyLabel = gtk_label_new(NULL);
- keyMarkup =
- g_markup_printf_escaped(strlen(key) > 0 ? "<b>%s:</b>" : "", key);
- gtk_label_set_markup(GTK_LABEL(keyLabel), keyMarkup);
- g_free(keyMarkup);
+ if (strlen(key) > 0) {
+ gchar *keyMarkup =
+ g_markup_printf_escaped(strlen(key) > 0 ? "<b>%s:</b>" : "", key);
+ gtk_label_set_markup(GTK_LABEL(keyLabel), keyMarkup);
+ g_free(keyMarkup);
+ }
gtk_container_add(GTK_CONTAINER(alignment), keyLabel);
gtk_table_attach(GTK_TABLE(gp), alignment, startCol, startCol+1, row, row+1, GTK_FILL, 0, TRG_GENERAL_PANEL_SPACING_X, TRG_GENERAL_PANEL_SPACING_Y);