[totem] main: Make F10 show the cogwheel menu



commit dedebc23c9b876352c30573a12f92384b5782e23
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 6 14:11:35 2014 +0100

    main: Make F10 show the cogwheel menu
    
    With the caveat that the menu isn't correctly positioned when the
    popups are hidden in fullscreen mode.

 src/totem-object.c  |   23 ++++++++++++++---------
 src/totem-private.h |    1 +
 2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index c93cb86..10f79d1 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3312,16 +3312,20 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
                        totem_object_set_zoom (totem, FALSE);
                break;
        case GDK_KEY_Menu:
-       case GDK_KEY_Time:
-               /* FIXME find replacement
-               totem_object_menu_popup (totem, 0); */
-               break;
        case GDK_KEY_F10:
-               if (!(event->state & GDK_SHIFT_MASK))
-                       return FALSE;
-
-               /* FIXME find replacement
-               totem_object_menu_popup (totem, 0); */
+               bacon_video_widget_show_popup (totem->bvw);
+               if (totem->controls_visibility != TOTEM_CONTROLS_FULLSCREEN) {
+                       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (totem->gear_button),
+                                                     !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(totem->gear_button)));
+               } else {
+                       /* FIXME
+                        * The menu won't be correctly positioned */
+                       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (totem->fullscreen_gear_button),
+                                                     !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(totem->fullscreen_gear_button)));
+               }
+               break;
+       case GDK_KEY_Time:
+               bacon_video_widget_show_popup (totem->bvw);
                break;
        case GDK_KEY_equal:
                if (event->state & GDK_CONTROL_MASK)
@@ -3852,6 +3856,7 @@ add_fullscreen_toolbar (TotemObject *totem)
        gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (item), menu);
        g_signal_connect (G_OBJECT (item), "toggled",
                          G_CALLBACK (fullscreen_menu_shown_cb), totem);
+       totem->fullscreen_gear_button = item;
 
        item = create_header_button (totem->fullscreen_header, gtk_button_new (), "view-fullscreen-symbolic");
        gtk_actionable_set_action_name (GTK_ACTIONABLE (item), "app.fullscreen");
diff --git a/src/totem-private.h b/src/totem-private.h
index 3cfe29c..a2f0b9c 100644
--- a/src/totem-private.h
+++ b/src/totem-private.h
@@ -94,6 +94,7 @@ struct _TotemObject {
 
        GtkWidget *revealer;
        GtkWidget *fullscreen_header;
+       GtkWidget *fullscreen_gear_button;
 
        /* UI manager */
        GtkActionGroup *main_action_group;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]