aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-10-28 03:43:25 +0800
committerMilan Crha <mcrha@redhat.com>2010-10-28 03:43:25 +0800
commit2de2e7f12f3b4e5944732d1c2172a3d174d5a219 (patch)
tree8630b1ae27ddbaa9f09656b21fe512f31f15118a /widgets/misc
parent9662ac73ccc857e04b941596eb58f72ecf01b76f (diff)
downloadgsoc2013-evolution-2de2e7f12f3b4e5944732d1c2172a3d174d5a219.tar.gz
gsoc2013-evolution-2de2e7f12f3b4e5944732d1c2172a3d174d5a219.tar.zst
gsoc2013-evolution-2de2e7f12f3b4e5944732d1c2172a3d174d5a219.zip
Workaround GtkComboBoxText/GtkComboBoxEntry in .ui files
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/e-dateedit.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index da3c9dbad5..5045a1d53f 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -573,11 +573,22 @@ create_children (EDateEdit *dedit)
time_store = gtk_list_store_new (1, G_TYPE_STRING);
#if GTK_CHECK_VERSION(2,23,0)
priv->time_combo = g_object_new (
- GTK_TYPE_COMBO_BOX,
+ GTK_TYPE_COMBO_BOX_TEXT,
"model", time_store,
"has-entry", TRUE,
"entry-text-column", 0,
NULL);
+
+ {
+ GtkCellRenderer *cell;
+
+ gtk_cell_layout_clear (GTK_CELL_LAYOUT (priv->time_combo));
+
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->time_combo), cell, TRUE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->time_combo), cell, "text", 0, NULL);
+ }
+
#else
priv->time_combo = gtk_combo_box_entry_new_with_model (
GTK_TREE_MODEL (time_store), 0);
@@ -1581,16 +1592,16 @@ static void
rebuild_time_popup (EDateEdit *dedit)
{
EDateEditPrivate *priv;
- GtkComboBoxText *combo;
+ GtkListStore *list_store;
+ GtkTreeIter iter;
gchar buffer[40];
struct tm tmp_tm;
gint hour, min;
priv = dedit->priv;
- combo = GTK_COMBO_BOX_TEXT (priv->time_combo);
-
- gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (combo)));
+ list_store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->time_combo)));
+ gtk_list_store_clear (list_store);
/* Fill the struct tm with some sane values. */
tmp_tm.tm_year = 2000;
@@ -1633,7 +1644,8 @@ rebuild_time_popup (EDateEdit *dedit)
if (!priv->use_24_hour_format && buffer[0] == '0')
buffer[0] = ' ';
- gtk_combo_box_text_append_text (combo, buffer);
+ gtk_list_store_append (list_store, &iter);
+ gtk_list_store_set (list_store, &iter, 0, buffer, -1);
}
}
}