changeset 62:1922506846be

design fixes: - adjust sizes using sp/dp so it adapts on different screen resolutions - use a shorter sentence for profile manager label, so it appears better on small screens - various design adjustment to appear correclty on different screen size
author Goffi <goffi@goffi.org>
date Sun, 04 Dec 2016 21:34:30 +0100
parents 0b7f10de416e
children af4f986d86f0
files src/cagou/core/profile_manager.py src/cagou/core/widgets_handler.py src/cagou/kv/profile_manager.kv src/cagou/kv/root_widget.kv src/cagou/kv/xmlui.kv src/cagou/plugins/plugin_wid_widget_selector.kv
diffstat 6 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/cagou/core/profile_manager.py	Sun Dec 04 18:21:23 2016 +0100
+++ b/src/cagou/core/profile_manager.py	Sun Dec 04 21:34:30 2016 +0100
@@ -27,6 +27,7 @@
 from kivy.uix.button import Button
 from kivy.uix.screenmanager import ScreenManager, Screen
 from kivy.adapters import listadapter
+from kivy.metrics import sp
 from kivy import properties
 from cagou import G
 
@@ -136,6 +137,7 @@
         self.list_adapter = ProfileListAdapter(pm,
                                                data=profiles,
                                                cls=ProfileItem,
+                                               args_converter=self.converter,
                                                selection_mode='multiple',
                                                allow_empty_selection=True,
                                               )
@@ -144,6 +146,11 @@
         connect_btn = ConnectButton(self)
         self.layout.add_widget(connect_btn)
 
+    def converter(self, row_idx, obj):
+        return {'text': obj,
+                'size_hint_y': None,
+                'height': sp(40)}
+
     def reload(self):
         """Reload profiles list"""
         profiles = G.host.bridge.getProfilesList()
--- a/src/cagou/core/widgets_handler.py	Sun Dec 04 18:21:23 2016 +0100
+++ b/src/cagou/core/widgets_handler.py	Sun Dec 04 21:34:30 2016 +0100
@@ -37,7 +37,7 @@
 
 class WHSplitter(Button):
     horizontal=properties.BooleanProperty(True)
-    thickness=properties.NumericProperty(15)
+    thickness=properties.NumericProperty(dp(20))
     split_move = None # we handle one split at a time, so we use a class attribute
 
     def __init__(self, handler, **kwargs):
--- a/src/cagou/kv/profile_manager.kv	Sun Dec 04 18:21:23 2016 +0100
+++ b/src/cagou/kv/profile_manager.kv	Sun Dec 04 21:34:30 2016 +0100
@@ -21,11 +21,13 @@
         size_hint: 1,0.05
 
 <PMLabel@Label>:
-    size_hint: 1, 0.1
+    size_hint: 1, None
+    height: sp(30)
 
 <PMInput@TextInput>:
     multiline: False
-    size_hint: 1, 0.1
+    size_hint: 1, None
+    height: sp(30)
     write_tab: False
 
 <PMButton@Button>:
@@ -130,7 +132,7 @@
         orientation: 'vertical'
 
         Label:
-            text: "Select a profile to connect with, or create a new one"
+            text: "Select a profile or create a new one"
             size_hint: 1,0.05
 
         GridLayout:
--- a/src/cagou/kv/root_widget.kv	Sun Dec 04 18:21:23 2016 +0100
+++ b/src/cagou/kv/root_widget.kv	Sun Dec 04 21:34:30 2016 +0100
@@ -54,6 +54,7 @@
     height: dp(35)
     IconButton:
         source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") if root.notes else app.expand("{media}/misc/black.png")
+        allow_stretch: True
         size_hint: None, 1
         width: self.texture_size[0]
         on_release: root.notes_drop.open(self) if root.notes else None
@@ -61,6 +62,7 @@
         id: manager
     NotifsIcon:
         id: notifs_icon
+        allow_stretch: True
         source: app.expand("{media}/icons/muchoslava/png/cagou_profil_bleu_32.png") if self.notifs else app.expand("{media}/misc/black.png")
         size_hint: None, 1
         width: self.texture_size[0]
--- a/src/cagou/kv/xmlui.kv	Sun Dec 04 18:21:23 2016 +0100
+++ b/src/cagou/kv/xmlui.kv	Sun Dec 04 21:34:30 2016 +0100
@@ -17,7 +17,7 @@
 #:set common_height 30
 #:set button_height 50
 
-<EmptyWidget,TextWidget,LabelWidget,JidWidget,StringWidget,JidInputWidget>:
+<EmptyWidget,TextWidget,LabelWidget,JidWidget,StringWidget,PasswordWidget,JidInputWidget>:
     size_hint: 1, None
     height: dp(common_height)
 
--- a/src/cagou/plugins/plugin_wid_widget_selector.kv	Sun Dec 04 18:21:23 2016 +0100
+++ b/src/cagou/plugins/plugin_wid_widget_selector.kv	Sun Dec 04 21:34:30 2016 +0100
@@ -16,12 +16,15 @@
 
 <WidgetSelItem>:
     size_hint: (1, None)
-    height: 50
+    height: dp(40)
     Widget:
     Image:
         source: root.plugin_info["icon_medium"]
+        allow_stretch: True
+        keep_ratio: True
         width: self.texture_size[0]
     Label:
         text: root.plugin_info["name"]
         bold: True
+        font_size: sp(20)
     Widget: