Improved new conversation dialog

This commit is contained in:
Mark Qvist 2022-10-09 00:52:36 +02:00
parent d2450ebb85
commit 52ec09a7df
2 changed files with 10 additions and 9 deletions

View File

@ -736,16 +736,16 @@ class SidebandApp(MDApp):
text="OK", text="OK",
font_size=dp(20), font_size=dp(20),
) )
no_button = MDFlatButton(
text="Cancel", cancel_button = MDRectangleFlatButton(text="Cancel",font_size=sp(18))
font_size=dp(20), create_button = MDRectangleFlatButton(text="Create",font_size=sp(18), theme_text_color="Custom", line_color=self.color_accept, text_color=self.color_accept)
)
dialog_content = NewConv() dialog_content = NewConv()
dialog = MDDialog( dialog = MDDialog(
title="New Conversation", title="New Conversation",
type="custom", type="custom",
content_cls=dialog_content, content_cls=dialog_content,
buttons=[ yes_button, no_button ], buttons=[ create_button, cancel_button ],
# elevation=0, # elevation=0,
) )
dialog.d_content = dialog_content dialog.d_content = dialog_content
@ -763,7 +763,8 @@ class SidebandApp(MDApp):
if new_result: if new_result:
dialog.d_content.ids["n_address_field"].error = False dialog.d_content.ids["n_address_field"].error = False
dialog.dismiss() dialog.dismiss()
self.open_conversations() if self.conversations_view != None:
self.conversations_view.update()
else: else:
dialog.d_content.ids["n_address_field"].error = True dialog.d_content.ids["n_address_field"].error = True
# dialog.d_content.ids["n_error_field"].text = "Could not create conversation. Check your input." # dialog.d_content.ids["n_error_field"].text = "Could not create conversation. Check your input."
@ -774,8 +775,8 @@ class SidebandApp(MDApp):
def dl_ds(s): def dl_ds(s):
self.dialog_open = False self.dialog_open = False
yes_button.bind(on_release=dl_yes) create_button.bind(on_release=dl_yes)
no_button.bind(on_release=dl_no) cancel_button.bind(on_release=dl_no)
dialog.bind(on_dismiss=dl_ds) dialog.bind(on_dismiss=dl_ds)
dialog.open() dialog.open()

View File

@ -1268,7 +1268,7 @@ MDNavigationLayout:
MDBoxLayout: MDBoxLayout:
orientation: "horizontal" orientation: "horizontal"
size_hint_y: None size_hint_y: None
padding: [0,0,dp(24),0] padding: [0,0,dp(8),0]
height: dp(48) height: dp(48)
MDLabel: MDLabel:
id: "trusted_switch_label" id: "trusted_switch_label"