User interface improvements

This commit is contained in:
Mark Qvist 2022-10-02 17:17:55 +02:00
parent abcf173cc8
commit 4461b706e9
4 changed files with 42 additions and 50 deletions

View File

@ -4,7 +4,7 @@ package.name = sideband
package.domain = io.unsigned package.domain = io.unsigned
source.dir = . source.dir = .
source.include_exts = py,png,jpg,jpeg,ttf,kv,pyi,typed,so,0,1,2,3,atlas source.include_exts = py,png,jpg,jpeg,ttf,kv,pyi,typed,so,0,1,2,3,atlas,frag
source.include_patterns = assets/* source.include_patterns = assets/*
source.exclude_patterns = app_storage/*,venv/*,Makefile,./Makefil*,requirements,precompiled/*,parked/*,./setup.py,Makef*,./Makefile,Makefile source.exclude_patterns = app_storage/*,venv/*,Makefile,./Makefil*,requirements,precompiled/*,parked/*,./setup.py,Makef*,./Makefile,Makefile

View File

@ -139,6 +139,8 @@ class SidebandApp(MDApp):
################################################# #################################################
def update_ui_theme(self): def update_ui_theme(self):
self.theme_cls.material_style = "M3"
self.theme_cls.widget_style = "android"
if self.sideband.config["dark_ui"]: if self.sideband.config["dark_ui"]:
self.theme_cls.theme_style = "Dark" self.theme_cls.theme_style = "Dark"
else: else:

View File

@ -3,7 +3,6 @@ root_layout = """
#: import SlideTransition kivy.uix.screenmanager.SlideTransition #: import SlideTransition kivy.uix.screenmanager.SlideTransition
MDNavigationLayout: MDNavigationLayout:
ScreenManager: ScreenManager:
id: screen_manager id: screen_manager
transition: SlideTransition() transition: SlideTransition()
@ -17,7 +16,6 @@ MDNavigationLayout:
anchor_y: "center" anchor_y: "center"
padding: dp(64) padding: dp(64)
BoxLayout: BoxLayout:
spacing: dp(36) spacing: dp(36)
orientation: 'vertical' orientation: 'vertical'
@ -31,12 +29,11 @@ MDNavigationLayout:
size_hint_y: None size_hint_y: None
text_size: self.width, None text_size: self.width, None
height: self.texture_size[1] height: self.texture_size[1]
# size: self.texture_size
MDIconButton: MDIconButton:
pos_hint: {"center_x": .5, "center_y": .5} pos_hint: {"center_x": .5, "center_y": .5}
icon: "transit-connection-variant" icon: "transit-connection-variant"
user_font_size: "72dp" icon_size: "72dp"
MDLabel: MDLabel:
id: connecting_info id: connecting_info
@ -46,7 +43,6 @@ MDNavigationLayout:
size_hint_y: None size_hint_y: None
text_size: self.width, None text_size: self.width, None
height: self.texture_size[1] height: self.texture_size[1]
# size: self.texture_size
MDScreen: MDScreen:
@ -57,8 +53,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Conversations" title: "Conversations"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[ [
['menu', lambda x: nav_drawer.set_state("open")], ['menu', lambda x: nav_drawer.set_state("open")],
@ -84,8 +79,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
id: messages_toolbar id: messages_toolbar
title: "Messages" title: "Messages"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
right_action_items: right_action_items:
@ -100,9 +94,9 @@ MDNavigationLayout:
do_scroll_y: True do_scroll_y: True
BoxLayout: BoxLayout:
orientation: "vertical"
id: no_keys_part id: no_keys_part
padding: [dp(28), dp(16), dp(16), dp(16)] orientation: "vertical"
padding: [dp(16), dp(0), dp(16), dp(16)]
spacing: dp(24) spacing: dp(24)
size_hint_y: None size_hint_y: None
height: self.minimum_height + dp(64) height: self.minimum_height + dp(64)
@ -114,14 +108,12 @@ MDNavigationLayout:
MDRectangleFlatIconButton: MDRectangleFlatIconButton:
icon: "key-wireless" icon: "key-wireless"
text: "Query Network For Keys" text: "Query Network For Keys"
# padding: [dp(16), dp(16), dp(16), dp(16)]
on_release: root.ids.screen_manager.app.key_query_action(self) on_release: root.ids.screen_manager.app.key_query_action(self)
BoxLayout: BoxLayout:
id: message_input_part id: message_input_part
# orientation: "vertical" padding: [dp(16), dp(0), dp(16), dp(16)]
padding: [dp(28), dp(16), dp(16), dp(16)]
spacing: dp(24) spacing: dp(24)
size_hint_y: None size_hint_y: None
height: self.minimum_height height: self.minimum_height
@ -136,7 +128,6 @@ MDNavigationLayout:
MDRectangleFlatIconButton: MDRectangleFlatIconButton:
icon: "transfer-up" icon: "transfer-up"
text: "Send" text: "Send"
# padding: [dp(16), dp(16), dp(16), dp(16)]
on_release: root.ids.screen_manager.app.message_send_action(self) on_release: root.ids.screen_manager.app.message_send_action(self)
@ -148,8 +139,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Local Broadcasts" title: "Local Broadcasts"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
@ -161,7 +151,7 @@ MDNavigationLayout:
spacing: "24dp" spacing: "24dp"
size_hint_y: None size_hint_y: None
height: self.minimum_height height: self.minimum_height
padding: dp(64) padding: [dp(35), dp(35), dp(35), dp(35)]
MDLabel: MDLabel:
id: broadcasts_info id: broadcasts_info
@ -180,8 +170,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Connectivity" title: "Connectivity"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
right_action_items: right_action_items:
@ -367,7 +356,6 @@ MDNavigationLayout:
disabled: True disabled: True
MDScreen: MDScreen:
name: "guide_screen" name: "guide_screen"
@ -376,8 +364,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Guide" title: "Guide"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
right_action_items: right_action_items:
@ -412,8 +399,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "App & Version Information" title: "App & Version Information"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
right_action_items: right_action_items:
@ -447,8 +433,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Local Area Map" title: "Local Area Map"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
@ -460,7 +445,8 @@ MDNavigationLayout:
spacing: "24dp" spacing: "24dp"
size_hint_y: None size_hint_y: None
height: self.minimum_height height: self.minimum_height
padding: dp(64) padding: [dp(35), dp(35), dp(35), dp(35)]
MDLabel: MDLabel:
id: map_info id: map_info
@ -479,8 +465,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Encryption Keys" title: "Encryption Keys"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
right_action_items: right_action_items:
@ -496,7 +481,8 @@ MDNavigationLayout:
spacing: "24dp" spacing: "24dp"
size_hint_y: None size_hint_y: None
height: self.minimum_height height: self.minimum_height
padding: dp(64) padding: [dp(35), dp(35), dp(35), dp(35)]
MDLabel: MDLabel:
id: keys_info id: keys_info
@ -510,7 +496,6 @@ MDNavigationLayout:
id: keys_display id: keys_display
icon: "eye" icon: "eye"
text: "Display Identity Key" text: "Display Identity Key"
# padding: [dp(16), dp(16), dp(16), dp(16)]
size_hint: [1.0, None] size_hint: [1.0, None]
on_release: root.ids.screen_manager.app.identity_display_action(self) on_release: root.ids.screen_manager.app.identity_display_action(self)
@ -518,7 +503,6 @@ MDNavigationLayout:
id: keys_copy id: keys_copy
icon: "file-key" icon: "file-key"
text: "Copy Key To Clipboard" text: "Copy Key To Clipboard"
# padding: [dp(16), dp(16), dp(16), dp(16)]
size_hint: [1.0, None] size_hint: [1.0, None]
on_release: root.ids.screen_manager.app.identity_copy_action(self) on_release: root.ids.screen_manager.app.identity_copy_action(self)
@ -526,7 +510,6 @@ MDNavigationLayout:
id: keys_share id: keys_share
icon: "upload-lock" icon: "upload-lock"
text: "Send Key To Other App" text: "Send Key To Other App"
# padding: [dp(16), dp(16), dp(16), dp(16)]
size_hint: [1.0, None] size_hint: [1.0, None]
on_release: root.ids.screen_manager.app.identity_share_action(self) on_release: root.ids.screen_manager.app.identity_share_action(self)
@ -535,7 +518,7 @@ MDNavigationLayout:
# spacing: "24dp" # spacing: "24dp"
size_hint_y: None size_hint_y: None
height: self.minimum_height height: self.minimum_height
padding: [dp(12), dp(12), dp(12), dp(0)] padding: [dp(0), dp(12), dp(0), dp(0)]
MDTextField: MDTextField:
id: key_restore_text id: key_restore_text
@ -548,7 +531,6 @@ MDNavigationLayout:
id: keys_restore id: keys_restore
icon: "download-lock" icon: "download-lock"
text: "Restore Identity From Key" text: "Restore Identity From Key"
# padding: [dp(16), dp(16), dp(16), dp(16)]
size_hint: [1.0, None] size_hint: [1.0, None]
on_release: root.ids.screen_manager.app.identity_restore_action(self) on_release: root.ids.screen_manager.app.identity_restore_action(self)
@ -561,8 +543,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Announce Stream" title: "Announce Stream"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
right_action_items: right_action_items:
@ -598,8 +579,7 @@ MDNavigationLayout:
MDTopAppBar: MDTopAppBar:
title: "Settings" title: "Settings"
elevation: 10 elevation: 2
pos_hint: {"top": 1}
left_action_items: left_action_items:
[['menu', lambda x: nav_drawer.set_state("open")]] [['menu', lambda x: nav_drawer.set_state("open")]]
right_action_items: right_action_items:
@ -659,8 +639,8 @@ MDNavigationLayout:
MDBoxLayout: MDBoxLayout:
orientation: "horizontal" orientation: "horizontal"
# spacing: "24dp"
size_hint_y: None size_hint_y: None
padding: [0,0,dp(24),0]
height: dp(48) height: dp(48)
MDLabel: MDLabel:
@ -669,12 +649,13 @@ MDNavigationLayout:
MDSwitch: MDSwitch:
id: settings_start_announce id: settings_start_announce
pos_hint: {"center_y": 0.3}
active: False active: False
MDBoxLayout: MDBoxLayout:
orientation: "horizontal" orientation: "horizontal"
# spacing: "24dp"
size_hint_y: None size_hint_y: None
padding: [0,0,dp(24),0]
height: dp(48) height: dp(48)
MDLabel: MDLabel:
@ -683,12 +664,13 @@ MDNavigationLayout:
MDSwitch: MDSwitch:
id: settings_dark_ui id: settings_dark_ui
pos_hint: {"center_y": 0.3}
active: False active: False
MDBoxLayout: MDBoxLayout:
orientation: "horizontal" orientation: "horizontal"
# spacing: "24dp"
size_hint_y: None size_hint_y: None
padding: [0,0,dp(24),0]
height: dp(48) height: dp(48)
MDLabel: MDLabel:
@ -697,13 +679,14 @@ MDNavigationLayout:
MDSwitch: MDSwitch:
id: settings_lxmf_delivery_by_default id: settings_lxmf_delivery_by_default
pos_hint: {"center_y": 0.3}
disabled: False disabled: False
active: False active: False
MDBoxLayout: MDBoxLayout:
orientation: "horizontal" orientation: "horizontal"
# spacing: "24dp"
size_hint_y: None size_hint_y: None
padding: [0,0,dp(24),0]
height: dp(48) height: dp(48)
MDLabel: MDLabel:
@ -712,13 +695,14 @@ MDNavigationLayout:
MDSwitch: MDSwitch:
id: settings_lxmf_sync_limit id: settings_lxmf_sync_limit
pos_hint: {"center_y": 0.3}
disabled: False disabled: False
active: False active: False
MDBoxLayout: MDBoxLayout:
orientation: "horizontal" orientation: "horizontal"
# spacing: "24dp"
size_hint_y: None size_hint_y: None
padding: [0,0,dp(24),0]
height: dp(48) height: dp(48)
MDLabel: MDLabel:
@ -727,13 +711,14 @@ MDNavigationLayout:
MDSwitch: MDSwitch:
id: settings_home_node_as_broadcast_repeater id: settings_home_node_as_broadcast_repeater
pos_hint: {"center_y": 0.3}
active: False active: False
disabled: True disabled: True
MDBoxLayout: MDBoxLayout:
orientation: "horizontal" orientation: "horizontal"
# spacing: "24dp"
size_hint_y: None size_hint_y: None
padding: [0,0,dp(24),0]
height: dp(48) height: dp(48)
MDLabel: MDLabel:
@ -742,12 +727,14 @@ MDNavigationLayout:
MDSwitch: MDSwitch:
id: settings_telemetry_to_home_node id: settings_telemetry_to_home_node
pos_hint: {"center_y": 0.3}
disabled: True disabled: True
active: False active: False
MDNavigationDrawer: MDNavigationDrawer:
id: nav_drawer id: nav_drawer
radius: (0, dp(8), dp(8), 0)
ContentNavigationDrawer: ContentNavigationDrawer:
ScrollView: ScrollView:
@ -852,7 +839,10 @@ MDNavigationLayout:
on_release: root.ids.screen_manager.app.quit_action(self) on_release: root.ids.screen_manager.app.quit_action(self)
<ListLXMessageCard>: <ListLXMessageCard>:
style: "elevated"
elevation: 2
padding: dp(8) padding: dp(8)
radius: [dp(4), dp(4), dp(4), dp(4)]
size_hint: 1.0, None size_hint: 1.0, None
height: content_text.height + heading_text.height + dp(32) height: content_text.height + heading_text.height + dp(32)
pos_hint: {"center_x": .5, "center_y": .5} pos_hint: {"center_x": .5, "center_y": .5}

View File

@ -6,7 +6,7 @@ from kivy.metrics import dp
from kivy.core.clipboard import Clipboard from kivy.core.clipboard import Clipboard
from kivymd.uix.card import MDCard from kivymd.uix.card import MDCard
from kivymd.uix.menu import MDDropdownMenu from kivymd.uix.menu import MDDropdownMenu
from kivymd.uix.behaviors import RoundedRectangularElevationBehavior from kivymd.uix.behaviors import CommonElevationBehavior
from kivy.properties import StringProperty, BooleanProperty from kivy.properties import StringProperty, BooleanProperty
from kivy.uix.gridlayout import GridLayout from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout from kivy.uix.boxlayout import BoxLayout
@ -21,7 +21,7 @@ else:
from .helpers import ts_format, mdc 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 from .helpers import color_received, color_delivered, color_propagated, color_failed, color_unknown, intensity_msgs_dark, intensity_msgs_light
class ListLXMessageCard(MDCard, RoundedRectangularElevationBehavior): class ListLXMessageCard(MDCard, CommonElevationBehavior):
text = StringProperty() text = StringProperty()
heading = StringProperty() heading = StringProperty()
@ -51,7 +51,7 @@ class Messages():
def update(self): def update(self):
self.messages = self.app.sideband.list_messages(self.context_dest, self.latest_message_timestamp) self.messages = self.app.sideband.list_messages(self.context_dest, self.latest_message_timestamp)
if self.list == None: if self.list == None:
layout = GridLayout(cols=1, spacing=16, padding=16, size_hint_y=None) layout = GridLayout(cols=1, spacing=dp(16), padding=dp(16), size_hint_y=None)
layout.bind(minimum_height=layout.setter('height')) layout.bind(minimum_height=layout.setter('height'))
self.list = layout self.list = layout