From 8bd812834c48aaaf29041835a74457cf37cfd316 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 13 Jul 2020 17:06:55 +0800 Subject: [PATCH] bugfix --- kivyblocks/boxViewer.py | 2 +- kivyblocks/swipebehavior.py | 31 ++++++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/kivyblocks/boxViewer.py b/kivyblocks/boxViewer.py index 807d350..f07434b 100644 --- a/kivyblocks/boxViewer.py +++ b/kivyblocks/boxViewer.py @@ -38,7 +38,7 @@ class BoxViewer(BoxLayout): 'viewer', 'boxwidth', 'boxheight'] - kwargs = {k:v for k,v in options if k not in remind } + kwargs = {k:v for k,v in options.items() if k not in remind } BoxLayout.__init__(self, orientation='vertical', **kwargs) self.selected_data = None self.options = options diff --git a/kivyblocks/swipebehavior.py b/kivyblocks/swipebehavior.py index 82b9d7a..6894865 100644 --- a/kivyblocks/swipebehavior.py +++ b/kivyblocks/swipebehavior.py @@ -27,36 +27,41 @@ class SwipeBehavior(object): self.swipeenable = True def on_context_menu(self): - Logger.info('SwipeBehavior:on_context_menu fired') + pass + # Logger.info('SwipeBehavior:on_context_menu fired') def on_swipe_left(self): - Logger.info('SwipeBehavior:on_swipe_left fired') + pass + # Logger.info('SwipeBehavior:on_swipe_left fired') def on_swipe_right(self): - Logger.info('SwipeBehavior:on_swipe_right fired') + pass + # Logger.info('SwipeBehavior:on_swipe_right fired') def on_swipe_up(self): - Logger.info('SwipeBehavior:on_swipe_up fired') + pass + # Logger.info('SwipeBehavior:on_swipe_up fired') def on_swipe_down(self): - Logger.info('SwipeBehavior:on_swipe_down fired') + pass + # Logger.info('SwipeBehavior:on_swipe_down fired') def on_touchdown(self,o, touch): if touch.is_mouse_scrolling: - Logger.info('SwipeBehavior:is_mouse_scrolling') + # Logger.info('SwipeBehavior:is_mouse_scrolling') return False if not self.collide_point(touch.x, touch.y): return False - Logger.info('SwipeBehavior:touch_down fired') + # Logger.info('SwipeBehavior:touch_down fired') if self.swipeenable: - Logger.info('SwipeBehavior:touch_down fired') + # Logger.info('SwipeBehavior:touch_down fired') self.sb_start_point = touch.pos self.sb_start_time = time.time() def on_touchmove(self,o,touch): if self.collide_point(*touch.pos) and self.swipeenable: - Logger.info('SwipeBehavior:touch_move fired') + # Logger.info('SwipeBehavior:touch_move fired') if self.sb_start_point is None: self.sb_start_point = touch.pos else: @@ -64,7 +69,7 @@ class SwipeBehavior(object): def on_touchup(self,o,touch): if self.collide_point(*touch.pos) and self.swipeenable: - Logger.info('SwipeBehavior:touch_up fired') + # Logger.info('SwipeBehavior:touch_up fired') self.sb_end_point = touch.pos self.sb_end_time = time.time() self.check_context_menu() @@ -80,8 +85,8 @@ class SwipeBehavior(object): if not self.sb_end_time: return period_time = self.sb_end_time - self.sb_start_time - Logger.info('SwipeBehavior:period_time=%f,threshold_time=%f', - period_time, self.threshold_time) + # Logger.info('SwipeBehavior:period_time=%f,threshold_time=%f', + # period_time, self.threshold_time) if period_time >= self.threshold_time: self.dispatch('on_context_menu') @@ -102,7 +107,7 @@ class SwipeBehavior(object): self.threshold: self.dispatch('on_swipe_left') else: - Logger.info('SwipeBehavior:check_swipe x= \ self.threshold: self.dispatch('on_swipe_up')