#include "modest-window.h"
#include "modest-window-priv.h"
+#include "modest-ui-actions.h"
#include "modest-tny-platform-factory.h"
+#include "modest-runtime.h"
+#include "modest-window-mgr.h"
/* 'private'/'protected' functions */
static void modest_window_class_init (ModestWindowClass *klass);
static void modest_window_show_toolbar_default (ModestWindow *window,
gboolean show_toolbar);
+static gboolean on_key_pressed (GtkWidget *self, GdkEventKey *event, gpointer user_data);
+
+
/* list my signals */
enum {
LAST_SIGNAL
priv->menubar = NULL;
priv->active_account = NULL;
+
+ /* Connect signals */
+ g_signal_connect (G_OBJECT (obj),
+ "key-press-event",
+ G_CALLBACK (on_key_pressed), NULL);
}
static void
klass->save_state_func (window);
}
-
+static gboolean
+on_key_pressed (GtkWidget *self,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ ModestWindowMgr *mgr = NULL;
+
+ mgr = modest_runtime_get_window_mgr ();
+
+ switch (event->keyval) {
+ case GDK_F6:
+ modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self));
+ return TRUE;
+ case GDK_F7:
+ modest_ui_actions_on_zoom_plus (NULL, MODEST_WINDOW(self));
+ return TRUE;
+ case GDK_F8:
+ modest_ui_actions_on_zoom_minus (NULL, MODEST_WINDOW(self));
+ return TRUE;
+ case GDK_Escape:
+ if (modest_window_mgr_get_fullscreen_mode (mgr))
+ modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self));
+ break;
+ }
+
+ return FALSE;
+}