From 3bf142d21a57f64f5e5f2eb7c9c84a3be9c6bcdc Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 1 Jun 2024 15:07:38 +0200 Subject: [PATCH] Expanded emoji rendering to alternate input scripts --- sbapp/main.py | 22 +++++++++++++++------- sbapp/ui/conversations.py | 5 +---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index 0ce8b5f..e49777c 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -388,7 +388,7 @@ class SidebandApp(MDApp): LabelBase.register(name="emoji", fn_regular=fb_path+"NotoEmoji-Regular.ttf") - LabelBase.register(name="default_input", + LabelBase.register(name="defaultinput", fn_regular=fb_path+"DefaultInput.ttf") LabelBase.register(name="combined", @@ -400,12 +400,20 @@ class SidebandApp(MDApp): def update_input_language(self): language = self.sideband.config["input_language"] if language == None: - self.input_font = "default_input" - RNS.log("Setting input language to default set", RNS.LOG_DEBUG) + self.input_font = "defaultinput" else: self.input_font = language - RNS.log("Setting input language to "+str(language), RNS.LOG_DEBUG) + + RNS.log("Setting input language to "+str(self.input_font), RNS.LOG_DEBUG) + # def modify_input_font(self, ids): + # BIND_CLASSES = ["kivymd.uix.textfield.textfield.MDTextField",] + # for e in ids: + # te = ids[e] + # ts = str(te).split(" ")[0].replace("<", "") + # if ts in BIND_CLASSES: + # RNS.log("MODIFYING "+str(e)+" to "+self.input_font) + # te.font_name = self.input_font def update_ui_colors(self): if self.sideband.config["dark_ui"]: @@ -2056,7 +2064,7 @@ class SidebandApp(MDApp): if self.settings_screen.ids.settings_lang_default.active: self.sideband.config["input_language"] = None - self.settings_screen.ids.settings_display_name.font_name = "" + self.settings_screen.ids.settings_display_name.font_name = "defaultinput" elif self.settings_screen.ids.settings_lang_chinese.active: self.sideband.config["input_language"] = "chinese" self.settings_screen.ids.settings_display_name.font_name = "chinese" @@ -2074,7 +2082,7 @@ class SidebandApp(MDApp): self.settings_screen.ids.settings_display_name.font_name = "hebrew" else: self.sideband.config["input_language"] = None - self.settings_screen.ids.settings_display_name.font_name = "" + self.settings_screen.ids.settings_display_name.font_name = "defaultinput" self.sideband.save_configuration() @@ -2283,7 +2291,7 @@ class SidebandApp(MDApp): elif input_lang == "korean": self.settings_screen.ids.settings_lang_korean.active = True self.settings_screen.ids.settings_display_name.font_name = "korean" - elif input_lang == "devangari": + elif input_lang == "combined": self.settings_screen.ids.settings_lang_devangari.active = True self.settings_screen.ids.settings_display_name.font_name = "combined" elif input_lang == "hebrew": diff --git a/sbapp/ui/conversations.py b/sbapp/ui/conversations.py index 57eae2e..9c74df9 100644 --- a/sbapp/ui/conversations.py +++ b/sbapp/ui/conversations.py @@ -220,10 +220,7 @@ class Conversations(): no_button = MDRectangleFlatButton(text="Cancel",font_size=dp(18)) dialog_content = ConvSettings(disp_name=disp_name, context_dest=RNS.hexrep(dest, delimit=False), trusted=is_trusted, telemetry=send_telemetry, allow_requests=allow_requests, is_object=is_object) - if self.app.sideband.config["input_language"] != None: - dialog_content.ids.name_field.font_name = self.app.sideband.config["input_language"] - else: - dialog_content.ids.name_field.font_name = "" + dialog_content.ids.name_field.font_name = self.app.input_font dialog = MDDialog( title="Edit Conversation",