Commit 803cad28 authored by Jean Felder's avatar Jean Felder Committed by Jean Felder
Browse files

playlistcontrols: Use a controller for rename entry

The "key-press-event" signal has been removed from GTK4. Use a
controller instead.

This needs Gtk+ 3.24.13 or above because the key controllers did not
work properly before this version.
parent 5b34f23c
......@@ -62,7 +62,6 @@
<property name="receives_default">True</property>
<signal name="activate" handler="_on_playlist_renamed" swapped="no"/>
<signal name="changed" handler="_on_rename_entry_changed" swapped="no"/>
<signal name="key-press-event" handler="_on_rename_entry_key_pressed" swapped="no"/>
</object>
</child>
<child>
......@@ -136,4 +135,8 @@
</packing>
</child>
</template>
<object class="GtkEventControllerKey" id="_rename_controller">
<property name="widget">_rename_entry</property>
<signal name="key-pressed" handler="_on_rename_entry_key_pressed" swapped="no"/>
</object>
</interface>
......@@ -38,6 +38,7 @@ class PlaylistControls(Gtk.Grid):
_name_stack = Gtk.Template.Child()
_name_label = Gtk.Template.Child()
_rename_controller = Gtk.Template.Child()
_rename_entry = Gtk.Template.Child()
_rename_done_button = Gtk.Template.Child()
_songs_count_label = Gtk.Template.Child()
......@@ -107,8 +108,7 @@ class PlaylistControls(Gtk.Grid):
self._rename_done_button.props.sensitive = selection_length > 0
@Gtk.Template.Callback()
def _on_rename_entry_key_pressed(self, widget, event):
(_, keyval) = event.get_keyval()
def _on_rename_entry_key_pressed(self, controller, keyval, keycode, state):
if keyval == Gdk.KEY_Escape:
self._disable_rename_playlist()
......
......@@ -43,7 +43,7 @@ PKGLIB_DIR = join_paths(get_option('prefix'), get_option('libdir'), APPLICATION_
# Dependencies
dependency('goa-1.0', version: '>= 3.35.90')
dependency('gobject-introspection-1.0', version: '>= 1.35.0')
dependency('gtk+-3.0', version: '>= 3.24.7')
dependency('gtk+-3.0', version: '>= 3.24.13')
dependency('libdazzle-1.0', version: '>= 3.28.0')
dependency('libmediaart-2.0', version: '>= 1.9.1')
dependency('libsoup-2.4')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment