aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-02-15 14:41:43 -0500
committerMichael Terry <mike@mterry.name>2011-02-15 14:41:43 -0500
commit36b4e93794c845e5caac71556b9a05d7e474d35a (patch)
tree9a95584c6f76f2df31d65bca709af207c369b774
parentd0f273eb94489f7c0e0c8b57c1d07c3f1a2f66a2 (diff)
downloadayatana-indicator-datetime-36b4e93794c845e5caac71556b9a05d7e474d35a.tar.gz
ayatana-indicator-datetime-36b4e93794c845e5caac71556b9a05d7e474d35a.tar.bz2
ayatana-indicator-datetime-36b4e93794c845e5caac71556b9a05d7e474d35a.zip
use a GtkCheckMenuItem, not a GtkRadioButton, to render timezone items
-rw-r--r--src/indicator-datetime.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 6c9ac55..2a309d2 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -105,7 +105,6 @@ enum {
typedef struct _indicator_item_t indicator_item_t;
struct _indicator_item_t {
- GtkWidget * radio;
GtkWidget * icon;
GtkWidget * label;
GtkWidget * right;
@@ -176,7 +175,6 @@ static void update_time (IndicatorDatetime * self);
static void receive_signal (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, GVariant * parameters, gpointer user_data);
static void service_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data);
static gint generate_strftime_bitmask (const char *time_str);
-static GSList *location_group = NULL;
/* Indicator Module Config */
INDICATOR_SET_VERSION
@@ -1238,20 +1236,14 @@ new_timezone_item(DbusmenuMenuitem * newitem,
// Menu item with a radio button and a right aligned time
indicator_item_t * mi_data = g_new0(indicator_item_t, 1);
- GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_menu_item_new());
+ GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_check_menu_item_new());
+
+ gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(gmi), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gmi),
+ dbusmenu_menuitem_property_get_bool(newitem, TIMEZONE_MENUITEM_PROP_RADIO));
GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
- mi_data->radio = gtk_radio_button_new(location_group);
- if (location_group == NULL)
- location_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(mi_data->radio));
-
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mi_data->radio),
- dbusmenu_menuitem_property_get_bool(newitem, TIMEZONE_MENUITEM_PROP_RADIO));
-
- gtk_box_pack_start(GTK_BOX(hbox), mi_data->radio, FALSE, FALSE, 0);
- gtk_widget_show(mi_data->radio);
-
/* Label, probably a username, chat room or mailbox name */
mi_data->label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, TIMEZONE_MENUITEM_PROP_LABEL));
gtk_misc_set_alignment(GTK_MISC(mi_data->label), 0.0, 0.5);