static void show_all_header_cb (GtkAction *action,
gpointer data);
+static void toggle_fullscreen_cb (GtkAction *action,
+ gpointer data);
static void hide_quotes_cb(GtkAction *action,
gpointer data);
{"View/ShowHide/ColumnHeaders", NULL, N_("Column headers"), NULL, NULL, G_CALLBACK(toggle_col_headers_cb) }, /* toggle */
{"View/ThreadView", NULL, N_("Th_read view"), "<control>T", NULL, G_CALLBACK(thread_cb) }, /* toggle */
{"View/HideReadMessages", NULL, N_("_Hide read messages"), NULL, NULL, G_CALLBACK(hide_read_messages) }, /* toggle */
+#ifndef MAEMO
+ {"View/FullScreen", NULL, N_("_Fullscreen"), "F11", NULL, G_CALLBACK(toggle_fullscreen_cb) }, /* toggle */
+#endif
{"View/AllHeaders", NULL, N_("Show all _headers"), "<control>H", NULL, G_CALLBACK(show_all_header_cb) }, /* toggle */
{"View/Quotes/FoldAll", NULL, N_("_Fold all"), "<control><shift>Q", NULL, G_CALLBACK(hide_quotes_cb) }, /* 1 toggle */
{"View/Quotes/Fold2", NULL, N_("Fold from level _2"), NULL, NULL, G_CALLBACK(hide_quotes_cb) }, /* 2 toggle */
summary_set_tag(mainwin->summaryview, id, NULL);
}
+void mainwin_accel_changed_cb (GtkAccelGroup *accelgroup, guint keyval, GdkModifierType modifier,
+ GClosure *closure, GtkMenuItem *item)
+{
+ GList *closures = gtk_widget_list_accel_closures(GTK_WIDGET(item));
+ GList *cur;
+ for (cur = closures; cur; cur = cur->next) {
+ if (closure == cur->data) {
+ GtkLabel *label = g_object_get_data(G_OBJECT(item), "accel_label");
+ gchar *new_accel;
+
+ if (keyval == GDK_BackSpace) {
+ const gchar *accel_path;
+#if GTK_CHECK_VERSION(2,14,0)
+ accel_path = gtk_menu_item_get_accel_path(item);
+#else
+ accel_path = GTK_MENU_ITEM(item)->accel_path;
+#endif
+ keyval = 0; modifier = 0;
+ gtk_accel_map_change_entry (accel_path, keyval, modifier, TRUE);
+ }
+ new_accel = gtk_accelerator_get_label(keyval, modifier);
+ gtk_label_set_text(label, new_accel);
+ g_free(new_accel);
+ }
+ }
+}
+
static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refresh)
{
GtkWidget *label_menuitem;
g_object_set_data(G_OBJECT(item), "mainwin",
mainwin);
gtk_widget_show(item);
- accel_path = g_strdup_printf("<ClawsColorLabels>/%d", i);
+ accel_path = g_strdup_printf("<ClawsColorLabels>/%d", i+1);
gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
if (i < 9)
gtk_accel_map_add_entry(accel_path, GDK_1+i, GDK_CONTROL_MASK);
g_free(accel_path);
+ g_signal_connect (gtk_ui_manager_get_accel_group(mainwin->ui_manager),
+ "accel-changed", G_CALLBACK (mainwin_accel_changed_cb), item);
+
+
}
gtk_widget_show(menu);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menuitem), menu);
}
}
break;
+
#ifdef MAEMO
case GDK_F6:
if (maemo_mainwindow_is_fullscreen(widget)) {
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/SetColumns", "Messagelist", "View/SetColumns/Messagelist", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator1", "View/---", GTK_UI_MANAGER_SEPARATOR)
+#ifndef MAEMO
+ MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "FullScreen", "View/FullScreen", GTK_UI_MANAGER_MENUITEM)
+#endif
#ifndef GENERIC_UMPC
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Layout", "View/Layout", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "Standard", "View/Layout/Standard", GTK_UI_MANAGER_MENUITEM)
hildon_window_set_menu(HILDON_WINDOW(window), GTK_MENU(menubar));
#endif
-
if (prefs_common.toolbar_detachable) {
handlebox = gtk_handle_box_new();
gtk_widget_show(handlebox);
#ifdef MAEMO
main_window_install_maemo_hooks(mainwin);
+#endif
+#ifndef MAEMO
+ if (prefs_common.mainwin_fullscreen) {
+ cm_toggle_menu_set_active_full(mainwin->ui_manager,
+ "Menu/View/FullScreen",
+ TRUE);
+ }
#endif
return mainwin;
}
}
allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation);
-
- if (allocation->width > 1 && allocation->height > 1) {
+
+ if (prefs_common.mainwin_fullscreen) {
+ debug_print("mainwin in full screen state. "
+ "Keeping original settings\n");
+ }
+ if (allocation->width > 1 && allocation->height > 1 && !prefs_common.mainwin_fullscreen) {
prefs_common.summaryview_width = allocation->width;
if (messageview_is_visible(mainwin->messageview))
allocation = &mainwin->window->allocation;
if (allocation->width > 1 && allocation->height > 1 &&
- !prefs_common.mainwin_maximised) {
+ !prefs_common.mainwin_maximised && !prefs_common.mainwin_fullscreen) {
prefs_common.mainview_height = allocation->height;
prefs_common.mainwin_width = allocation->width;
prefs_common.mainwin_height = allocation->height;
}
allocation = &(GTK_WIDGET_PTR(mainwin->folderview)->allocation);
- if (allocation->width > 1 && allocation->height > 1) {
+ if (allocation->width > 1 && allocation->height > 1 &&
+ !prefs_common.mainwin_fullscreen) {
prefs_common.folderview_width = allocation->width;
prefs_common.folderview_height = allocation->height;
}
allocation = &(GTK_WIDGET_PTR(mainwin->messageview)->allocation);
- if (allocation->width > 1 && allocation->height > 1) {
+ if (allocation->width > 1 && allocation->height > 1 &&
+ !prefs_common.mainwin_fullscreen) {
prefs_common.msgview_width = allocation->width;
prefs_common.msgview_height = allocation->height;
}
{
gint x, y;
- if (prefs_common.mainwin_maximised)
+ if (prefs_common.mainwin_maximised || prefs_common.mainwin_fullscreen)
return;
gtkut_widget_get_uposition(mainwin->window, &x, &y);
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
}
+static void toggle_fullscreen_cb(GtkAction *action, gpointer data)
+{
+ MainWindow *mainwin = (MainWindow *)data;
+ if (mainwin->menu_lock_count) return;
+ if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
+ gtk_window_unfullscreen(GTK_WINDOW(mainwin->window));
+ prefs_common.mainwin_fullscreen = FALSE;
+ }
+ else {
+ prefs_common.mainwin_fullscreen = TRUE;
+ gtk_window_fullscreen(GTK_WINDOW(mainwin->window));
+ }
+}
+
static void hide_quotes_cb(GtkAction *action, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;