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()
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.start_service()
@ -242,7 +242,8 @@ class SidebandApp(MDApp):
self.sideband.should_persist_data()
if self.conversations_view != None:
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
RNS.log("App paused", RNS.LOG_DEBUG)
@ -256,7 +257,8 @@ class SidebandApp(MDApp):
self.app_state = SidebandApp.ACTIVE
if self.conversations_view != None:
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
else:
@ -351,6 +353,10 @@ class SidebandApp(MDApp):
if self.conversations_view != None:
self.conversations_view.update()
if self.sideband.getstate("wants.viewupdate.conversations"):
if self.conversations_view != None:
self.conversations_view.update()
def on_start(self):
self.last_exit_event = time.time()
self.root.ids.screen_manager.transition.duration = 0.25
@ -464,7 +470,7 @@ class SidebandApp(MDApp):
MDApp.get_running_app().stop()
Window.close()
Clock.schedule_once(final_exit, 0.5)
Clock.schedule_once(final_exit, 0.65)
def announce_now_action(self, sender=None):
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.new_conversations", False)
self.app.sideband.setstate("wants.viewupdate.conversations", False)
def update_widget(self):
us = time.time()