Add window size variable from kivy_state

This commit is contained in:
shekhar-cis 2022-09-07 19:51:38 +05:30
parent 19d5556f66
commit 5267d6068c
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
2 changed files with 7 additions and 3 deletions

View File

@ -108,7 +108,7 @@
height:"35dp" height:"35dp"
NavigationItem: NavigationItem:
height: dp(48) height: dp(48)
CustomSpinner: IdentitySpinner:
id: identity_dropdown id: identity_dropdown
pos_hint:{"x":0,"y":0} pos_hint:{"x":0,"y":0}
option_cls: Factory.get("MySpinnerOption") option_cls: Factory.get("MySpinnerOption")
@ -246,8 +246,8 @@ MDNavigationLayout:
# id:sc16 # id:sc16
# Allmails: # Allmails:
# id:sc17 # id:sc17
ScanScreen: # ScanScreen:
id:is_scanscreen # id:is_scanscreen
MDNavigationDrawer: MDNavigationDrawer:
id: nav_drawer id: nav_drawer

View File

@ -13,6 +13,7 @@ from functools import partial
from kivy.clock import Clock from kivy.clock import Clock
from kivy.lang import Builder from kivy.lang import Builder
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout from kivy.uix.boxlayout import BoxLayout
from kivymd.app import MDApp from kivymd.app import MDApp
@ -80,10 +81,13 @@ class IdentitySpinner(BaseIdentitySpinner):
class NavigateApp(MDApp): class NavigateApp(MDApp):
"""Navigation Layout of class""" """Navigation Layout of class"""
kivy_state = KivyStateVariables()
title = "PyBitmessage" title = "PyBitmessage"
identity_list = get_identity_list() identity_list = get_identity_list()
image_path = load_image_path() image_path = load_image_path()
app_platform = platform app_platform = platform
kivy_state.screen_density = Window.size
window_size = kivy_state.screen_density
tr = Lang("en") # for changing in franch replace en with fr tr = Lang("en") # for changing in franch replace en with fr
def __init__(self): def __init__(self):