Add Dict widget to tree view

It is needed to be able to search on dict.

issue8296
review271331012
This commit is contained in:
Cédric Krier committed 2019-06-04 18:20:23 +02:00
1 parent 6399977a19
commit e1aef8b79d
3 files changed
+18 -1

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Add Dict widget for tree view
* Add handle to reordable line of tree views
Version 5.2.0 - 2019-05-06
+2 -1
View File
@@ -21,7 +21,7 @@ from . import View, XMLViewParser
from .list_gtk.editabletree import EditableTreeView, TreeView
from .list_gtk.widget import (Affix, Char, Text, Int, Boolean, URL, Date,
Time, Float, TimeDelta, Binary, M2O, O2O, O2M, M2M, Selection, Reference,
ProgressBar, Button, Image)
Dict, ProgressBar, Button, Image)
_ = gettext.gettext
@@ -258,6 +258,7 @@ class TreeXMLViewParser(XMLViewParser):
'callto': URL,
'char': Char,
'date': Date,
'dict': Dict,
'email': URL,
'float': Float,
'image': Image,
@@ -1053,6 +1053,21 @@ class _ReferenceSelection(Selection):
return False
class Dict(GenericText):
align = 0.5
def __init__(self, view, attrs):
super().__init__(view, attrs)
self.renderer.props.editable = False
def setter(self, column, cell, store, iter_, user_data=None):
super().setter(column, cell, store, iter_, user_data=None)
cell.props.editable = False
def get_textual_value(self, record):
return '(%s)' % len(record[self.attrs['name']].get_client(record))
class ProgressBar(Cell):
align = 0.5
orientations = {