~martijnbraam/keyring

66bf555f8360e858243044ad7288d9770ba5326b — Martijn Braam a month ago 88f8f4f
Implement longpress for copying keys
1 files changed, 11 insertions(+), 1 deletions(-)

M himitsu_gtk/window.py
M himitsu_gtk/window.py => himitsu_gtk/window.py +11 -1
@@ 184,8 184,15 @@ class KeyringWindow:
            row.set_margin_start(8)
            row.set_margin_end(8)
            lbr = Gtk.ListBoxRow()
            lbr.add(row)
            eb = Gtk.EventBox()
            eb.add(row)
            lbr.add(eb)
            lbr.pair = pair

            lbr.longpress = Gtk.GestureLongPress.new(eb)
            lbr.longpress.connect("pressed", self.on_key_row_longpress)
            lbr.longpress.row = lbr

            self.keyinfo.insert(lbr, -1)

            name = Gtk.Label(pair.key, xalign=0.0)


@@ 239,6 246,9 @@ class KeyringWindow:
            self.mainstack.set_visible_child_name('nokey')
        dialog.destroy()

    def on_key_row_longpress(self, widget, x, y):
        self.on_key_row_activate(widget, widget.row)

    def on_key_row_activate(self, widget, row):
        pair = row.pair
        if pair.value is not None: