From c4f863d8ca58820c08fe6f465c76cb8ae4535787 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 3 Oct 2022 01:36:21 +0200 Subject: [PATCH] Updated message colors --- sbapp/ui/layouts.py | 14 +++++++------- sbapp/ui/messages.py | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/sbapp/ui/layouts.py b/sbapp/ui/layouts.py index 90a050e..38fe53d 100644 --- a/sbapp/ui/layouts.py +++ b/sbapp/ui/layouts.py @@ -988,7 +988,7 @@ MDNavigationLayout: on_release: root.ids.screen_manager.app.quit_action(self) : - style: "elevated" + style: "filled" elevation: 2 padding: dp(8) radius: [dp(4), dp(4), dp(4), dp(4)] @@ -1003,8 +1003,8 @@ MDNavigationLayout: MDIconButton: id: msg_submenu icon: "dots-vertical" - theme_text_color: 'Custom' - text_color: rgba(255,255,255,230) + # theme_text_color: 'Custom' + # text_color: rgba(255,255,255,216) pos: root.width - (self.width + root.padding[0] + dp(4)), root.height - (self.height + root.padding[0] + dp(4)) @@ -1013,8 +1013,8 @@ MDNavigationLayout: markup: True text: root.heading adaptive_size: True - theme_text_color: 'Custom' - text_color: rgba(255,255,255,230) + # theme_text_color: 'Custom' + # text_color: rgba(255,255,255,100) pos: 0, root.height - (self.height + root.padding[0] + dp(8)) MDLabel: @@ -1023,8 +1023,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) + # theme_text_color: 'Custom' + # text_color: rgba(255,255,255,216) height: self.texture_size[1] diff --git a/sbapp/ui/messages.py b/sbapp/ui/messages.py index 732d150..c378e76 100644 --- a/sbapp/ui/messages.py +++ b/sbapp/ui/messages.py @@ -6,7 +6,8 @@ from kivy.metrics import dp from kivy.core.clipboard import Clipboard from kivymd.uix.card import MDCard from kivymd.uix.menu import MDDropdownMenu -from kivymd.uix.behaviors import CommonElevationBehavior +from kivymd.uix.behaviors import RoundedRectangularElevationBehavior, FakeRectangularElevationBehavior +# from kivymd.uix.behaviors import CommonElevationBehavior from kivy.properties import StringProperty, BooleanProperty from kivy.uix.gridlayout import GridLayout from kivy.uix.boxlayout import BoxLayout @@ -21,7 +22,8 @@ else: from .helpers import ts_format, mdc from .helpers import color_received, color_delivered, color_propagated, color_failed, color_unknown, intensity_msgs_dark, intensity_msgs_light -class ListLXMessageCard(MDCard, CommonElevationBehavior): +# class ListLXMessageCard(MDCard, CommonElevationBehavior): +class ListLXMessageCard(MDCard, FakeRectangularElevationBehavior): text = StringProperty() heading = StringProperty() @@ -98,8 +100,10 @@ class Messages(): def update_widget(self): if self.app.sideband.config["dark_ui"]: intensity_msgs = intensity_msgs_dark + mt_color = [1.0, 1.0, 1.0, 0.8] else: intensity_msgs = intensity_msgs_light + mt_color = [1.0, 1.0, 1.0, 0.95] for m in self.messages: if not m["hash"] in self.added_item_hashes: @@ -142,6 +146,12 @@ class Messages(): ) item.sb_uid = m["hash"] item.m = m + item.ids.heading_text.theme_text_color = "Custom" + item.ids.heading_text.text_color = mt_color + item.ids.content_text.theme_text_color = "Custom" + item.ids.content_text.text_color = mt_color + item.ids.msg_submenu.theme_text_color = "Custom" + item.ids.msg_submenu.text_color = mt_color def gen_del(mhash, item): def x():