Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 974937e

Browse files
committed
UI tweaks
1 parent 3d687b7 commit 974937e

6 files changed

Lines changed: 19 additions & 11 deletions

File tree

assets/icons/elpcd192x.png

23.8 KB
Loading

lib/kv/data_management.kv

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
text: cls_nome.text if not root.new_cls else 'Adicionando nova Classe'
4949
markup: True
5050
shorten: True
51+
shorten_from: 'right'
5152
font_style: 'H4'
5253
color: app.theme_cls.primary_dark
5354

@@ -125,8 +126,9 @@
125126
padding: [0,0,0,dp(10)]
126127
AddMDTextField:
127128
disabled: True
128-
hint_text: 'Indicador de Classe Ativa/Inativa'
129129
size_hint_x: 1
130+
pos_hint: {'center_y':.47}
131+
hint_text: 'Indicador de Classe Ativa/Inativa' if self.size[0] > self.parent.width/2 else 'Indicador\nde Classe:'
130132
MDBoxLayout:
131133
width: dp(250)
132134
spacing: dp(20)
@@ -157,7 +159,9 @@
157159
color: app.theme_cls.primary_dark
158160
MDLabel:
159161
text: 'Temporalidade Documental'
162+
shorten: True
160163
font_size: sp(30)
164+
shorten_from: 'right'
161165
color: app.theme_cls.primary_dark
162166
AddMDTextField:
163167
id: fase_corrente
@@ -189,8 +193,9 @@
189193
height: dp(50)
190194
AddMDTextField:
191195
disabled: True
192-
hint_text: 'Destinação Final'
193196
size_hint_x: 1
197+
pos_hint: {'center_y':.47}
198+
hint_text: 'Destinação Final' if self.size[0] > self.parent.width/3 else 'Destinação\nFinal'
194199
MDBoxLayout:
195200
width: dp(250)
196201
spacing: dp(20)

lib/kv/data_tree.kv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
shorten: True
77
height: dp(25)
88
size_hint_y: None
9+
shorten_from: 'right'
910
theme_text_color: 'Custom'
1011
color_selected: (1,1,1,.5)
1112
text_size: self.texture_size

lib/kv/pcd_tree.kv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
MDLabel:
1717
size_hint_x: .7
1818
shorten: True
19+
shorten_from: 'left'
1920
text: '[FUNDO] ElPCD'
2021
theme_text_color: 'Custom'
2122
text_color: app.theme_cls.bg_light

lib/py/view_ttd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from kivymd.uix.datatables import MDDataTable
2+
from kivy.core.window import Window
23
from kivymd.app import MDApp
34
from kivy.metrics import dp
45

@@ -25,7 +26,7 @@ def view_ttd():
2526
("Fase Intermediária", dp(40)),
2627
("Destinação Final", dp(30))
2728
],
28-
rows_num= 999,
29+
rows_num= len(table_data) if len(table_data) > 0 else 1,
2930
row_data=table_data
3031
)
3132
datatable.bind(on_dismiss= lambda *x: app.main_frame.switch_to_screen('pcd'))

main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from kivymd.app import MDApp
1616
from kivy.clock import Clock
1717

18+
from kivy.resources import resource_add_path
1819
import kivy.properties as prop
1920

2021
from lib.py.data_management import DataManagement
@@ -104,9 +105,9 @@ class ElPCD(MDApp):
104105

105106
def __init__(self, **kwargs):
106107
super().__init__(**kwargs)
107-
## Load logo image \/
108+
## Presets \/
109+
self.icon = os.path.join(os.environ['ELPCD_ROOT'],'assets','icons','elpcd192x.png')
108110
self.LOGO = os.path.join(os.environ["ELPCD_ROOT"],'assets','gedalogo2020.png')
109-
## Sets app themming \/
110111
self.theme_cls.primary_palette = "Indigo"
111112
self.theme_cls.accent_palette = "Gray"
112113
## Sets Sqlite connection and cursor \/
@@ -131,10 +132,9 @@ def set_data_management_widget(self, view_only=True,item_data=None,new_cls=False
131132
self.main_frame.ids.data_frame.add_widget(self.data_management)
132133

133134
def on_start(self):
134-
def dismiss_welcome(*args):
135-
"""Switch off of welcome screen"""
136-
self.main_frame.switch_to_screen('pcd',duration=5.)
137-
self.welcome_event = Clock.schedule_once(dismiss_welcome,5) ## Switches after 5 seconds
135+
## Switch off of welcome screen \/
136+
dismiss_welcome = lambda *x: self.main_frame.switch_to_screen('pcd',duration=5.)
137+
self.welcome_event = Clock.schedule_once(dismiss_welcome,3)
138138

139139
def on_stop(self):
140140
## Close Sqlite connection \/
@@ -148,11 +148,11 @@ def build(self):
148148
if __name__ == "__main__":
149149

150150
if hasattr(sys, "_MEIPASS"):
151-
from kivy.resources import resource_add_path
152151
os.environ["ELPCD_ROOT"] = sys._MEIPASS
153-
resource_add_path(os.environ["ELPCD_ROOT"])
154152
else:
155153
os.environ["ELPCD_ROOT"] = os.path.dirname(os.path.abspath(__file__))
154+
155+
resource_add_path(os.environ["ELPCD_ROOT"])
156156

157157
kv_files_dir = os.path.join(os.environ["ELPCD_ROOT"],'lib','kv')
158158
for item in os.listdir(kv_files_dir):

0 commit comments

Comments
 (0)