From 52ec09a7df82397ac1d58b694236d5dad56ef104 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 9 Oct 2022 00:52:36 +0200 Subject: [PATCH] Improved new conversation dialog --- sbapp/main.py | 17 +++++++++-------- sbapp/ui/layouts.py | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index 401552d..cc28d24 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -736,16 +736,16 @@ class SidebandApp(MDApp): text="OK", font_size=dp(20), ) - no_button = MDFlatButton( - text="Cancel", - font_size=dp(20), - ) + + cancel_button = MDRectangleFlatButton(text="Cancel",font_size=sp(18)) + 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 = MDDialog( title="New Conversation", type="custom", content_cls=dialog_content, - buttons=[ yes_button, no_button ], + buttons=[ create_button, cancel_button ], # elevation=0, ) dialog.d_content = dialog_content @@ -763,7 +763,8 @@ class SidebandApp(MDApp): if new_result: dialog.d_content.ids["n_address_field"].error = False dialog.dismiss() - self.open_conversations() + if self.conversations_view != None: + self.conversations_view.update() else: dialog.d_content.ids["n_address_field"].error = True # 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): self.dialog_open = False - yes_button.bind(on_release=dl_yes) - no_button.bind(on_release=dl_no) + create_button.bind(on_release=dl_yes) + cancel_button.bind(on_release=dl_no) dialog.bind(on_dismiss=dl_ds) dialog.open() diff --git a/sbapp/ui/layouts.py b/sbapp/ui/layouts.py index 4edbf20..c057f0d 100644 --- a/sbapp/ui/layouts.py +++ b/sbapp/ui/layouts.py @@ -1268,7 +1268,7 @@ MDNavigationLayout: MDBoxLayout: orientation: "horizontal" size_hint_y: None - padding: [0,0,dp(24),0] + padding: [0,0,dp(8),0] height: dp(48) MDLabel: id: "trusted_switch_label"