[gnome-music] Use accessor for event coordinates
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Use accessor for event coordinates
- Date: Sat, 11 Aug 2018 22:52:12 +0000 (UTC)
commit 67f95514ae37b3c1f22f1cdf3b49ec8298f6cd57
Author: Tyler Garcia <tyler tylergarcia net>
Date: Sat Aug 11 00:42:37 2018 -0700
Use accessor for event coordinates
Fields are deprecated.
Closes: #213
gnomemusic/views/playlistview.py | 7 ++++---
gnomemusic/views/songsview.py | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/views/playlistview.py b/gnomemusic/views/playlistview.py
index 8170bcdb..0836079a 100644
--- a/gnomemusic/views/playlistview.py
+++ b/gnomemusic/views/playlistview.py
@@ -346,12 +346,13 @@ class PlaylistView(BaseView):
if not event.triggers_context_menu():
return
- path, col, cell_x, cell_y = treeview.get_path_at_pos(event.x, event.y)
+ (coord_x, coord_y) = event.get_coords()
+ path, col, cell_x, cell_y = treeview.get_path_at_pos(coord_x, coord_y)
self._view.get_selection().select_path(path)
rect = self._view.get_visible_rect()
- rect.x = event.x - rect.width / 2.0
- rect.y = event.y - rect.height + 5
+ rect.x = coord_x - rect.width / 2.0
+ rect.y = coord_y - rect.height + 5
self._song_popover.set_relative_to(self._view)
self._song_popover.set_pointing_to(rect)
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index a207f486..2292ff2e 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -221,7 +221,7 @@ class SongsView(BaseView):
if (self.selection_mode
and not self._star_handler.star_renderer_click):
path, col, cell_x, cell_y = treeview.get_path_at_pos(
- event.x, event.y)
+ *event.get_coords())
iter_ = self.model.get_iter(path)
self.model[iter_][6] = not self.model[iter_][6]
self._update_header_from_selection(len(self.get_selected_songs()))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]