This repository has been archived on 2024-12-19. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-19/src/bitmessagekivy/main.kv

287 lines
9.3 KiB
Plaintext

#:import IconLeftWidget kivymd.uix.list.IconLeftWidget
#:import images_path kivymd.images_path
#:import Spinner kivy.uix.spinner.Spinner
#:import Factory kivy.factory.Factory
#:import MDCheckbox kivymd.uix.selectioncontrol.MDCheckbox
#:import MDList kivymd.uix.list.MDList
#:import OneLineListItem kivymd.uix.list.OneLineListItem
#:import MDTextField kivymd.uix.textfield.MDTextField
#:import get_color_from_hex kivy.utils.get_color_from_hex
#:import MDCard kivymd.uix.card.MDCard
#:import colors kivymd.color_definitions.colors
#:import MDTabs kivymd.uix.tab.MDTabs
#:import MDFloatingActionButton kivymd.uix.button.MDFloatingActionButton
#:import Factory kivy.factory.Factory
#:import MDScrollViewRefreshLayout kivymd.uix.refreshlayout.MDScrollViewRefreshLayout
#:import MDSpinner kivymd.uix.spinner.MDSpinner
#:import MDTabsBase kivymd.uix.tab.MDTabsBase
<Tab@BoxLayout+MDTabsBase>
#: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
<MySpinnerOption@SpinnerOption>:
font_size: '12.5sp'
background_color: color_button if self.state == 'down' else color_button_pressed
background_down: 'atlas://data/images/defaulttheme/button'
color: color_font
<NavigationItem>
on_press: root.active = not root.active
active_color: root.theme_cls.primary_color if root.active else root.theme_cls.text_color
IconLeftWidget:
icon: root.icon
theme_text_color: "Custom"
text_color: root.active_color
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)
<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:
#source: './images/drawer_logo1.png'
source: app.get_default_logo()
ScrollView:
pos_hint: {"top": 1}
GridLayout:
id: box_item
cols: 1
size_hint_y: None
height: self.minimum_height
NavigationDrawerDivider:
NavigationDrawerSubheader:
text: "Accounts"
NavigationItem:
CustomSpinner:
id: btn
pos_hint:{"x":0,"y":0}
option_cls: Factory.get("MySpinnerOption")
font_size: '10.9sp'
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:
id: inbox_cnt
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:
id: send_cnt
text: 'Sent'
icon: 'send'
divider: None
on_release: app.root.ids.scr_mngr.current = 'sent'
on_release: root.parent.toggle_nav_drawer()
NavigationItem:
id: draft_cnt
text: 'Draft'
icon: 'message-draw'
divider: None
on_release: app.root.ids.scr_mngr.current = 'draft'
on_release: root.parent.toggle_nav_drawer()
NavigationItem:
id: trash_cnt
text: 'Trash'
icon: 'delete'
divider: None
on_release: app.root.ids.scr_mngr.current = 'trash'
on_release: root.parent.toggle_nav_drawer()
NavigationItem:
id: allmail_cnt
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)
NavigationDrawerDivider:
NavigationDrawerSubheader:
text: "All labels"
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()
NavigationLayout:
id: nav_layout
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:
id: nav_drawer
ContentNavigationDrawer:
id: content_drawer
<Page>:
name: 'page'
Label:
text:"I am in Page"
color: 0,0,0,1
<Create>:
name: 'create'
Loader:
<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