2020-01-09 16:09:01 +01:00
|
|
|
#:import IconLeftWidget kivymd.uix.list.IconLeftWidget
|
|
|
|
#:import images_path kivymd.images_path
|
|
|
|
#:import Spinner kivy.uix.spinner.Spinner
|
|
|
|
#:import Factory kivy.factory.Factory
|
2019-07-17 10:50:27 +02:00
|
|
|
|
2019-10-01 16:49:03 +02:00
|
|
|
#:import MDCheckbox kivymd.uix.selectioncontrol.MDCheckbox
|
|
|
|
#:import MDList kivymd.uix.list.MDList
|
|
|
|
#:import OneLineListItem kivymd.uix.list.OneLineListItem
|
|
|
|
#:import MDTextField kivymd.uix.textfield.MDTextField
|
2019-05-09 14:48:29 +02:00
|
|
|
#:import get_color_from_hex kivy.utils.get_color_from_hex
|
2019-12-12 15:38:07 +01:00
|
|
|
#:import MDCard kivymd.uix.card.MDCard
|
2019-05-09 14:48:29 +02:00
|
|
|
#:import colors kivymd.color_definitions.colors
|
2019-10-01 16:49:03 +02:00
|
|
|
#:import MDTabs kivymd.uix.tab.MDTabs
|
|
|
|
#:import MDFloatingActionButton kivymd.uix.button.MDFloatingActionButton
|
2019-06-06 15:48:20 +02:00
|
|
|
#:import Factory kivy.factory.Factory
|
2019-10-01 16:49:03 +02:00
|
|
|
#:import MDScrollViewRefreshLayout kivymd.uix.refreshlayout.MDScrollViewRefreshLayout
|
2019-12-12 15:38:07 +01:00
|
|
|
#:import MDSpinner kivymd.uix.spinner.MDSpinner
|
2019-10-18 16:00:43 +02:00
|
|
|
#:import MDTabsBase kivymd.uix.tab.MDTabsBase
|
|
|
|
<Tab@BoxLayout+MDTabsBase>
|
|
|
|
|
2019-06-28 16:54:47 +02:00
|
|
|
#:set color_button (0.784, 0.443, 0.216, 1) # brown
|
|
|
|
#:set color_button_pressed (0.659, 0.522, 0.431, 1) # darker brown
|
|
|
|
#:set color_font (0.957, 0.890, 0.843, 1) # off white
|
|
|
|
|
2019-06-06 15:48:20 +02:00
|
|
|
<MySpinnerOption@SpinnerOption>:
|
|
|
|
font_size: '12.5sp'
|
2019-06-28 16:54:47 +02:00
|
|
|
background_color: color_button if self.state == 'down' else color_button_pressed
|
|
|
|
background_down: 'atlas://data/images/defaulttheme/button'
|
|
|
|
color: color_font
|
2019-06-06 15:48:20 +02:00
|
|
|
|
2020-01-09 16:09:01 +01:00
|
|
|
<NavigationItem>
|
2020-01-18 11:31:50 +01:00
|
|
|
on_press: root.active = not root.active
|
|
|
|
active_color: root.theme_cls.primary_color if root.active else root.theme_cls.text_color
|
2020-01-09 16:09:01 +01:00
|
|
|
|
|
|
|
IconLeftWidget:
|
|
|
|
icon: root.icon
|
2020-01-18 11:31:50 +01:00
|
|
|
theme_text_color: "Custom"
|
|
|
|
text_color: root.active_color
|
2020-01-09 16:09:01 +01:00
|
|
|
|
2020-01-18 11:31:50 +01:00
|
|
|
BadgeText:
|
|
|
|
text: f"{root.badge_text}"
|
|
|
|
theme_text_color: "Custom"
|
|
|
|
text_color: root.active_color
|
|
|
|
halign: 'right'
|
|
|
|
|
|
|
|
<NavigationDrawerDivider>:
|
|
|
|
canvas:
|
|
|
|
Color:
|
|
|
|
rgba: self.theme_cls.divider_color
|
|
|
|
Line:
|
|
|
|
points: root.x, root.y + dp(8), root.x + self.width, root.y + dp(8)
|
2020-01-09 16:09:01 +01:00
|
|
|
|
|
|
|
<ContentNavigationDrawer>
|
|
|
|
|
|
|
|
BoxLayout:
|
|
|
|
orientation: 'vertical'
|
|
|
|
|
|
|
|
FloatLayout:
|
|
|
|
size_hint_y: None
|
|
|
|
height: "200dp"
|
|
|
|
|
|
|
|
BoxLayout:
|
|
|
|
id: top_box
|
|
|
|
size_hint_y: None
|
|
|
|
height: "200dp"
|
|
|
|
#padding: "10dp"
|
|
|
|
x: root.parent.x
|
|
|
|
pos_hint: {"top": 1}
|
|
|
|
Image:
|
2020-01-18 11:31:50 +01:00
|
|
|
#source: './images/drawer_logo1.png'
|
|
|
|
source: app.get_default_logo()
|
2020-01-09 16:09:01 +01:00
|
|
|
|
|
|
|
ScrollView:
|
|
|
|
pos_hint: {"top": 1}
|
|
|
|
|
|
|
|
GridLayout:
|
|
|
|
id: box_item
|
|
|
|
cols: 1
|
|
|
|
size_hint_y: None
|
|
|
|
height: self.minimum_height
|
2020-01-18 11:31:50 +01:00
|
|
|
NavigationDrawerDivider:
|
|
|
|
NavigationDrawerSubheader:
|
|
|
|
text: "Accounts"
|
2020-01-09 16:09:01 +01:00
|
|
|
NavigationItem:
|
2020-01-18 11:31:50 +01:00
|
|
|
CustomSpinner:
|
2020-01-09 16:09:01 +01:00
|
|
|
id: btn
|
2020-01-18 11:31:50 +01:00
|
|
|
pos_hint:{"x":0,"y":0}
|
2020-01-09 16:09:01 +01:00
|
|
|
option_cls: Factory.get("MySpinnerOption")
|
2020-01-18 11:31:50 +01:00
|
|
|
font_size: '10.9sp'
|
2020-01-09 16:09:01 +01:00
|
|
|
text: app.getDefaultAccData()
|
|
|
|
background_color: color_button if self.state == 'normal' else color_button_pressed
|
|
|
|
background_down: 'atlas://data/images/defaulttheme/spinner'
|
|
|
|
color: color_font
|
|
|
|
values: app.variable_1
|
|
|
|
on_text:app.getCurrentAccountData(self.text)
|
|
|
|
Image:
|
|
|
|
source: app.get_default_image()
|
|
|
|
x: self.width/6
|
|
|
|
y: self.parent.y + self.parent.height/4
|
|
|
|
size: self.parent.height/2, self.parent.height/2
|
|
|
|
ArrowImg:
|
|
|
|
NavigationItem:
|
2020-01-18 11:31:50 +01:00
|
|
|
id: inbox_cnt
|
2020-01-09 16:09:01 +01:00
|
|
|
text: 'Inbox'
|
|
|
|
icon: 'email-open'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'inbox'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
on_press: app.load_screen(self)
|
|
|
|
NavigationItem:
|
2020-01-18 11:31:50 +01:00
|
|
|
id: send_cnt
|
2020-01-09 16:09:01 +01:00
|
|
|
text: 'Sent'
|
|
|
|
icon: 'send'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'sent'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
2020-01-18 11:31:50 +01:00
|
|
|
id: draft_cnt
|
2020-01-09 16:09:01 +01:00
|
|
|
text: 'Draft'
|
|
|
|
icon: 'message-draw'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'draft'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
2020-01-18 11:31:50 +01:00
|
|
|
id: trash_cnt
|
2020-01-09 16:09:01 +01:00
|
|
|
text: 'Trash'
|
|
|
|
icon: 'delete'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'trash'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
2020-01-18 11:31:50 +01:00
|
|
|
id: allmail_cnt
|
2020-01-09 16:09:01 +01:00
|
|
|
text: 'All Mails'
|
|
|
|
icon: 'contact-mail'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'allmails'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
on_press: app.load_screen(self)
|
2020-01-18 11:31:50 +01:00
|
|
|
NavigationDrawerDivider:
|
|
|
|
NavigationDrawerSubheader:
|
|
|
|
text: "All labels"
|
2020-01-09 16:09:01 +01:00
|
|
|
NavigationItem:
|
|
|
|
text: 'Address Book'
|
|
|
|
icon: 'book-multiple'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'addressbook'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
|
|
|
text: 'Settings'
|
|
|
|
icon: 'settings'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'set'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
|
|
|
text: 'Payment'
|
|
|
|
icon: 'bell'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'payment'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
|
|
|
text: 'Credits'
|
|
|
|
icon: 'wallet'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'credits'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
|
|
|
text: 'New address'
|
|
|
|
icon: 'account-plus'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'login'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
|
|
|
text: 'Network status'
|
|
|
|
icon: 'server-network'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'networkstat'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
|
|
|
NavigationItem:
|
|
|
|
text: 'My addresses'
|
|
|
|
icon: 'account-multiple'
|
|
|
|
divider: None
|
|
|
|
on_release: app.root.ids.scr_mngr.current = 'myaddress'
|
|
|
|
on_release: root.parent.toggle_nav_drawer()
|
2019-05-09 14:48:29 +02:00
|
|
|
|
|
|
|
NavigationLayout:
|
|
|
|
id: nav_layout
|
|
|
|
|
2020-01-09 16:09:01 +01:00
|
|
|
MDToolbar:
|
|
|
|
id: toolbar
|
|
|
|
title: app.current_address_label()
|
|
|
|
opacity: 1 if app.addressexist() else 0
|
|
|
|
disabled: False if app.addressexist() else True
|
|
|
|
pos_hint: {"top": 1}
|
|
|
|
md_bg_color: app.theme_cls.primary_color
|
|
|
|
elevation: 10
|
|
|
|
left_action_items: [['menu', lambda x: nav_drawer.toggle_nav_drawer()]]
|
|
|
|
right_action_items: [['account-plus', lambda x: app.addingtoaddressbook()]]
|
|
|
|
|
|
|
|
ScreenManager:
|
|
|
|
id: scr_mngr
|
|
|
|
size_hint_y: None
|
|
|
|
height: root.height - toolbar.height
|
|
|
|
Inbox:
|
|
|
|
id:sc1
|
|
|
|
Page:
|
|
|
|
id:sc2
|
|
|
|
Create:
|
|
|
|
id:sc3
|
|
|
|
Sent:
|
|
|
|
id:sc4
|
|
|
|
Trash:
|
|
|
|
id:sc5
|
|
|
|
Login:
|
|
|
|
id:sc6
|
|
|
|
Random:
|
|
|
|
id:sc7
|
|
|
|
Spam:
|
|
|
|
id:sc8
|
|
|
|
Setting:
|
|
|
|
id:sc9
|
|
|
|
MyAddress:
|
|
|
|
id:sc10
|
|
|
|
AddressBook:
|
|
|
|
id:sc11
|
|
|
|
Payment:
|
|
|
|
id:sc12
|
|
|
|
NetworkStat:
|
|
|
|
id:sc13
|
|
|
|
MailDetail:
|
|
|
|
id:sc14
|
|
|
|
ShowQRCode:
|
|
|
|
id:sc15
|
|
|
|
Draft:
|
|
|
|
id:sc16
|
|
|
|
Allmails:
|
|
|
|
id:sc17
|
|
|
|
Credits:
|
|
|
|
id:sc18
|
|
|
|
Starred:
|
|
|
|
id:sc19
|
|
|
|
Archieve:
|
|
|
|
id:sc20
|
|
|
|
|
|
|
|
MDNavigationDrawer:
|
2019-05-09 14:48:29 +02:00
|
|
|
id: nav_drawer
|
|
|
|
|
2020-01-09 16:09:01 +01:00
|
|
|
ContentNavigationDrawer:
|
|
|
|
id: content_drawer
|
2018-08-04 10:30:12 +02:00
|
|
|
|
2020-01-09 16:09:01 +01:00
|
|
|
<Page>:
|
|
|
|
name: 'page'
|
|
|
|
Label:
|
|
|
|
text:"I am in Page"
|
|
|
|
color: 0,0,0,1
|
2019-09-19 18:30:26 +02:00
|
|
|
|
2020-01-09 16:09:01 +01:00
|
|
|
<Create>:
|
|
|
|
name: 'create'
|
|
|
|
Loader:
|
2019-09-19 18:30:26 +02:00
|
|
|
|
2020-01-09 16:09:01 +01:00
|
|
|
<Spam>:
|
|
|
|
name: 'spam'
|
|
|
|
Label:
|
|
|
|
text:"I am in Spam"
|
|
|
|
color: 0,0,0,1
|
|
|
|
|
|
|
|
<ShowQRCode>:
|
|
|
|
name: 'showqrcode'
|
|
|
|
BoxLayout:
|
|
|
|
orientation: 'vertical'
|
|
|
|
id: qr
|
|
|
|
|
|
|
|
<Starred>:
|
|
|
|
name: 'starred'
|
|
|
|
Label:
|
|
|
|
text:"I am in Starred"
|
|
|
|
color: 0,0,0,1
|
|
|
|
|
|
|
|
color: 0,0,0,1
|
|
|
|
|
|
|
|
<Archieve>:
|
|
|
|
name: 'archieve'
|
|
|
|
Label:
|
|
|
|
text:"I am in Archieve"
|
|
|
|
color: 0,0,0,1
|
|
|
|
|
|
|
|
color: 0,0,0,1
|