Tuned UI behaviour

This commit is contained in:
Mark Qvist 2022-10-12 16:33:05 +02:00
parent ed096cf711
commit d2c26a306e
2 changed files with 11 additions and 4 deletions

View File

@ -122,7 +122,7 @@ class SidebandApp(MDApp):
self.loading_updater.cancel() self.loading_updater.cancel()
def start_core(self, dt): def start_core(self, dt):
self.loading_updater = Clock.schedule_interval(self.update_init_status, 0.3) self.loading_updater = Clock.schedule_interval(self.update_init_status, 0.1)
self.check_permissions() self.check_permissions()
self.start_service() self.start_service()
@ -242,7 +242,8 @@ class SidebandApp(MDApp):
self.sideband.should_persist_data() self.sideband.should_persist_data()
if self.conversations_view != None: if self.conversations_view != None:
self.root.ids.conversations_scrollview.effect_cls = ScrollEffect self.root.ids.conversations_scrollview.effect_cls = ScrollEffect
self.conversations_view.update() # TODO: Check if we actually need this
self.sideband.setstate("wants.viewupdate.conversations", True)
self.root.ids.conversations_scrollview.scroll = 1 self.root.ids.conversations_scrollview.scroll = 1
RNS.log("App paused", RNS.LOG_DEBUG) RNS.log("App paused", RNS.LOG_DEBUG)
@ -256,7 +257,8 @@ class SidebandApp(MDApp):
self.app_state = SidebandApp.ACTIVE self.app_state = SidebandApp.ACTIVE
if self.conversations_view != None: if self.conversations_view != None:
self.root.ids.conversations_scrollview.effect_cls = ScrollEffect self.root.ids.conversations_scrollview.effect_cls = ScrollEffect
self.conversations_view.update() # TODO: Check if we actually need this
# self.sideband.setstate("wants.viewupdate.conversations", True)
self.root.ids.conversations_scrollview.scroll = 1 self.root.ids.conversations_scrollview.scroll = 1
else: else:
@ -351,6 +353,10 @@ class SidebandApp(MDApp):
if self.conversations_view != None: if self.conversations_view != None:
self.conversations_view.update() self.conversations_view.update()
if self.sideband.getstate("wants.viewupdate.conversations"):
if self.conversations_view != None:
self.conversations_view.update()
def on_start(self): def on_start(self):
self.last_exit_event = time.time() self.last_exit_event = time.time()
self.root.ids.screen_manager.transition.duration = 0.25 self.root.ids.screen_manager.transition.duration = 0.25
@ -464,7 +470,7 @@ class SidebandApp(MDApp):
MDApp.get_running_app().stop() MDApp.get_running_app().stop()
Window.close() Window.close()
Clock.schedule_once(final_exit, 0.5) Clock.schedule_once(final_exit, 0.65)
def announce_now_action(self, sender=None): def announce_now_action(self, sender=None):
self.sideband.lxmf_announce() self.sideband.lxmf_announce()

View File

@ -58,6 +58,7 @@ class Conversations():
self.app.sideband.setstate("app.flags.unread_conversations", False) self.app.sideband.setstate("app.flags.unread_conversations", False)
self.app.sideband.setstate("app.flags.new_conversations", False) self.app.sideband.setstate("app.flags.new_conversations", False)
self.app.sideband.setstate("wants.viewupdate.conversations", False)
def update_widget(self): def update_widget(self):
us = time.time() us = time.time()