aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-timezone-entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-timezone-entry.c')
-rw-r--r--calendar/gui/e-timezone-entry.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c
index fc95d83a74..0c2c795bf3 100644
--- a/calendar/gui/e-timezone-entry.c
+++ b/calendar/gui/e-timezone-entry.c
@@ -36,6 +36,7 @@
#include <gnome.h>
#include <gal/util/e-util.h>
#include <widgets/e-timezone-dialog/e-timezone-dialog.h>
+#include <libgnome/gnome-i18n.h>
#include "e-timezone-entry.h"
#include <e-util/e-icon-factory.h>
@@ -68,6 +69,8 @@ static void e_timezone_entry_destroy (GtkObject *object);
static gboolean e_timezone_entry_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling);
+static gboolean e_timezone_entry_focus (GtkWidget *widget,
+ GtkDirectionType direction);
static void on_entry_changed (GtkEntry *entry,
ETimezoneEntry *tentry);
static void on_button_clicked (GtkWidget *widget,
@@ -93,6 +96,7 @@ e_timezone_entry_class_init (ETimezoneEntryClass *class)
parent_class = g_type_class_peek_parent (class);
widget_class->mnemonic_activate = e_timezone_entry_mnemonic_activate;
+ widget_class->focus = e_timezone_entry_focus;
timezone_entry_signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_LAST,
@@ -115,6 +119,7 @@ e_timezone_entry_init (ETimezoneEntry *tentry)
ETimezoneEntryPrivate *priv;
GtkWidget *gtk_image;
GdkPixbuf *gdk_pixbuf;
+ AtkObject *a11y;
tentry->priv = priv = g_new0 (ETimezoneEntryPrivate, 1);
@@ -132,6 +137,10 @@ e_timezone_entry_init (ETimezoneEntry *tentry)
g_signal_connect (priv->button, "clicked", G_CALLBACK (on_button_clicked), tentry);
gtk_box_pack_start (GTK_BOX (tentry), priv->button, FALSE, FALSE, 6);
gtk_widget_show (priv->button);
+ a11y = gtk_widget_get_accessible (priv->button);
+ if (a11y != NULL) {
+ atk_object_set_name (a11y, _("Timezone Button"));
+ }
gdk_pixbuf = e_icon_factory_get_icon ("stock_timezone", E_ICON_SIZE_BUTTON);
gtk_image = gtk_image_new_from_pixbuf (gdk_pixbuf);
@@ -314,3 +323,34 @@ e_timezone_entry_mnemonic_activate (GtkWidget *widget,
return TRUE;
}
+static gboolean
+e_timezone_entry_focus (GtkWidget *widget, GtkDirectionType direction)
+{
+ ETimezoneEntry *tentry;
+
+ tentry = E_TIMEZONE_ENTRY (widget);
+
+ if (direction == GTK_DIR_TAB_FORWARD) {
+ if (GTK_WIDGET_HAS_FOCUS (tentry->priv->entry))
+ gtk_widget_grab_focus (tentry->priv->button);
+ else if (GTK_WIDGET_HAS_FOCUS (tentry->priv->button))
+ return FALSE;
+ else if (GTK_WIDGET_VISIBLE (tentry->priv->entry))
+ gtk_widget_grab_focus (tentry->priv->entry);
+ else
+ gtk_widget_grab_focus (tentry->priv->button);
+ } else if (direction == GTK_DIR_TAB_BACKWARD) {
+ if (GTK_WIDGET_HAS_FOCUS (tentry->priv->entry))
+ return FALSE;
+ else if (GTK_WIDGET_HAS_FOCUS (tentry->priv->button)) {
+ if (GTK_WIDGET_VISIBLE (tentry->priv->entry))
+ gtk_widget_grab_focus (tentry->priv->entry);
+ else
+ return FALSE;
+ } else
+ gtk_widget_grab_focus (tentry->priv->button);
+ } else
+ return FALSE;
+ return TRUE;
+}
+