How to get text from a textfield inside another classin kivy - python

I'm stuck in this problem, I'm using a dialog so that the user can change his password but i cant access the textfield text from the DashboardGerente class...
main.py
class Content(BoxLayout):
old_pass_tf = ObjectProperty()
new_pass_tf = ObjectProperty()
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.app = MDApp.get_running_app()
def show_passnew(self,widget):
if widget.state == "normal":
self.ids.new_pass.password = True
else:
self.ids.new_pass.password = False
def show_passold(self,widget):
if widget.state == "normal":
self.ids.old_pass.password = True
else:
self.ids.old_pass.password = False
class DashboardGerente(Screen):
dialog = None
cont = Content()
def Logout(self):
wm = MDApp.get_running_app().root
wm.current = "Login"
def teste(self):
print(Login.username)
def show_alert_dialog(self):
if not self.dialog:
self.dialog = MDDialog(
title = "Alterar palavra-passe",
text = "Palavra-passe antiga",
content_cls=Content(),
type="custom",
buttons=[
MDFlatButton(
text="Cancelar",
text_color=rgba(0,0,0,1),
on_release = self.cancelar
),
MDFlatButton(
text="Alterar",
text_color = rgba(0,0,0,1),
on_release = self.change_pass
),
],
)
self.dialog.open()
def cancelar(self,obj):
self.dialog.dismiss()
def change_pass(self, obj):
#i want to access the textfield text here
pass
.kv file
<Content>:
orientation: "vertical"
spacing: "12dp"
size_hint_y: None
height: "120dp"
id: content_dialog_change_pass
MDTextField:
id: old_pass
hint_text: "Palavra-passe antiga"
mode: "rectangle"
required: False
color: 1, 0, 1, 1
line_color_focus: 0.5, 0, 1, 1
icon_right: "shield-key"
size_hint: .9, None
password: True
GridLayout:
cols:2
MDCheckbox:
on_press: root.show_passold(self)
size_hint: None, None
height: 5
width: 20
MDLabel:
text: "Mostrar Palavra-passe"
font_size: "13px"
color: 0,0,0,.4
MDTextField:
id: new_pass
hint_text: "Palavra-passe nova"
mode: "rectangle"
required: False
color: 1, 0, 1, 1
line_color_focus: 0.5, 0, 1, 1
icon_right: "shield-key"
size_hint: .9, None
password: True
GridLayout:
cols:2
MDCheckbox:
on_press: root.show_passnew(self)
size_hint: None, None
height: 10
width: 20
MDLabel:
text: "Mostrar Palavra-passe"
font_size: "13px"
color: 0,0,0,.4
<DashboardGerente#FloatLayout>:
name: "DashboardGerente"
MDBottomNavigation:
panel_color: get_color_from_hex("#c300ff")
text_color: 0,0,0,1
MDBottomNavigationItem: ## Perfil do utilizador
name: 'Profile'
text: 'Perfil'
icon: 'account'
badge_icon: "numeric-10"
MDCard:
border_radius: 20
radius: [15]
size_hint:None, None
size: 300, 400
pos_hint: {"center_x": 0.5, "center_y": 0.5}
elevation: 10
orientation: "vertical"
AnchorLayout:
anchor_x: "left"
anchor_y: "top"
MDIconButton:
id:logout
text_color: 0,0,0,1
on_release: root.Logout(), root.teste()
icon: "account-arrow-left"
GridLayout:
cols: 2
padding: 40,0,0,0
MDLabel:
text: "ID: "
MDLabel:
text: "5000"
MDLabel:
text: "Nome: "
MDLabel:
text: "nome"
MDLabel:
text: "Cargo: "
MDLabel:
text: "cargo"
MDLabel:
text: "Salário: "
MDLabel:
text: "1000"
MDLabel:
text: "Secção: "
MDLabel:
text: "Frutaria"
MDRaisedButton:
text: "Mudar palavra-passe"
md_bg_color: 0.5, 0, 1, 1
on_press: root.teste()
pos_hint: {"center_x": 0.5, "center_y": 0.5}
on_release: root.show_alert_dialog()
MDBottomNavigationItem:
name: 'Providers'
text: 'Fornecedores'
icon: 'truck'
MDLabel:
text: 'Mail'
halign: 'center'
MDBottomNavigationItem:
name: 'Products'
text: 'Produtos'
icon: 'shopping'
badge_icon: "numeric-10"
MDLabel:
text: 'Mail'
halign: 'center'
MDBottomNavigationItem:
name: 'Employes'
text: 'Empregados'
icon: 'account-multiple'
badge_icon: "numeric-10"
MDRaisedButton:
text: "Adicionar funcionários"
md_bg_color: 0.5, 0, 1, 1
pos_hint: {"center_x": 0.5, "center_y": 0.5}
MDBottomNavigationItem:
name: 'Sections'
text: 'Secções'
icon: 'storefront'
badge_icon: "numeric-10"
MDLabel:
text: 'Mail'
halign: 'center'
This are my project files that matter for now, how can i get the .text value from the old_pass textfield in the DashboardGerente class?

I would suggest as follows,
Create a property, say, user_input = StringProperty("") in your App's subclass. then in kv lang of Content class,
MDTextField:
id: old_pass
on_text: app.user_input = self.text
Now use this in any method of DashboardGerente as MDApp.get_running_app().user_input

Related

how can i add an if condition to my app in kivymd

So the main issue with this code is that yeah sure it works fine but only displays onto the console instead of the kivy app.
def my_func(self):
open_p = self.root.get_screen("tab").ids.op.text
volume = self.root.get_screen("tab").ids.vl.text
hi = self.root.get_screen("tab").ids.hi.text
lo = self.root.get_screen("tab").ids.lo.text
model = pickle.load(open('ustech_model', 'rb'))
input_dt = (open_p, volume, lo, hi)
inpt_val = np.asarray(input_dt, dtype=float)
reshape_vals = inpt_val.reshape(1, -1)
anticipate = model.predict(reshape_vals)
# return anticipate.round(2)
if inpt_val[0] < anticipate:
print(f"Buy!! & TP:{anticipate.round(2)}")
else:
print(f"Sell!! & TP:{anticipate.round(2)}")
how can i change the output to include the text i want to be displayed on my main application
here is the rest of the code:
import numpy as np
from kivymd.app import MDApp
from kivy.lang.builder import Builder
from kivy.uix.screenmanager import Screen, ScreenManager
from kivymd.uix.screenmanager import MDScreenManager
from kivymd.uix.tab import MDTabsBase
from kivymd.uix.floatlayout import MDFloatLayout
from kivy.core.window import Window
import pickle
import warnings
# warnings.filterwarnings('ignore', category="FutureWarning")
warnings.filterwarnings('ignore', category=UserWarning)
Window.size = (400, 600)
KV = """
MDScreenManager:
HomeScreen:
Main:
<HomeScreen>:
name:'menu'
MDRectangleFlatIconButton:
text: "WELCOME"
icon: "distribute-horizontal-center"
line_color: 0, 0, 0, 0
pos_hint: {"center_x": .5, "center_y": .5}
font_size: 25
# font_name: "branda.ttf"
MDIconButton:
icon: "location-enter"
pos_hint: {'center_x': 0.5, 'center_y': 0.4}
on_press:
root.manager.current = 'tab'
root.manager.transition.direction = "left"
MDLabel:
text: "REMEMBER TO ALWAYS BE HUMBLE!!"
halign: "center"
pos_hint: {'center_y': 0.1}
font_size: 12
<Main>:
name: 'tab'
MDBoxLayout:
orientation: "vertical"
MDTopAppBar:
title: "TRADEMAVERICKS"
anchor_title: 'center'
right_action_items:
[["distribute-horizontal-center"]]
MDTabs:
id: tabs
allow_stretch: 'True'
on_tab_switch: root.on_tab_switch(*args)
# NAS100
Tab:
title: "NAS100"
MDGridLayout:
cols: 2
padding: dp(36)
spacing: dp(20)
MDTextField:
id: op
hint_text: "OPEN"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .9}
size_hint_x: None
width: 150
MDTextField:
id: vl
hint_text: "VOLUME"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .7}
size_hint_x: None
width: 150
MDTextField:
id: lo
hint_text: "LOW"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .5}
size_hint_x: None
width: 150
MDTextField:
id: hi
hint_text: "HIGH"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .3}
size_hint_x: None
width: 150
MDRaisedButton:
text: "SUBMIT"
on_release:
app.func()
# if inpt_val[0] < anticipate:
# print(f"Buy!! & TP:{anticipate.round(2)}")
# else:
# print(f"Sell!! & TP:{anticipate.round(2)}")
MDCard:
size_hint: None, None
size: "325dp", "150dp"
pos_hint: {"center_x": .5, "center_y": .32}
radius: 5
MDLabel:
text: ""
id: put_txt_here
halign: 'center'
pos_hint: {"center_x": .5, "center_y": .6}
MDIconButton:
icon: "home"
icon_size: "40"
pos_hint: {"center_x": .8, "center_y": .1}
on_press:
root.manager.current = 'menu'
root.manager.transition.direction = "right"
# US30
Tab:
title: "US30"
MDGridLayout:
cols: 2
padding: dp(36)
spacing: dp(20)
MDTextField:
id: o
hint_text: "OPEN"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .9}
size_hint_x: None
width: 150
MDTextField:
id: v
hint_text: "VOLUME"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .7}
size_hint_x: None
width: 150
MDTextField:
id: l
hint_text: "LOW"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .5}
size_hint_x: None
width: 150
MDTextField:
id: h
hint_text: "HIGH"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .3}
size_hint_x: None
width: 150
MDRaisedButton:
text: "SUBMIT"
on_release:
app.us30()
MDCard:
size_hint: None, None
size: "325dp", "150dp"
pos_hint: {"center_x": .5, "center_y": .32}
radius: 5
MDLabel:
text: ""
id: put_us30
halign: 'center'
pos_hint: {"center_x": .5, "center_y": .6}
MDIconButton:
icon: "home"
icon_size: "40"
pos_hint: {"center_x": .8, "center_y": .1}
on_press:
root.manager.current = 'menu'
root.manager.transition.direction = "right"
# GER30
Tab:
title: "GER30"
MDGridLayout:
cols: 2
padding: dp(36)
spacing: dp(20)
MDTextField:
id: op_1
hint_text: "OPEN"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .9}
size_hint_x: None
width: 150
MDTextField:
id: vol_1
hint_text: "VOLUME"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .7}
size_hint_x: None
width: 150
MDTextField:
id: lo_1
hint_text: "LOW"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .5}
size_hint_x: None
width: 150
MDTextField:
id: hi_1
hint_text: "HIGH"
mode: "line"
pos_hint: {"center_x": .5, "center_y": .3}
size_hint_x: None
width: 150
MDRaisedButton:
text: "SUBMIT"
on_release:
app.ger30()
MDCard:
size_hint: None, None
size: "325dp", "150dp"
pos_hint: {"center_x": .5, "center_y": .32}
radius: 5
MDLabel:
text: ""
id: put_ger30
halign: 'center'
pos_hint: {"center_x": .5, "center_y": .6}
MDIconButton:
icon: "home"
icon_size: "40"
pos_hint: {"center_x": .8, "center_y": .1}
on_press:
root.manager.current = 'menu'
root.manager.transition.direction = "right"
<Tab>:
MDLabel:
id: label
halign: "center"
"""
class Tab(MDFloatLayout, MDTabsBase):
pass
class HomeScreen(Screen):
pass
class Main(Screen):
def on_tab_switch(self, instance_tabs, instance_tab, instance_tab_label, tab_text):
'''Called when switching tabs.
:type instance_tabs: <kivymd.uix.tab.MDTabs object>;
:param instance_tab: <main.Tab object>;
:param instance_tab_label: <kivymd.uix.tab.MDTabsLabel object>;
:param tab_text: text or name icon of tab;
'''
# instance_tab.ids.label.text = tab_text
# 'Red', 'Pink', 'Purple', 'DeepPurple', 'Indigo', 'Blue', 'LightBlue', 'Cyan', 'Teal', 'Green',
# 'LightGreen', 'Lime', 'Yellow', 'Amber', 'Orange', 'DeepOrange', 'Brown', 'Gray', 'BlueGray'
class TM(MDApp):
def build(self):
self.theme_cls.theme_style = "Dark"
self.theme_cls.material_style = "M3"
self.theme_cls.primary_palette = "Amber"
self.icon = "logo.png"
Builder.load_string(KV)
sm = MDScreenManager()
sm.add_widget(HomeScreen(name='menu'))
sm.add_widget(Main(name='tab'))
return sm
# For NAS100
def my_func(self):
open_p = self.root.get_screen("tab").ids.op.text
volume = self.root.get_screen("tab").ids.vl.text
hi = self.root.get_screen("tab").ids.hi.text
lo = self.root.get_screen("tab").ids.lo.text
model = pickle.load(open('ustech_model', 'rb'))
input_dt = (open_p, volume, lo, hi)
inpt_val = np.asarray(input_dt, dtype=float)
reshape_vals = inpt_val.reshape(1, -1)
anticipate = model.predict(reshape_vals)
# return anticipate.round(2)
if inpt_val[0] < anticipate:
print(f"Buy!! & TP:{anticipate.round(2)}")
else:
print(f"Sell!! & TP:{anticipate.round(2)}")
def func(self):
self.root.get_screen("tab").ids.put_txt_here.text = str(self.my_func())
# For US30
def my_us30(self):
o = self.root.get_screen("tab").ids.o.text
v = self.root.get_screen("tab").ids.v.text
h = self.root.get_screen("tab").ids.h.text
l = self.root.get_screen("tab").ids.l.text
model = pickle.load(open('us30_model', 'rb'))
input_dt = (o, v, h, l)
inpt_val = np.asarray(input_dt, dtype=float)
reshape_vals = inpt_val.reshape(1, -1)
anticipate = model.predict(reshape_vals)
return anticipate.round(2)
# if inpt_val[0] < anticipate:
# print(f"Buy!! & TP:{anticipate.round(2)}")
# else:
# print(f"Sell!! & TP:{anticipate.round(2)}")
def us30(self):
self.root.get_screen("tab").ids.put_us30.text = str(self.my_us30())
# For GER30
def my_ger30(self):
op_1 = self.root.get_screen("tab").ids.op_1.text
vol_1 = self.root.get_screen("tab").ids.vol_1.text
hi_1 = self.root.get_screen("tab").ids.hi_1.text
lo_1 = self.root.get_screen("tab").ids.lo_1.text
model = pickle.load(open('us30_model', 'rb'))
input_dt = (op_1, vol_1, hi_1, lo_1)
inpt_val = np.asarray(input_dt, dtype=float)
reshape_vals = inpt_val.reshape(1, -1)
anticipate = model.predict(reshape_vals)
return anticipate.round(2)
# if inpt_val[0] < anticipate:
# print(f"Buy!! & TP:{anticipate.round(2)}")
# else:
# print(f"Sell!! & TP:{anticipate.round(2)}")
def ger30(self):
self.root.get_screen("tab").ids.put_ger30.text = str(self.my_ger30())
TM().run()
I tried to change the print to the use the id for the label but it threw an error that it couldnt be found in the function
For ger30:
# For GER30
def my_ger30(self):
op_1 = self.root.get_screen("tab").ids.op_1.text
vol_1 = self.root.get_screen("tab").ids.vol_1.text
hi_1 = self.root.get_screen("tab").ids.hi_1.text
lo_1 = self.root.get_screen("tab").ids.lo_1.text
model = pickle.load(open('us30_model', 'rb'))
input_dt = (op_1, vol_1, hi_1, lo_1)
inpt_val = np.asarray(input_dt, dtype=float)
reshape_vals = inpt_val.reshape(1, -1)
anticipate = model.predict(reshape_vals)
if inpt_val[0] < anticipate:
self.root.get_screen("tab").ids.put_ger30.text = f"Buy!! & TP:{anticipate.round(2)}"
else:
self.root.get_screen("tab").ids.put_ger30.text = f"Sell!! & TP:{anticipate.round(2)}"
def ger30(self):
self.my_ger30()

Nav Bar doesn't cover screen when opened

I'm building a registration form screen in Kivy. I have some other basic screens as part of the nav bar. However, this is the first one I'm really adding some content to. I have some round text fields that I've just thrown on there to get an idea of spacing, but currently when I reopen the NAV the bar the text field buttons appear in front of it and I want it to be behind.
from kivy import Config
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import StringProperty
from kivy.uix.image import Image
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivymd.app import MDApp
from kivy.uix.boxlayout import BoxLayout
from kivymd.theming import ThemableBehavior
from kivymd.uix.navigationdrawer import MDNavigationLayout, MDNavigationDrawer
from kivymd.uix.list import MDList, OneLineAvatarListItem, ILeftBody
from kivy.properties import ObjectProperty
from kivy.uix.widget import Widget
Config.set('input', 'mouse', 'mouse,disable_multitouch')
class DrawerList(ThemableBehavior, MDList, Screen):
pass
class NavLayout(MDNavigationLayout):
pass
class Login(Screen):
nav_drawer = ObjectProperty()
class Nav(Screen):
Login = ObjectProperty()
ScreenManager = ObjectProperty
class Homepage(Screen):
Login = ObjectProperty()
nav_drawer = ObjectProperty()
class AddNewCustomer(Screen):
nav_drawer = ObjectProperty()
class AddNewStaff(Screen):
pass
class ScreenManager(ScreenManager):
Login = ObjectProperty()
class ContentNavigationDrawer(BoxLayout):
pass
class MainApp(MDApp):
def build(self):
# Window.maximize()
# self.theme_cls.theme_style = "Light"
# self.theme_cls.primary_hue = "900"
login = Builder.load_file("login.kv")
return login
if __name__ == "__main__":
MainApp().run()
ScreenManager:
Login:
Homepage:
AddNewCustomer:
Nav:
DrawerList:
<Login>:
name: "login"
MDCard:
size_hint: None, None
size: 700, 800
pos_hint: {"center_x": 0.5, "center_y": 0.5}
elevation: 10
padding: 25
spacing: 25
orientation: 'vertical'
Image:
source: 'images/asteria.png'
size: 100, 200
MDLabel:
id: login
font_size: 40
halign: 'center'
size_hint_y: None
height: self.texture_size[1]
padding_y: 15
MDTextFieldRound:
id: user
hint_text: "username"
icon_right: "account"
size_hint_x: None
width: 200
font_size: 18
pos_hint: {"center_x": 0.5}
MDTextFieldRound:
id: password
hint_text: "password"
icon_right: "eye-off"
size_hint_x: None
width: 200
font_size: 18
pos_hint: {"center_x": 0.5}
password: True
MDRoundFlatButton:
text: "LOGIN"
font_size: 12
pos_hint: {"center_x": 0.5}
on_release:
root.manager.current = "homepage"
root.manager.transition.direction = "left"
MDRoundFlatButton:
text: "CLEAR"
font_size: 12
pos_hint: {"center_x": 0.5}
on_press: app.clear()
Widget:
size_hint_y: None
height: 50
<Nav>:
ScrollView:
MDList:
OneLineListItem:
text: "Add New Customer"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.current = "addNewCustomer"
root.screen_manager.transition.direction = "right"
OneLineListItem:
text: "Add New Staff"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.current = "addNewStaff"
OneLineListItem:
text: "Case List"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.current = "caseList"
OneLineListItem:
text: "Create Case"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.transition.direction = "left"
root.screen_manager.current = "Create Case"
OneLineListItem:
text: "Log Out"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.manager.current = "login"
root.manager.transition.direction = "right"
<Homepage>:
name: "homepage"
Screen:
BoxLayout:
orientation: 'vertical'
MDToolbar:
title: 'Navigation'
left_action_items: [['menu', lambda x: nav_drawer.set_state('toggle')]]
right_action_items: [["images/asteria.png", lambda x: None]]
elevation:5
Widget:
MDNavigationDrawer:
id: nav_drawer
Nav:
screen_manager: screen_manager
nav_drawer: nav_drawer
manager: root.manager
MDNavigationLayout:
ScreenManager:
id: screen_manager
Screen:
name: "Homepage"
MDLabel:
text: "Welcome Home"
halign: "center"
Screen:
name: "addNewCustomer"
MDLabel:
text: "Add New customer"
halign: "center"
Screen:
name: "addNewStaff"
MDLabel:
text: "Add New Staff"
halign: "center"
Screen:
name: "caseList"
MDLabel:
text: "Case List"
halign: "center"
Screen:
name: "casePool"
MDLabel:
text: "Case Pool"
halign: "center"
Screen:
name: "Create Case"
MDTextFieldRound:
id: user
hint_text: "Case Title"
icon_right: "Case Title"
size_hint_x: None
width: 275
font_size: 15
pos_hint: {"top": 0.875, "center_x": 0.155}
MDTextFieldRound:
id: user2
hint_text: "e.g. Matthew Inwards School of Swag"
mode:"rectangle"
icon_right: "Customer"
size_hint_x: None
width: 275
font_size: 14
pos_hint: {"top": 0.779, "center_x": 0.155}
Change the position of the navigation bar in the homepage:
ScreenManager:
Login:
Homepage:
AddNewCustomer:
Nav:
DrawerList:
<Login>:
name: "login"
MDCard:
size_hint: None, None
size: 700, 800
pos_hint: {"center_x": 0.5, "center_y": 0.5}
elevation: 10
padding: 25
spacing: 25
orientation: 'vertical'
Image:
source: 'images/asteria.png'
size: 100, 200
MDLabel:
id: login
font_size: 40
halign: 'center'
size_hint_y: None
height: self.texture_size[1]
padding_y: 15
MDTextFieldRound:
id: user
hint_text: "username"
icon_right: "account"
size_hint_x: None
width: 200
font_size: 18
pos_hint: {"center_x": 0.5}
MDTextFieldRound:
id: password
hint_text: "password"
icon_right: "eye-off"
size_hint_x: None
width: 200
font_size: 18
pos_hint: {"center_x": 0.5}
password: True
MDRoundFlatButton:
text: "LOGIN"
font_size: 12
pos_hint: {"center_x": 0.5}
on_release:
root.manager.current = "homepage"
root.manager.transition.direction = "left"
MDRoundFlatButton:
text: "CLEAR"
font_size: 12
pos_hint: {"center_x": 0.5}
on_press: app.clear()
Widget:
size_hint_y: None
height: 50
<Nav>:
ScrollView:
MDList:
OneLineListItem:
text: "Add New Customer"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.current = "addNewCustomer"
root.screen_manager.transition.direction = "right"
OneLineListItem:
text: "Add New Staff"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.current = "addNewStaff"
OneLineListItem:
text: "Case List"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.current = "caseList"
OneLineListItem:
text: "Create Case"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.screen_manager.transition.direction = "left"
root.screen_manager.current = "Create Case"
OneLineListItem:
text: "Log Out"
font_size: 15
halign: "center"
on_release:
root.nav_drawer.set_state("close")
root.manager.current = "login"
root.manager.transition.direction = "right"
<Homepage>:
name: "homepage"
Screen:
MDNavigationLayout:
ScreenManager:
id: screen_manager
Screen:
name: "Homepage"
MDLabel:
text: "Welcome Home"
halign: "center"
Screen:
name: "addNewCustomer"
MDLabel:
text: "Add New customer"
halign: "center"
Screen:
name: "addNewStaff"
MDLabel:
text: "Add New Staff"
halign: "center"
Screen:
name: "caseList"
MDLabel:
text: "Case List"
halign: "center"
Screen:
name: "casePool"
MDLabel:
text: "Case Pool"
halign: "center"
Screen:
name: "Create Case"
MDTextFieldRound:
id: user
hint_text: "Case Title"
icon_right: "Case Title"
size_hint_x: None
width: 275
font_size: 15
pos_hint: {"top": 0.875, "center_x": 0.155}
MDTextFieldRound:
id: user2
hint_text: "e.g. Matthew Inwards School of Swag"
mode:"rectangle"
icon_right: "Customer"
size_hint_x: None
width: 275
font_size: 14
pos_hint: {"top": 0.779, "center_x": 0.155}
BoxLayout:
orientation: 'vertical'
MDToolbar:
title: 'Navigation'
left_action_items: [['menu', lambda x: nav_drawer.set_state('open')]]
right_action_items: [["images/asteria.png", lambda x: None]]
elevation:5
Widget:
MDNavigationDrawer:
id: nav_drawer
Nav:
screen_manager: screen_manager
nav_drawer: nav_drawer
manager: root.manager

Change mouse pointer to 'hand' when hovering over a button of a screen in kivy Python

How can I change the mouse pointer to 'hand' when hovering over a button present in a screen along with a different widget in kivy python?
I tried creating two functions in a python file. But it changes the mouse cursor for the entire page. How can I change the cursor for just the button present on the page?
#Kivy design file
<Loginpage>:
name: "login"
Image:
source: 'background.jpg'
allow_stretch: True
keep_ratio: False
Screen:
MDCard:
size_hint: None,None
size: 400, 550
pos_hint: {"center_x":0.5,"center_y":0.5}
elevation: 10
padding: 25
spacing: 25
orientation: 'vertical'
MDLabel:
id: welcome_label
text: "Welcome"
font_size: 40
halign: 'center'
size_hint_y: None
height: self.texture_size[1]
padding_y:15
font_style: 'H2'
MDTextField:
id: uid
hint_text: "Username"
icon_right: "account"
size_hint_x: None
width: 200
font_size: 20
pos_hint: {"center_x": 0.5}
MDTextField:
id: pwd
hint_text: "Password"
icon_right: "lock"
size_hint_x: None
width: 200
font_size: 20
pos_hint: {"center_x": 0.5}
password: True
MDRoundFlatButton:
text: "LOG IN"
font_size: 12
pos_hint: {"center_x": 0.5}
on_press: root.logger()
MDRoundFlatButton:
text: "CLEAR"
font_size: 12
pos_hint: {"center_x": 0.5}
on_press: root.clear()
MDLabel:
id: login_label
text: "Invalid Login"
font_size: 14
halign: 'center'
size_hint_y: None
height: self.texture_size[1]
pos_hint: {"center_x": 0.5}
padding_y:15
theme_text_color:'Custom'
text_color: 1,0,0,1
Widget:
size_hint_y: None
height: 10
Python File:
class Loginpage(Screen):
def enter(self, *args):
Window.set_system_cursor('hand')
class Loginpage(Screen):
def enter(self, *args):
Window.set_system_cursor('hand')
def leave(self, *args):
Window.set_system_cursor('arrow')
def logger(self):
'''code to login'''

Get value from .kv class to .py function

I have custom class in main.kv file, and with command I can add to another screen in createRecipe.kv file. But how can I read names.text(from Label), unit.text(from Label) and qtyRe.text(from TextInput) to main.py file?
screen_manager.get_screen('createRecipe').ingredientforRecipe.add_widget(AddIngToRecipe(names=names, unit=unit))
main.kv
<AddIngToRecipe>
id: addIngToRecipe
names: names
unit: unit
MDLabel:
id: names
text: str(root.names)
markup: True
font_size: '20sp'
size_hint_x: .8
pos_hint: {"center_x": .4, "center_y": .4}
MDLabel:
id: unit
text: str(root.unit)
markup: True
font_size: '18sp'
size_hint_x: .8
theme_text_color: "Custom"
text_color: 1, 1, 1, 1
pos_hint: {"center_x": .73, "center_y": .4}
TextInput:
id: qtyRe
hint_text: 'Qty:'
size_hint: 1, None
input_filter: 'int'
pos_hint: {"center_x": .5, "center_y": .5}
height: 55
cursor_color: 75/255, 0/255, 130/255, 1
background_color: 0, 0, 0, 0
multiline: False
createRecipe.kv
MDScreen:
name: 'createRecipe'
ingredientforRecipe: ingredientforRecipe
MDFloatLayout:
id: create_recipe
ScrollView:
do_scroll_y: True
do_scroll_x: False
size_hint_y: .41
pos_hint: {"center_x": .55, "y": 0.41}
bar_width: 0
GridLayout:
id: ingredientforRecipe
cols: 1
height: self.minimum_height
row_default_height: 70
size_hint_y: None
main.py
class AddIngToRecipe(FakeRectangularElevationBehavior, FloatLayout, TouchBehavior):
names = ObjectProperty()
unit = ObjectProperty()
def get_from(self):
names1 = self.ids.qtyRe.text
print(names1)
class PieceofCake(MDApp, Screen):
def create_recipe(self, Renames, Recomment):
self.get_from_addIngToRecipe = AddIngToRecipe()
self.get_from_addIngToRecipe.get_from()
names = self.ids.ingredientforRecipe.qtyRe.text
print(names)
print(Renames)
print(Recomment)
names = self.ids.names.text
unit = self.ids.unit.text
qtyRe = self.ids.qtyRe.text
Further more, if you want to access values of a widget from a different class from the one you are working with by any chance, you can use:
MDApp.get_running_app().root.ids.idOfTheClass.ids.idOfTheWidget.valueToGet
MDApp.get_running_app().root.ids.idOfTheClass acts the same as self for the targeted class

Python kivy md Navigation Bar placement?

I am trying to restructure the kivymd project file but I am not able to place the navigation bar at the place at which it is normally. I cannot see why this is happening (see pictures and code below).
This is how it looks like
and this is how it should look like
I am using the three files app.py, app.kv and labels.py (for injecting labels from a *.py file).
# app.kv
# -*- coding: utf-8 -*-
import os
import kivy.app
from kivy.lang import Builder
from application.kivymd.list import BaseListItem
from application.kivymd.material_resources import DEVICE_TYPE
from application.kivymd.navigationdrawer import MDNavigationDrawer, NavigationDrawerHeaderBase
from application.kivymd.theming import ThemeManager
# User defined imports
from kivy.core.window import Window
Window.fullscreen = "auto"
class HackedDemoNavDrawer(MDNavigationDrawer):
# DO NOT USE
def add_widget(self, widget, index=0):
if issubclass(widget.__class__, BaseListItem):
self._list.add_widget(widget, index)
if len(self._list.children) == 1:
widget._active = True
self.active_item = widget
# widget.bind(on_release=lambda x: self.panel.toggle_state())
widget.bind(on_release=lambda x: x._set_active(True, list=self))
elif issubclass(widget.__class__, NavigationDrawerHeaderBase):
self._header_container.add_widget(widget)
else:
super(MDNavigationDrawer, self).add_widget(widget, index)
class MainApp(kivy.app.App):
theme_cls = ThemeManager()
title = "Application"
def build(self):
main_widget = Builder.load_file(
os.path.join(os.path.dirname(__file__), "./app.kv")
)
# self.theme_cls.theme_style = 'Dark'
main_widget.ids.text_field_error.bind(
on_text_validate=self.set_error_message,
on_focus=self.set_error_message)
self.bottom_navigation_remove_mobile(main_widget)
return main_widget
def bottom_navigation_remove_mobile(self, widget):
# Removes some items from bottom-navigation demo when on mobile
if DEVICE_TYPE == 'mobile':
widget.ids.bottom_navigation_demo.remove_widget(widget.ids.bottom_navigation_desktop_2)
if DEVICE_TYPE == 'mobile' or DEVICE_TYPE == 'tablet':
widget.ids.bottom_navigation_demo.remove_widget(widget.ids.bottom_navigation_desktop_1)
def set_error_message(self, *args):
if len(self.root.ids.text_field_error.text) == 2:
self.root.ids.text_field_error.error = True
else:
self.root.ids.text_field_error.error = False
def on_pause(self):
return True
def on_stop(self):
pass
if __name__ == '__main__':
MainApp().run()
This is the app.kv file which is injected into the app.py file
# app.kv
#:import Toolbar application.kivymd.toolbar.Toolbar
#:import MDNavigationDrawer application.kivymd.navigationdrawer.MDNavigationDrawer
#:import NavigationLayout application.kivymd.navigationdrawer.NavigationLayout
#:import NavigationDrawerDivider application.kivymd.navigationdrawer.NavigationDrawerDivider
#:import NavigationDrawerToolbar application.kivymd.navigationdrawer.NavigationDrawerToolbar
#:import NavigationDrawerSubheader application.kivymd.navigationdrawer.NavigationDrawerSubheader
#:import MDCheckbox application.kivymd.selectioncontrols.MDCheckbox
#:import MDSwitch application.kivymd.selectioncontrols.MDSwitch
#:import MDTextField application.kivymd.textfields.MDTextField
#:import MDThemePicker application.kivymd.theme_picker.MDThemePicker
#:import labels application.labels
NavigationLayout:
id: nav_layout
MDNavigationDrawer:
id: nav_drawer
NavigationDrawerToolbar:
title: labels.NAVIGATION
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: labels.DASHBOARD
on_release: app.root.ids.scr_mngr.current = 'dashboard'
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: labels.SYSTEM_INSPECTOR
on_release: app.root.ids.scr_mngr.current = 'system_inspector'
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: labels.SYSTEM_PARAMETERS
on_release: app.root.ids.scr_mngr.current = 'system_parameters'
BoxLayout:
orientation: 'vertical'
halign: "center"
Toolbar:
id: toolbar
title: labels.APPLICATION_NAME
md_bg_color: app.theme_cls.primary_color
background_palette: 'Primary'
background_hue: '500'
left_action_items: [['menu', lambda x: app.root.toggle_nav_drawer()]]
#right_action_items: [['dots-vertical', lambda x: app.root.toggle_nav_drawer()]]
ScreenManager:
id: scr_mngr
Screen:
name: 'dashboard'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "This is the dashboard!"
size_hint_x:None
width: '250dp'
halign: "center"
pos_hint: {"center_x": 0.50, "center_y": 0.75}
MDCheckbox:
id: grp_chkbox_1
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.25, 'center_y': 0.5}
MDCheckbox:
id: grp_chkbox_2
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
MDSwitch:
size_hint: None, None
size: dp(36), dp(48)
pos_hint: {'center_x': 0.75, 'center_y': 0.5}
_active: False
Screen:
name: 'system_inspector'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "This is the system_inspector page!"
size_hint_x:None
width: '250dp'
halign: "center"
pos_hint: {"center_x": 0.50, "center_y": 0.75}
MDCheckbox:
id: grp_chkbox_1
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.25, 'center_y': 0.5}
MDCheckbox:
id: grp_chkbox_2
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
MDSwitch:
size_hint: None, None
size: dp(36), dp(48)
pos_hint: {'center_x': 0.75, 'center_y': 0.5}
_active: False
Screen:
name: 'system_parameters'
BoxLayout:
orientation: "horizontal"
BoxLayout:
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
padding: dp(48)
spacing: 10
MDTextField:
hint_text: "No helper text"
input_filter: "float"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
input_filter: "int"
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
BoxLayout:
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
padding: dp(48)
spacing: 10
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
Screen:
name: 'textfields'
ScrollView:
BoxLayout:
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
padding: dp(48)
spacing: 10
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
MDTextField:
hint_text: "Persistent helper text"
helper_text: "Text is always here"
helper_text_mode: "persistent"
MDTextField:
id: text_field_error
hint_text: "Helper text on error (Hit Enter with two characters here)"
helper_text: "Two is my least favorite number"
helper_text_mode: "on_error"
MDTextField:
hint_text: "Max text length = 10"
max_text_length: 10
MDTextField:
hint_text: "required = True"
required: True
helper_text_mode: "on_error"
MDTextField:
multiline: True
hint_text: "Multi-line text"
helper_text: "Messages are also supported here"
helper_text_mode: "persistent"
MDTextField:
hint_text: "color_mode = \'accent\'"
color_mode: 'accent'
MDTextField:
hint_text: "color_mode = \'custom\'"
color_mode: 'custom'
helper_text_mode: "on_focus"
helper_text: "Color is defined by \'line_color_focus\' property"
line_color_focus: self.theme_cls.opposite_bg_normal # This is the color used by the textfield
MDTextField:
hint_text: "disabled = True"
disabled: True
Screen:
name: 'nav_drawer'
HackedDemoNavDrawer:
# NavigationDrawerToolbar:
# title: "Navigation Drawer Widgets"
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: "Badge text ---->"
badge_text: "99+"
NavigationDrawerIconButton:
active_color_type: 'accent'
text: "Accent active color"
NavigationDrawerIconButton:
active_color_type: 'custom'
text: "Custom active color"
active_color: [1, 0, 1, 1]
NavigationDrawerIconButton:
use_active: False
text: "Use active = False"
NavigationDrawerIconButton:
text: "Different icon"
icon: 'alarm'
NavigationDrawerDivider:
NavigationDrawerSubheader:
text: "NavigationDrawerSubheader"
NavigationDrawerIconButton:
text: "NavigationDrawerDivider \/"
NavigationDrawerDivider:
Here is the labels.py file for injecting the labels into the kv file.
# labels.py
APPLICATION_NAME = "Application"
NAVIGATION = "Navigation"
DASHBOARD = "Dashboard"
SYSTEM_INSPECTOR = "System Inspector"
SYSTEM_PARAMETERS = "System Parameters"
Solution
You might have a kv file with a name, main.kv
With KivyMD installed on my machine, and some minor changes, the KivyMD App ran fine.
Example
app.py
# app.py
# -*- coding: utf-8 -*-
import os
from kivy.app import App
from kivy.lang import Builder
from kivymd.list import BaseListItem
from kivymd.material_resources import DEVICE_TYPE
from kivymd.navigationdrawer import MDNavigationDrawer, NavigationDrawerHeaderBase
from kivymd.theming import ThemeManager
# User defined imports
from kivy.core.window import Window
# Window.fullscreen = "auto"
class HackedDemoNavDrawer(MDNavigationDrawer):
# DO NOT USE
def add_widget(self, widget, index=0):
if issubclass(widget.__class__, BaseListItem):
self._list.add_widget(widget, index)
if len(self._list.children) == 1:
widget._active = True
self.active_item = widget
# widget.bind(on_release=lambda x: self.panel.toggle_state())
widget.bind(on_release=lambda x: x._set_active(True, list=self))
elif issubclass(widget.__class__, NavigationDrawerHeaderBase):
self._header_container.add_widget(widget)
else:
super(MDNavigationDrawer, self).add_widget(widget, index)
class MainApp(App):
theme_cls = ThemeManager()
title = "Application"
def build(self):
main_widget = Builder.load_file(
os.path.join(os.path.dirname(__file__), "./app.kv")
)
# self.theme_cls.theme_style = 'Dark'
main_widget.ids.text_field_error.bind(
on_text_validate=self.set_error_message,
on_focus=self.set_error_message)
self.bottom_navigation_remove_mobile(main_widget)
return main_widget
def bottom_navigation_remove_mobile(self, widget):
# Removes some items from bottom-navigation demo when on mobile
if DEVICE_TYPE == 'mobile':
widget.ids.bottom_navigation_demo.remove_widget(widget.ids.bottom_navigation_desktop_2)
if DEVICE_TYPE == 'mobile' or DEVICE_TYPE == 'tablet':
widget.ids.bottom_navigation_demo.remove_widget(widget.ids.bottom_navigation_desktop_1)
def set_error_message(self, *args):
if len(self.root.ids.text_field_error.text) == 2:
self.root.ids.text_field_error.error = True
else:
self.root.ids.text_field_error.error = False
def on_pause(self):
return True
def on_stop(self):
pass
if __name__ == '__main__':
MainApp().run()
labels.py
# labels.py
APPLICATION_NAME = "Application"
NAVIGATION = "Navigation"
DASHBOARD = "Dashboard"
SYSTEM_INSPECTOR = "System Inspector"
SYSTEM_PARAMETERS = "System Parameters"
app.kv
# app.kv
#:kivy 1.11.0
#:import Toolbar kivymd.toolbar.Toolbar
#:import MDNavigationDrawer kivymd.navigationdrawer.MDNavigationDrawer
#:import NavigationLayout kivymd.navigationdrawer.NavigationLayout
#:import NavigationDrawerDivider kivymd.navigationdrawer.NavigationDrawerDivider
#:import NavigationDrawerToolbar kivymd.navigationdrawer.NavigationDrawerToolbar
#:import NavigationDrawerSubheader kivymd.navigationdrawer.NavigationDrawerSubheader
#:import MDCheckbox kivymd.selectioncontrols.MDCheckbox
#:import MDSwitch kivymd.selectioncontrols.MDSwitch
#:import MDTextField kivymd.textfields.MDTextField
#:import MDThemePicker kivymd.theme_picker.MDThemePicker
#:import labels labels
NavigationLayout:
id: nav_layout
MDNavigationDrawer:
id: nav_drawer
NavigationDrawerToolbar:
title: labels.NAVIGATION
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: labels.DASHBOARD
on_release: app.root.ids.scr_mngr.current = 'dashboard'
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: labels.SYSTEM_INSPECTOR
on_release: app.root.ids.scr_mngr.current = 'system_inspector'
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: labels.SYSTEM_PARAMETERS
on_release: app.root.ids.scr_mngr.current = 'system_parameters'
BoxLayout:
orientation: 'vertical'
halign: "center"
Toolbar:
id: toolbar
title: labels.APPLICATION_NAME
md_bg_color: app.theme_cls.primary_color
background_palette: 'Primary'
background_hue: '500'
left_action_items: [['menu', lambda x: app.root.toggle_nav_drawer()]]
#right_action_items: [['dots-vertical', lambda x: app.root.toggle_nav_drawer()]]
ScreenManager:
id: scr_mngr
Screen:
name: 'dashboard'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "This is the dashboard!"
size_hint_x:None
width: '250dp'
halign: "center"
pos_hint: {"center_x": 0.50, "center_y": 0.75}
MDCheckbox:
id: grp_chkbox_1
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.25, 'center_y': 0.5}
MDCheckbox:
id: grp_chkbox_2
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
MDSwitch:
size_hint: None, None
size: dp(36), dp(48)
pos_hint: {'center_x': 0.75, 'center_y': 0.5}
_active: False
Screen:
name: 'system_inspector'
MDLabel:
font_style: 'Body1'
theme_text_color: 'Primary'
text: "This is the system_inspector page!"
size_hint_x:None
width: '250dp'
halign: "center"
pos_hint: {"center_x": 0.50, "center_y": 0.75}
MDCheckbox:
id: grp_chkbox_1
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.25, 'center_y': 0.5}
MDCheckbox:
id: grp_chkbox_2
group: 'test'
size_hint: None, None
size: dp(48), dp(48)
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
MDSwitch:
size_hint: None, None
size: dp(36), dp(48)
pos_hint: {'center_x': 0.75, 'center_y': 0.5}
_active: False
Screen:
name: 'system_parameters'
BoxLayout:
orientation: "horizontal"
BoxLayout:
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
padding: dp(48)
spacing: 10
MDTextField:
hint_text: "No helper text"
input_filter: "float"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
input_filter: "int"
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
BoxLayout:
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
padding: dp(48)
spacing: 10
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
Screen:
name: 'textfields'
ScrollView:
BoxLayout:
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
padding: dp(48)
spacing: 10
MDTextField:
hint_text: "No helper text"
MDTextField:
hint_text: "Helper text on focus"
helper_text: "This will disappear when you click off"
helper_text_mode: "on_focus"
MDTextField:
hint_text: "Persistent helper text"
helper_text: "Text is always here"
helper_text_mode: "persistent"
MDTextField:
id: text_field_error
hint_text: "Helper text on error (Hit Enter with two characters here)"
helper_text: "Two is my least favorite number"
helper_text_mode: "on_error"
MDTextField:
hint_text: "Max text length = 10"
max_text_length: 10
MDTextField:
hint_text: "required = True"
required: True
helper_text_mode: "on_error"
MDTextField:
multiline: True
hint_text: "Multi-line text"
helper_text: "Messages are also supported here"
helper_text_mode: "persistent"
MDTextField:
hint_text: "color_mode = \'accent\'"
color_mode: 'accent'
MDTextField:
hint_text: "color_mode = \'custom\'"
color_mode: 'custom'
helper_text_mode: "on_focus"
helper_text: "Color is defined by \'line_color_focus\' property"
line_color_focus: self.theme_cls.opposite_bg_normal # This is the color used by the textfield
MDTextField:
hint_text: "disabled = True"
disabled: True
Screen:
name: 'nav_drawer'
HackedDemoNavDrawer:
# NavigationDrawerToolbar:
# title: "Navigation Drawer Widgets"
NavigationDrawerIconButton:
icon: 'checkbox-blank-circle'
text: "Badge text ---->"
badge_text: "99+"
NavigationDrawerIconButton:
active_color_type: 'accent'
text: "Accent active color"
NavigationDrawerIconButton:
active_color_type: 'custom'
text: "Custom active color"
active_color: [1, 0, 1, 1]
NavigationDrawerIconButton:
use_active: False
text: "Use active = False"
NavigationDrawerIconButton:
text: "Different icon"
icon: 'alarm'
NavigationDrawerDivider:
NavigationDrawerSubheader:
text: "NavigationDrawerSubheader"
NavigationDrawerIconButton:
text: "NavigationDrawerDivider \/"
NavigationDrawerDivider:
Output

Categories

Resources