Fix PTT button hiding

This commit is contained in:
Mark Qvist 2024-09-07 09:44:07 +02:00
parent bdf968084e
commit ff58028ca7
3 changed files with 7 additions and 8 deletions

View File

@ -2138,6 +2138,7 @@ class SidebandApp(MDApp):
keys_str = "The crytographic keys for the destination address are unknown at this time. You can wait for an announce to arrive, or query the network for the necessary keys." keys_str = "The crytographic keys for the destination address are unknown at this time. You can wait for an announce to arrive, or query the network for the necessary keys."
self.messages_view.ids.nokeys_text.text = keys_str self.messages_view.ids.nokeys_text.text = keys_str
self.widget_hide(self.messages_view.ids.message_input_part, True) self.widget_hide(self.messages_view.ids.message_input_part, True)
self.widget_hide(self.messages_view.ids.message_ptt, True)
self.widget_hide(self.messages_view.ids.no_keys_part, False) self.widget_hide(self.messages_view.ids.no_keys_part, False)

View File

@ -119,6 +119,11 @@ class Messages():
layout.bind(minimum_height=layout.setter('height')) layout.bind(minimum_height=layout.setter('height'))
self.list = layout self.list = layout
if self.ptt_enabled:
self.hide_widget(self.ids.message_ptt, False)
else:
self.hide_widget(self.ids.message_ptt, True)
c_ts = time.time() c_ts = time.time()
if len(self.new_messages) > 0: if len(self.new_messages) > 0:
self.update_widget() self.update_widget()
@ -238,13 +243,6 @@ class Messages():
self.ids.message_text.font_name = self.app.input_font self.ids.message_text.font_name = self.app.input_font
if self.ptt_enabled:
RNS.log("PTT display") # TODO: Remove and fix this
self.hide_widget(self.ids.message_ptt, False)
else:
RNS.log("PTT hide") # TODO: Remove and fix this
self.hide_widget(self.ids.message_ptt, True)
if self.loading_earlier_messages: if self.loading_earlier_messages:
self.new_messages.reverse() self.new_messages.reverse()