aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tagit/assets/themes/default/style.kv12
-rw-r--r--tagit/widgets/filter.py14
2 files changed, 16 insertions, 10 deletions
diff --git a/tagit/assets/themes/default/style.kv b/tagit/assets/themes/default/style.kv
index 5747fbd..71b4cb7 100644
--- a/tagit/assets/themes/default/style.kv
+++ b/tagit/assets/themes/default/style.kv
@@ -72,12 +72,12 @@
self.x, self.y + self.height - 40, \
self.x, self.y + self.height, \
self.x + 40, self.y + self.height
- Line:
- width: 2
- points:
- self.x + self.width - 40, \
- self.y, self.x + self.width, \
- self.y, self.x + self.width, self.y + 40
+ #Line:
+ # width: 2
+ # points:
+ # self.x + self.width - 40, \
+ # self.y, self.x + self.width, \
+ # self.y, self.x + self.width, self.y + 40
# cursor highlighting
Color:
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