[gnome-games] display-header-bar: prohibit focus for back/fullscreen buttons



commit 3ddede49114e678e69d6ac3282a8a2197a4f24a1
Author: Will Burklund <waburklund gmail com>
Date:   Sun May 5 14:23:30 2019 -0500

    display-header-bar: prohibit focus for back/fullscreen buttons
    
    Set 'can_focus' to false for back and fullscreen buttons in DisplayHeaderBar UI
    file. Disable programmatic setting of 'can_focus'. Remove unused field '_back'.
    
    Pressing enter twice after opening a game from file no longer exits the game.
    
    #161

 data/ui/display-header-bar.ui  | 3 +++
 src/ui/display-header-bar.vala | 6 ------
 2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/display-header-bar.ui b/data/ui/display-header-bar.ui
index 0384a93e..8a2a8094 100644
--- a/data/ui/display-header-bar.ui
+++ b/data/ui/display-header-bar.ui
@@ -10,6 +10,7 @@
     <child>
       <object class="GtkButton" id="back">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="valign">center</property>
         <property name="use-underline">True</property>
         <signal name="clicked" handler="on_back_clicked"/>
@@ -33,6 +34,7 @@
     <child>
       <object class="GtkButton" id="fullscreen">
         <property name="visible">False</property>
+        <property name="can_focus">False</property>
         <property name="valign">center</property>
         <property name="use-underline">True</property>
         <signal name="clicked" handler="on_fullscreen_clicked"/>
@@ -59,6 +61,7 @@
     <child>
       <object class="GtkButton" id="restore">
         <property name="visible">False</property>
+        <property name="can_focus">False</property>
         <property name="valign">center</property>
         <property name="use-underline">True</property>
         <signal name="clicked" handler="on_restore_clicked"/>
diff --git a/src/ui/display-header-bar.vala b/src/ui/display-header-bar.vala
index 79c3ffcb..6d692157 100644
--- a/src/ui/display-header-bar.vala
+++ b/src/ui/display-header-bar.vala
@@ -56,9 +56,6 @@ private class Games.DisplayHeaderBar : Gtk.HeaderBar {
                }
        }
 
-       [GtkChild (name = "back")]
-       private Gtk.Button _back;
-
        [GtkChild]
        private Gtk.Button fullscreen;
 
@@ -79,9 +76,6 @@ private class Games.DisplayHeaderBar : Gtk.HeaderBar {
        private void on_fullscreen_changed () {
                fullscreen.visible = can_fullscreen && !is_fullscreen;
                restore.visible = can_fullscreen && is_fullscreen;
-
-               _back.can_focus = !is_fullscreen;
-               restore.can_focus = !is_fullscreen;
        }
 
        [GtkCallback]


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