2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-16 00:12:48 +00:00
Comrad/comrad/app/root.kv

280 lines
7.3 KiB
Plaintext
Raw Normal View History

2020-08-10 16:37:42 +00:00
#:include screens/login/login.kv
#:include screens/feed/feed.kv
#:include screens/post/post.kv
#:include screens/messages/messages.kv
#:include screens/notifications/notifications.kv
2020-08-13 07:55:59 +00:00
#:include screens/profile/profile.kv
2020-09-30 13:39:25 +00:00
#:include screens/refresh/refresh.kv
2020-08-13 07:55:59 +00:00
2020-08-10 16:37:42 +00:00
2020-08-03 10:25:58 +00:00
#:import get_color_from_hex kivy.utils.get_color_from_hex
#:import images_path kivymd.images_path
#:import colors kivymd.color_definitions.colors
2020-08-03 15:48:47 +00:00
#:import partial functools.partial
#:import NoTransition kivy.uix.screenmanager.NoTransition
2020-08-05 09:15:10 +00:00
# :import MDCarousel kivymd.uix.carousel.MDCarousel
2020-08-19 23:26:25 +00:00
#:import rgb main.rgb
#:import COLOR_BG main.COLOR_BG
#:import BG_IMG main.BG_IMG
2020-08-23 13:22:00 +00:00
#:import COLOR_TEXT main.COLOR_TEXT
2020-09-22 09:08:20 +00:00
#:import COLOR_CARD main.COLOR_CARD
2020-09-30 11:36:50 +00:00
#:import SCREEN_TO_ICON main.SCREEN_TO_ICON
2020-08-06 10:24:09 +00:00
## CLASS DEFS
<MyBoxLayout>:
orientation: "vertical"
pos_hint: {'center_x':0.5, 'center_y':0.5}
size_hint:0.5,0.5
padding:'10dp'
2020-09-24 10:40:48 +00:00
md_bg_color:rgb(*COLOR_BG) #0,0,0,1
2020-08-06 10:24:09 +00:00
canvas:
Color:
rgb: 1,0,0,2
Line:
width: 1
rectangle: (self.x, self.y, self.width, self.height)
<MyLabel>:
theme_text_color: 'Custom'
2020-08-23 13:22:00 +00:00
text_color: rgb(*COLOR_TEXT)
2020-08-13 17:41:31 +00:00
# pos_hint: {'center_y': 0.5}
2020-08-06 10:24:09 +00:00
halign: 'center'
height: self.texture_size[1]
2020-08-13 17:41:31 +00:00
font_name: 'assets/font.otf'
size_hint:1,None
2020-08-06 10:24:09 +00:00
2020-09-24 10:40:48 +00:00
<MapImage>:
canvas:
Color:
rgb: (0, 0, 0, 0)
Rectangle:
texture: self.texture
size: self.width + 20, self.height + 20
pos: self.x - 10, self.y - 10
2020-08-06 10:24:09 +00:00
2020-08-22 21:20:27 +00:00
<ProgressPopup>:
type: "custom"
size_hint: (None, None)
2020-09-24 10:40:48 +00:00
size: ('333sp','333sp')
2020-08-22 21:20:27 +00:00
# md_bg_color: 0,0,0,1
MDBoxLayout:
id: popup_box_layout
size_hint:(1,1)
orientation: 'vertical'
cols:1
md_bg_color: rgb(*COLOR_ACCENT)
spacing:'0dp'
padding:'0dp'
# radius:[20,]
# border_radius:20
canvas:
Color:
rgb: rgb(*COLOR_TEXT)
Line:
width: 1
rectangle: (self.x, self.y, self.width, self.height)
# radius:[20,]
# border_radius:20
MDLabel:
size_hint:(None,None)
# id: progress_label
text: ''
halign: 'center'
theme_text_color: 'Custom'
text_color: rgb(*COLOR_TEXT)
font_size: '18dp'
font_name: 'assets/overpass-mono-regular.otf'
pos_hint: {'center_x': .5, 'center_y': 0.5}
MDSpinner:
size_hint: None, None
size: '46dp','46dp'
pos_hint: {'center_x': .5, 'center_y': 0.5}
active: True
color:rgb(*COLOR_TEXT)
<MessagePopup>:
type: "custom"
size_hint: None,None
size: ('300dp','300dp')
2020-09-26 09:22:10 +00:00
md_bg_color: rgb(*COLOR_BG)
2020-08-22 21:20:27 +00:00
MDBoxLayout:
id: msg_popup_box_layout
size_hint:(1,1)
orientation: 'vertical'
cols:1
2020-09-26 09:22:10 +00:00
md_bg_color: rgb(*COLOR_BG)
2020-08-22 21:20:27 +00:00
spacing:'0dp'
padding:'0dp'
pos_hint: {'center_x':0.5, 'center_y':0.5}
# radius:[20,]
# border_radius:20
2020-09-22 09:08:20 +00:00
border_radius:20
canvas:
Color:
2020-09-26 09:22:10 +00:00
rgba: rgb(*COLOR_BG,a=1)
2020-09-22 09:08:20 +00:00
Line:
width: 1
rounded_rectangle: (self.x, self.y, self.width, self.height, 20, 20, 20, 20)
2020-08-22 21:20:27 +00:00
MDLabel:
# size_hint:(None,None)
id: msg_label
text: ''
halign: 'center'
# valign: 'middle'
theme_text_color: 'Custom'
text_color: rgb(*COLOR_TEXT)
font_size: '18dp'
font_name: 'assets/overpass-mono-regular.otf'
pos_hint: {'center_x': .5, 'y': 0}
2020-09-23 12:14:12 +00:00
<BooleanInputPopupCard>:
type: "custom"
size_hint: (None, None)
size: ('200dp','200dp')
md_bg_color: rgb(*COLOR_TEXT)
2020-09-22 09:08:20 +00:00
<MessagePopupCard>:
type: "custom"
size_hint: 1,1
# size: ('300dp','300dp')
# md_bg_color: rgb(*COLOR_CARD)
md_bg_color:0,0,0,0
size:('600sp','100sp')
2020-09-22 09:08:20 +00:00
MDBoxLayout:
id: msg_popup_box_layout
#size_hint:(1,1)
orientation: 'vertical'
padding: "20dp"
size_hint: (1, 1)
# adaptive_height: True
pos_hint: {"center_x": .5, "center_y": .5}
md_bg_color: rgb(*COLOR_CARD)
# md_bg_color:0,0,0,0
2020-09-22 09:08:20 +00:00
height: self.minimum_height
# radius:[20,]
# border_radius:20
# canvas:
# Color:
# rgba: rgb(*COLOR_CARD_BORDER,a=0.5)
# Line:
# width: 1
# rounded_rectangle: (self.x, self.y, self.width, self.height, 20, 20, 20, 20)
# MDLabel:
# # size_hint:(None,None)
# id: msg_label
# text: ''
# halign: 'center'
# # valign: 'top'
# theme_text_color: 'Custom'
# text_color: rgb(*COLOR_TEXT)
# font_size: '18dp'
# font_name: 'assets/overpass-mono-regular.otf'
# pos_hint: {'center_x': .5, 'y': 0}
2020-08-22 21:20:27 +00:00
2020-08-06 10:24:09 +00:00
### LAYOUT
2020-08-03 15:48:47 +00:00
MyLayout:
2020-08-03 16:29:03 +00:00
scr_mngr: scr_mngr
orientation: 'vertical'
height: self.minimum_height
2020-08-19 23:26:25 +00:00
md_bg_color:self.rgb(*COLOR_BG)
2020-08-03 16:29:03 +00:00
canvas:
# Color:
# rgba: 1,1,1,1 #0.925,0.925,0.925,0.19 #get_color_from_hex(colors['Gray']['900'])
# # rgba: 0.1,0.1,0.1,1 #get_color_from_hex(colors['Gray']['900'])
2020-08-06 10:24:09 +00:00
2020-08-13 17:41:31 +00:00
# Rectangle:
# pos: self.pos
# size: self.size
# source: BG_IMG
# # texture: app.texture
2020-08-03 16:29:03 +00:00
2020-08-06 10:24:09 +00:00
2020-08-19 23:26:25 +00:00
MyToolbar:
2020-08-03 16:29:03 +00:00
id: toolbar
title: app.title
pos_hint: {'center_x': .5, 'center_y': 0.95}
2020-08-03 20:44:53 +00:00
md_bg_color: 0.1,0.1,0.1,1
2020-08-03 16:29:03 +00:00
background_palette: 'Red'
2020-08-19 23:26:25 +00:00
theme_text_color:'Custom'
2020-08-03 16:29:03 +00:00
background_hue: '500'
2020-09-26 10:12:16 +00:00
# right_action_items: [['account-circle-outline', partial(root.change_screen, 'profile')],['card-text', partial(root.change_screen, 'feed')],['message-outline', partial(root.change_screen, 'messages')],['pencil-plus-outline', partial(root.change_screen, 'post')],['exit-run', partial(root.change_screen, 'login')]]
2020-09-30 13:39:25 +00:00
right_action_items: [[SCREEN_TO_ICON['feed'], partial(root.change_screen, 'feed')],[SCREEN_TO_ICON['messages'], partial(root.change_screen, 'messages')],[SCREEN_TO_ICON['post'], partial(root.change_screen, 'post')],[SCREEN_TO_ICON['profile'], partial(root.change_screen, 'profile')],[SCREEN_TO_ICON['refresh'], partial(root.change_screen, 'refresh')],[SCREEN_TO_ICON['login'], partial(root.change_screen, 'login')]]
2020-08-09 10:32:42 +00:00
#left_action_items: [[f"assets/fist2.png", partial(root.change_screen, 'feed')]]
2020-08-22 21:20:27 +00:00
# ['bell-outline', partial(root.change_screen, 'login')]
2020-08-06 12:55:26 +00:00
font_context: None
font_name: f'assets/Strengthen.ttf'
2020-08-19 23:26:25 +00:00
# canvas:
# Color:
# rgb: rgb(67,92,61)
# Line:
# width: 1
# rectangle: (self.x, self.y, self.width, self.height)
2020-08-06 12:55:26 +00:00
2020-08-03 16:29:03 +00:00
ScreenManager:
id: scr_mngr
2020-08-03 21:20:38 +00:00
# transition: NoTransition()
2020-08-06 08:46:51 +00:00
LoginScreen:
2020-08-11 13:01:48 +00:00
id: login_screen
2020-08-05 09:15:10 +00:00
FeedScreen:
2020-08-11 13:01:48 +00:00
id: feed_screen
2020-08-17 16:23:40 +00:00
PostScreen:
id: post_screen
2020-08-10 20:38:00 +00:00
2020-08-03 16:29:03 +00:00
MessagesScreen:
2020-08-11 13:01:48 +00:00
id: messages_screen
2020-08-03 16:29:03 +00:00
NotificationsScreen:
2020-08-13 07:55:59 +00:00
id: notifications_screen
ProfileScreen:
2020-09-30 13:39:25 +00:00
id: profile_screen
RefreshScreen:
id: refresh_screen