diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-04 14:19:49 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-04 14:19:49 +0100 |
commit | 662842453a00d446c420b04ae5fa5e8735fa09c2 (patch) | |
tree | 55d47b0787a0b2c35526aa4edec9c5e7d19cdee9 /tagit/widgets | |
parent | ceb95600c5d3cff789d466706bcdec7143c11bb3 (diff) | |
download | tagit-662842453a00d446c420b04ae5fa5e8735fa09c2.tar.gz tagit-662842453a00d446c420b04ae5fa5e8735fa09c2.tar.bz2 tagit-662842453a00d446c420b04ae5fa5e8735fa09c2.zip |
style fixes
Diffstat (limited to 'tagit/widgets')
-rw-r--r-- | tagit/widgets/filter.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tagit/widgets/filter.py b/tagit/widgets/filter.py index 76394e3..1382c43 100644 --- a/tagit/widgets/filter.py +++ b/tagit/widgets/filter.py @@ -120,6 +120,7 @@ class Filter(BoxLayout, ConfigAwareMixin): return query, sort def abbreviate(self, token): + # FIXME: Return image matches = matcher.Filter() if matches(token, ast.filter.Any(ns.bse.tag, ast.filter.Any(ns.bst.label, matcher.Any()))): # tag token @@ -127,17 +128,18 @@ class Filter(BoxLayout, ConfigAwareMixin): if matches(token, matcher.Partial(ast.filter.Is)) or \ matches(token, ast.filter.Or(matcher.Rest(matcher.Partial(ast.filter.Is)))): # exclusive token - return 'E' + return '=' if matches(token, ast.filter.Not(matcher.Partial(ast.filter.Is))) or \ matches(token, ast.filter.Not(ast.filter.Or(matcher.Rest(matcher.Partial(ast.filter.Is))))): # reduce token - return 'R' + return '—' if matches(token, ast.filter.Any(ns.bse.group, matcher.Any())): # group token return 'G' if matches(token, ast.filter.Any(matcher.Partial(ast.filter.Predicate), matcher.Any())): # generic token - return token.predicate.predicate.get('fragment', '?').title() + #return token.predicate.predicate.get('fragment', '?').title()[0] + return 'P' return '?' def tok_label(self, token): @@ -152,6 +154,10 @@ class Filter(BoxLayout, ConfigAwareMixin): return str(len(token)) if matches(token, ast.filter.Not(ast.filter.Or(matcher.Rest(matcher.Partial(ast.filter.Is))))): return str(len(token.expr)) + if matches(token, ast.filter.Any(matcher.Partial(ast.filter.Predicate), matcher.Any())): + # generic token + #return self.root.session.filter_to_string(token) + return token.predicate.predicate.get('fragment', '') return '' def show_address_once(self): @@ -265,7 +271,7 @@ class Shingle(BoxLayout): def on_touch_down(self, touch): """Edit shingle when touched.""" - if self.label.collide_point(*touch.pos): + if self.collide_point(*touch.pos): if touch.is_double_tap: # edit filter # ignore touch, such that the dialogue # doesn't loose the focus immediately after open |