From c6df8b851b8eede326846ce12c95c7a8519fe597 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 2 Oct 2022 14:51:01 +0200 Subject: [PATCH] Theme tweaks --- sbapp/ui/helpers.py | 3 ++- sbapp/ui/layouts.py | 8 +++++++- sbapp/ui/messages.py | 14 ++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/sbapp/ui/helpers.py b/sbapp/ui/helpers.py index 8422d7a..8916429 100644 --- a/sbapp/ui/helpers.py +++ b/sbapp/ui/helpers.py @@ -17,7 +17,8 @@ color_delivered = "Indigo" color_propagated = "Blue" color_failed = "Red" color_unknown = "Gray" -intensity_msgs = "600" +intensity_msgs_dark = "600" +intensity_msgs_light = "500" class ContentNavigationDrawer(Screen): pass diff --git a/sbapp/ui/layouts.py b/sbapp/ui/layouts.py index 149aa23..d85a44b 100644 --- a/sbapp/ui/layouts.py +++ b/sbapp/ui/layouts.py @@ -859,11 +859,13 @@ MDNavigationLayout: MDRelativeLayout: size_hint: 1.0, None - # size: root.size + theme_text_color: "ContrastParentBackground" MDIconButton: id: msg_submenu icon: "dots-vertical" + theme_text_color: 'Custom' + text_color: rgba(255,255,255,230) pos: root.width - (self.width + root.padding[0] + dp(4)), root.height - (self.height + root.padding[0] + dp(4)) @@ -872,6 +874,8 @@ MDNavigationLayout: markup: True text: root.heading adaptive_size: True + theme_text_color: 'Custom' + text_color: rgba(255,255,255,230) pos: 0, root.height - (self.height + root.padding[0] + dp(8)) MDLabel: @@ -880,6 +884,8 @@ MDNavigationLayout: # adaptive_size: True size_hint_y: None text_size: self.width, None + theme_text_color: 'Custom' + text_color: rgba(255,255,255,230) height: self.texture_size[1] diff --git a/sbapp/ui/messages.py b/sbapp/ui/messages.py index 2ba57dd..6073566 100644 --- a/sbapp/ui/messages.py +++ b/sbapp/ui/messages.py @@ -16,10 +16,10 @@ from kivymd.uix.dialog import MDDialog if RNS.vendor.platformutils.get_platform() == "android": from ui.helpers import ts_format, mdc - from ui.helpers import color_received, color_delivered, color_propagated, color_failed, color_unknown, intensity_msgs + from ui.helpers import color_received, color_delivered, color_propagated, color_failed, color_unknown, intensity_msgs_dark, intensity_msgs_light else: from .helpers import ts_format, mdc - from .helpers import color_received, color_delivered, color_propagated, color_failed, color_unknown, intensity_msgs + from .helpers import color_received, color_delivered, color_propagated, color_failed, color_unknown, intensity_msgs_dark, intensity_msgs_light class ListLXMessageCard(MDCard, RoundedRectangularElevationBehavior): text = StringProperty() @@ -58,6 +58,11 @@ class Messages(): if len(self.messages) > 0: self.update_widget() + if self.app.sideband.config["dark_ui"]: + intensity_msgs = intensity_msgs_dark + else: + intensity_msgs = intensity_msgs_light + for w in self.widgets: m = w.m if m["state"] == LXMF.LXMessage.SENDING or m["state"] == LXMF.LXMessage.OUTBOUND: @@ -91,6 +96,11 @@ class Messages(): def update_widget(self): + if self.app.sideband.config["dark_ui"]: + intensity_msgs = intensity_msgs_dark + else: + intensity_msgs = intensity_msgs_light + for m in self.messages: if not m["hash"] in self.added_item_hashes: txstr = time.strftime(ts_format, time.localtime(m["sent"]))