Make the torrent list items selectable which also enables kb navigation

This commit is contained in:
Kai Huuhko 2014-09-05 07:16:07 +03:00
parent 3c9170cc67
commit 8dae070215
1 changed files with 8 additions and 4 deletions

View File

@ -32,7 +32,8 @@ from efl import elementary as elm
elm.init()
from efl.elementary.genlist import Genlist, GenlistItemClass, \
ELM_GENLIST_ITEM_FIELD_TEXT, ELM_GENLIST_ITEM_FIELD_CONTENT, \
ELM_OBJECT_SELECT_MODE_NONE, ELM_LIST_COMPRESS
ELM_OBJECT_SELECT_MODE_NONE, ELM_OBJECT_SELECT_MODE_DEFAULT, \
ELM_LIST_COMPRESS
from efl.elementary.window import StandardWindow
from efl.elementary.icon import Icon
from efl.elementary.box import Box
@ -140,14 +141,15 @@ class MainInterface(object):
# --- TORRENT LIST ---
self.tlist = tlist = Genlist(
mbox, select_mode=ELM_OBJECT_SELECT_MODE_NONE,
mbox, select_mode=ELM_OBJECT_SELECT_MODE_DEFAULT,
mode=ELM_LIST_COMPRESS, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH, homogeneous=True
)
def item_activated_cb(gl, item):
h = item.data
ItemMenu(self.win, item, self.session, h)
itm = ItemMenu(tlist, item, self.session, h)
itm.focus = True
tlist.callback_activated_add(item_activated_cb)
tlist.show()
@ -582,7 +584,9 @@ class ItemMenu(Menu):
files_cb, h
)
self.move(*parent.evas.pointer_canvas_xy_get())
self.move(*item.track_object.pos)
del item.track_object
self.show()
def remove_torrent_cb(