[gnome-games/wip/exalm/views: 12/17] collection-view: Handle gamepad events
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/views: 12/17] collection-view: Handle gamepad events
- Date: Mon, 8 Oct 2018 12:13:51 +0000 (UTC)
commit 2fd68f6a896d49fac63380812ef21f3a4c6deecc
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu Oct 4 21:40:02 2018 +0500
collection-view: Handle gamepad events
Make ApplicationWindow interact with CollectionView instead of its
internals.
src/ui/application-window.vala | 6 +++---
src/ui/collection-view.vala | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 0754a097..fc6d8902 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -235,7 +235,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
public bool gamepad_button_press_event (Manette.Event event) {
if (current_view == collection_view)
- return is_active && collection_view.box.gamepad_button_press_event (event);
+ return collection_view.gamepad_button_press_event (event);
else if (current_view == display_view) {
if (resume_dialog != null)
return resume_dialog.is_active && resume_dialog.gamepad_button_press_event
(event);
@@ -268,14 +268,14 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
public bool gamepad_button_release_event (Manette.Event event) {
if (current_view == collection_view)
- return is_active && collection_view.box.gamepad_button_release_event (event);
+ return collection_view.gamepad_button_release_event (event);
return false;
}
public bool gamepad_absolute_axis_event (Manette.Event event) {
if (current_view == collection_view)
- return is_active && collection_view.box.gamepad_absolute_axis_event (event);
+ return collection_view.gamepad_absolute_axis_event (event);
return false;
}
diff --git a/src/ui/collection-view.vala b/src/ui/collection-view.vala
index 243827dc..090a4a49 100644
--- a/src/ui/collection-view.vala
+++ b/src/ui/collection-view.vala
@@ -99,15 +99,15 @@ private class Games.CollectionView: Gtk.Bin, ApplicationView {
}
public bool gamepad_button_press_event (Manette.Event event) {
- return false;
+ return window.is_active && box.gamepad_button_press_event (event);
}
public bool gamepad_button_release_event (Manette.Event event) {
- return false;
+ return window.is_active && box.gamepad_button_release_event (event);
}
public bool gamepad_absolute_axis_event (Manette.Event event) {
- return false;
+ return window.is_active && box.gamepad_absolute_axis_event (event);
}
[GtkCallback]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]